WebKit-https.git
6 months agoSDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
jer.noble@apple.com [Fri, 18 Jan 2019 22:53:49 +0000 (22:53 +0000)]
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553

Reviewed by Tim Horton.

.:

* Makefile.shared:

PerformanceTests:

* MediaTime/Configurations/Base.xcconfig:
* MediaTime/Configurations/SDKVariant.xcconfig: Added.

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WebCore.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/PAL.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/BaseTarget.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WebKitLegacy.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Tools:

Add a check-webkit-style check that ensures all SDKVariant.xcconfig files match.

* ContentExtensionTester/Configurations/Base.xcconfig:
* ContentExtensionTester/Configurations/SDKVariant.xcconfig: Added.
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/SDKVariant.xcconfig: Added.
* ImageDiff/cg/Configurations/Base.xcconfig:
* ImageDiff/cg/Configurations/SDKVariant.xcconfig: Added.
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/SDKVariant.xcconfig: Added.
* MobileMiniBrowser/Configurations/Base.xcconfig:
* MobileMiniBrowser/Configurations/SDKVariant.xcconfig: Added.
* Scripts/webkitpy/style/checker.py:
(_all_categories):
(FileType):
(CheckerDispatcher._file_type):
(CheckerDispatcher._create_checker):
* Scripts/webkitpy/style/checkers/sdkvariant.py: Added.
(SDKVariantChecker):
(SDKVariantChecker.__init__):
(SDKVariantChecker.check):
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/SDKVariant.xcconfig: Added.
* WebEditingTester/Configurations/Base.xcconfig:
* WebEditingTester/Configurations/SDKVariant.xcconfig: Added.
* WebKitLauncher/Configurations/SDKVariant.xcconfig: Added.
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/SDKVariant.xcconfig: Added.
* lldb/lldbWebKitTester/Configurations/Base.xcconfig:
* lldb/lldbWebKitTester/Configurations/SDKVariant.xcconfig: Added.

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

6 months agoGigacages should start allocations from a slide
keith_miller@apple.com [Fri, 18 Jan 2019 22:48:22 +0000 (22:48 +0000)]
Gigacages should start allocations from a slide
https://bugs.webkit.org/show_bug.cgi?id=193523

Reviewed by Mark Lam.

Source/bmalloc:

This patch makes it so that Gigacage Heaps slide the start of the
cage by some random amount. We still ensure that there is always
at least 4/2GB, on MacOS/iOS respectively, of VA space available
for allocation.

Also, this patch changes some macros into constants since macros
are the devil.

* bmalloc/Gigacage.cpp:
(Gigacage::bmalloc::protectGigacageBasePtrs):
(Gigacage::bmalloc::unprotectGigacageBasePtrs):
(Gigacage::bmalloc::runwaySize):
(Gigacage::ensureGigacage):
(Gigacage::shouldBeEnabled):
* bmalloc/Gigacage.h:
(Gigacage::name):
(Gigacage::gigacageSizeToMask):
(Gigacage::size):
(Gigacage::mask):
(Gigacage::basePtr):
(Gigacage::ensureGigacage):
(Gigacage::wasEnabled):
(Gigacage::isCaged):
(Gigacage::isEnabled):
(Gigacage::caged):
(Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
(Gigacage::canPrimitiveGigacageBeDisabled):
(Gigacage::disablePrimitiveGigacage):
(Gigacage::addPrimitiveDisableCallback):
(Gigacage::removePrimitiveDisableCallback):
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
* bmalloc/Sizes.h:
(bmalloc::Sizes::maskSizeClass):
(bmalloc::Sizes::maskObjectSize):
(bmalloc::Sizes::logSizeClass):
(bmalloc::Sizes::logObjectSize):
(bmalloc::Sizes::sizeClass):
(bmalloc::Sizes::objectSize):
(bmalloc::Sizes::pageSize):

Source/JavaScriptCore:

This patch changes some macros into constants since macros are the
devil.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::caged):
* llint/LowLevelInterpreter64.asm:

Source/WTF:

This patch changes some macros into constants since macros are the
devil.

* wtf/Gigacage.cpp:
* wtf/Gigacage.h:

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

6 months agoCSS auto focus-ring outlines don't render on iOS
dbates@webkit.org [Fri, 18 Jan 2019 22:26:37 +0000 (22:26 +0000)]
CSS auto focus-ring outlines don't render on iOS
https://bugs.webkit.org/show_bug.cgi?id=193583
<rdar://problem/6508697>

Reviewed by Simon Fraser.

Source/WebCore:

Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
enabled.

For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.

* SourcesCocoa.txt: Add file ColorIOS.mm.
* WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
(WebCore::GraphicsContext::drawFocusRing):
Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
This is always enabled on Mac.

* platform/ios/ColorIOS.h: Added.
* platform/ios/ColorIOS.mm: Added.
(WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
This is always enabled on Mac.

* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
(WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
return false - the iOS theme code does not support painting focus rings. By returning false we
will use the platform-independent, non-theme code path to draw focus rings.

Source/WebCore/PAL:

Forward declare some IPI.

* pal/spi/ios/UIKitSPI.h:

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

6 months agoWeb Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating...
drousso@apple.com [Fri, 18 Jan 2019 22:21:02 +0000 (22:21 +0000)]
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'resource.finished')
https://bugs.webkit.org/show_bug.cgi?id=193589

Reviewed by Joseph Pecoraro.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.get supportsSave):
(WI.NetworkTableContentView.prototype._HARResources):

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

6 months agoUnreviewed, rolling out r240160.
jlewis3@apple.com [Fri, 18 Jan 2019 21:32:32 +0000 (21:32 +0000)]
Unreviewed, rolling out r240160.

This broke multiple internal builds.

Reverted changeset:

"Gigacages should start allocations from a slide"
https://bugs.webkit.org/show_bug.cgi?id=193523
https://trac.webkit.org/changeset/240160

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

6 months agoFollow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKit...
ddkilzer@apple.com [Fri, 18 Jan 2019 21:16:33 +0000 (21:16 +0000)]
Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
<https://webkit.org/b/193568>
<rdar://problem/47381130>

* editing/cocoa/DictionaryLookup.mm:
(-[WebRevealHighlight drawHighlightContentForItem:context:]):
Fix the build by changing getUIApplicationClass() to
PAL::getUIApplicationClass().

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

6 months agoSwitch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink...
ddkilzer@apple.com [Fri, 18 Jan 2019 20:41:58 +0000 (20:41 +0000)]
Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
<https://webkit.org/b/193568>
<rdar://problem/47381130>

Reviewed by Alex Christensen.

Source/WebCore:

This does the following:
- Removes local soft-linking of UIKit.
- Switches to using PAL functions for soft-linking.

* SourcesCocoa.txt: Add 4 source files to UnifiedSources.
* WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
from WebCore target now that they are in UnifiedSources.
* editing/cocoa/DictionaryLookup.mm:
* editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
declarations in public headers.
(_fontForNameAndSize): Change use of getUIFontClass() to
PlatformFontClass.
(HTMLConverter::_processElement): Add cast here since compiler
finds the wrong selector for +clearColor and thinks it returns a
`CIColor *` object.  The same cast already exists in
VideoFullscreenInterfaceAVKit.mm.
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::defaultTextAutosizingEnabled):
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
* platform/ios/DragImageIOS.mm:
(WebCore::scaleDragImage):
(WebCore::createDragImageFromImage):
(WebCore::cascadeForSystemFont):
(WebCore::createDragImageForLink):
(WebCore::createDragImageForSelection):
(WebCore::createDragImageForRange):
(WebCore::createDragImageForColor):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::PlatformPasteboard):
(WebCore::PlatformPasteboard::color):
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::setColor):
* platform/ios/ThemeIOS.mm:
(WebCore::ThemeIOS::userPrefersReducedMotion const):
* platform/ios/UserAgentIOS.mm:
(WebCore::isClassic):
(WebCore::isClassicPad):
(WebCore::isClassicPhone):
* platform/ios/ValidationBubbleIOS.mm:
(-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
(WebCore::ValidationBubble::ValidationBubble):
(WebCore::ValidationBubble::show):
(WebCore::fallbackViewController):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(clearUIColor):
(allocWebAVPictureInPicturePlayerLayerViewInstance):
(WebAVPlayerLayerView_videoView):
(fallbackViewController):
(VideoFullscreenInterfaceAVKit::doSetup):
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]):
* platform/ios/WebItemProviderPasteboard.mm:
(allLoadableClasses):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::setUpFullscreen):
* platform/network/mac/WebCoreURLResponse.mm: Add missing header
after unified sources were updated.
* rendering/RenderThemeIOS.mm:
(WebCore::contentSizeCategoryDidChange):
(WebCore::RenderThemeIOS::RenderThemeIOS):
(WebCore::RenderThemeIOS::contentSizeCategory):
(WebCore::RenderThemeIOS::systemColor const):
(WebCore::attachmentActionColor):
(WebCore::attachmentTitleColor):
(WebCore::attachmentSubtitleColor):
(WebCore::iconForAttachment):
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion const):

Source/WebCore/PAL:

* pal/ios/UIKitSoftLink.h:
* pal/ios/UIKitSoftLink.mm:
- Add constants, classes and functions that were previously
  soft-linked in separate source files.
- UIAccessibilityAnnouncementNotification is declared as a
  variable because this constant is not marked as `const` in
  UIKit.
* pal/spi/ios/UIKitSPI.h:
- Move SPI declarations from HTMLConverter.mm to here.

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
- Remove unused soft-linking macros.
(-[WebUITextIndicatorData initWithImage:textIndicatorData:scale:]):
(-[WebUITextIndicatorData initWithImage:scale:]):
- Update to use exported PAL functions.

Tools:

Make sure no one re-introduces UIKit soft-linking by adding a
style rule.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_language): Add softlink/uikit check.
(CppChecker): Enable softlink/uikit check.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest): Add test for softlink/uikit.

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

6 months agoUpdate Bugzilla running on bugs.webkit.org and bugs.webkit-uat.org to version 5.0.4
commit-queue@webkit.org [Fri, 18 Jan 2019 20:39:32 +0000 (20:39 +0000)]
Update Bugzilla running on bugs.webkit.org and bugs.webkit-uat.org to version 5.0.4
https://bugs.webkit.org/show_bug.cgi?id=193477
<rdar://problem/37618737>

Patch by Ling Ho <lingho@apple.com> on 2019-01-18
Reviewed by Lucas Forschler.

* Bugzilla/Config.pm:
(write_params):
(read_param_file):
* Bugzilla/Constants.pm:
* Bugzilla/DB/Sqlite.pm:
(sql_date_format):
* Bugzilla/Install/Filesystem.pm:
(update_filesystem):
(_update_old_mining_filenames):
* Bugzilla/Install/Requirements.pm:
(REQUIRED_MODULES):
* Bugzilla/JobQueue.pm:
(subprocess_worker):
(kill_worker):
* Bugzilla/Migrate.pm:
(parse_date):
* Bugzilla/Template.pm:
(_concatenate_css):
(_concatenate_js):
* Bugzilla/Util.pm:
(read_text):
(write_text):
(datetime_from):
* contrib/jb2bz.py:
(process_reply_file):
(maybe_add_attachment):
(process_text_plain):
(process_multi_part):
(process_jitterbug):
(process_mime_body): Deleted.
* docs/en/rst/conf.py:
* docs/en/rst/installing/linux.rst:
* docs/en/rst/installing/mac-os-x.rst:
* docs/en/rst/installing/migrating-from-2.inc.rst:
* docs/en/rst/installing/migrating.rst:
* docs/en/rst/installing/quick-start.rst:
* docs/en/rst/installing/upgrading-with-git.rst:
* docs/en/rst/installing/windows.rst:
* docs/en/rst/integrating/extensions.rst:
* docs/en/rst/integrating/skins.rst:
* editflagtypes.cgi:
(get_products_and_components):
* taskgraph.json:
* template/en/default/pages/release-notes.html.tmpl:

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

6 months ago[GTK] install-dependencies tool looks for libunistring-dev for dnf
jdiggs@igalia.com [Fri, 18 Jan 2019 20:38:28 +0000 (20:38 +0000)]
[GTK] install-dependencies tool looks for libunistring-dev for dnf
https://bugs.webkit.org/show_bug.cgi?id=193584

Change "-dev" to "-devel".

Reviewed by Michael Catanzaro.

* gtk/install-dependencies:

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

6 months agowebkitpy: Add iPhone and iPad ports
jbedard@apple.com [Fri, 18 Jan 2019 20:12:38 +0000 (20:12 +0000)]
webkitpy: Add iPhone and iPad ports
https://bugs.webkit.org/show_bug.cgi?id=193537
<rdar://problem/47353390>

Reviewed by Lucas Forschler.

Add --iphone-simulator and --ipad-simulator commands to run-webkit-tests which separate iPhone and iPad into separate
ports. Note that this separation is optional, the --ios-simulator command remains.

* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(RunTest.test_device_type_test_division): Drive-by fix.
(RunTest.test_device_type_specific_listing): Ditto.
(RunTest.test_ipad_test_division):
(RunTest):
(RunTest.test_ipad_listing):
* Scripts/webkitpy/port/factory.py:
(platform_options): Add --iphone-simulator and --ipad-simulator flags.
(PortFactory):
* Scripts/webkitpy/port/ios_simulator.py:
(IPhoneSimulatorPort):
(IPadSimulatorPort):

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

6 months agoImplement asynchronous frame scrolling for iOS
antti@apple.com [Fri, 18 Jan 2019 20:07:44 +0000 (20:07 +0000)]
Implement asynchronous frame scrolling for iOS
https://bugs.webkit.org/show_bug.cgi?id=193539
<rdar://problem/47379873>

Reviewed by Simon Fraser.

Source/WebCore:

This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
internal setting (still off by default).

* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):

Export ScrollingTreeFrameScrollingNodeIOS.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateScrollLayerClipping):

If we don't have a separate clip layer, just resize and position the scroll layer.

(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):

Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
Don't create a separate clip layer since the scroll layer will handle clipping.

* rendering/RenderLayerCompositor.h:

Source/WebKit:

Add a scrolling node type that can handle UIScrollView backed frames.
It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.

* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

* platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:

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

6 months agoRegression(PSON) Scroll position is not always restored properly when navigating...
cdumez@apple.com [Fri, 18 Jan 2019 19:47:33 +0000 (19:47 +0000)]
Regression(PSON) Scroll position is not always restored properly when navigating back
https://bugs.webkit.org/show_bug.cgi?id=193578
<rdar://problem/47386331>

Reviewed by Tim Horton.

Source/WebKit:

Fix issues causing the scroll position to not be restored at all (or incorrectly) when
navigating back cross-site with PSON enabled. Also make sure that the swipe gesture
snapshot really stays up until we've restored the scroll position.

Note that even after those changes, I can still sometimes reproduce a white flash when
swiping back to Google search results (scroll position being correct now). This is
tracked by <rdar://problem/47071684> and happens even if I disable PSON entirely.

* Shared/SessionState.cpp:
(WebKit::FrameState::encode const):
(WebKit::FrameState::decode):
* Shared/SessionState.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
obscuredInsets is present on the HistoryItem in the WebProcess but was never passed to
or stored by the UIProcess on the WebBackForwardListItem. obscuredInsets is needed to
properly restore the scrollPosition (position was 70px off on my iPad without this).
With PSON enabled, if you swipe back cross-process and the previous page was not put
into PageCache, then the HistoryItem is gone on the WebProcess side. What happens is
that the UIProcess sends its WebBackForwardListItem to the WebProcess, which restores
the HistoryItem there, and then asks it to load it. The obscuredInsets was getting lost
in the process since the UIProcess never knew about it.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
Drop logic that was causing the ViewGestureController to not wait for the scroll position
to be restored before taking down the snapshot, when UI-side compositing is enabled.
If you look at the comment above the code, you'll see that the code in question was meant
to impact only the non-UI side compositing code path. As a matter of fact, when the code
was reviewed at https://bugs.webkit.org/show_bug.cgi?id=151224, it was protected by a
#if PLATFORM(MAC), before getting modified the wrong way before landing. In practice, we
would have often restored the scroll position by the time the load is finished so it would
not cause a flash in most cases. However, with PSON enabled and the layer tree freezing we
do on process-swap, the first post-scroll restoration layer tree commit may now occur a
little bit later and we would lose the race more often.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::updateBackForwardItem):
* UIProcess/WebProcessProxy.h:
When adding PageCache support to PSON, we used to navigate the "suspended" page to
about:blank. This would lead to unwanted WebProcessProxy::updateBackForwardItem()
calls from the WebProcess which we wanted to ignore. We thus added logic to ignore
updateBackForwardItem() IPC from the old WebProcess after a swap. The issue with this
is that we sometimes miss/ignore legit updates to the HistoryItem from the old process,
in particular with regards to the scroll position and the pageScaleFactor. So if you
swiped and then quickly enough did a cross-site navigation, the UIProcess'
WebBackForwardList would not get updated with the latest scroll position and we would
thus fail to restore it later on. To address the issue, we now stop ignoring updates
from the old WebProcess after a swap. This logic is no longer needed since we no longer
navigate the old page to about:blank after a swap, we merely suspend it "in place".

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoGigacages should start allocations from a slide
keith_miller@apple.com [Fri, 18 Jan 2019 19:38:56 +0000 (19:38 +0000)]
Gigacages should start allocations from a slide
https://bugs.webkit.org/show_bug.cgi?id=193523

Reviewed by Mark Lam.

Source/bmalloc:

This patch makes it so that Gigacage Heaps slide the start of the
cage by some random amount. We still ensure that there is always
at least 4/2GB, on MacOS/iOS respectively, of VA space available
for allocation.

Also, this patch changes some macros into constants since macros
are the devil.

* bmalloc/Gigacage.cpp:
(Gigacage::bmalloc::protectGigacageBasePtrs):
(Gigacage::bmalloc::unprotectGigacageBasePtrs):
(Gigacage::bmalloc::runwaySize):
(Gigacage::ensureGigacage):
(Gigacage::shouldBeEnabled):
* bmalloc/Gigacage.h:
(Gigacage::name):
(Gigacage::gigacageSizeToMask):
(Gigacage::size):
(Gigacage::mask):
(Gigacage::basePtr):
(Gigacage::ensureGigacage):
(Gigacage::wasEnabled):
(Gigacage::isCaged):
(Gigacage::caged):
(Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
(Gigacage::disablePrimitiveGigacage):
(Gigacage::addPrimitiveDisableCallback):
(Gigacage::removePrimitiveDisableCallback):
* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
* bmalloc/Sizes.h:
(bmalloc::Sizes::maskSizeClass):
(bmalloc::Sizes::maskObjectSize):
(bmalloc::Sizes::logSizeClass):
(bmalloc::Sizes::logObjectSize):
(bmalloc::Sizes::sizeClass):
(bmalloc::Sizes::objectSize):
(bmalloc::Sizes::pageSize):

Source/JavaScriptCore:

This patch changes some macros into constants since macros are the
devil.

* llint/LowLevelInterpreter64.asm:

Source/WTF:

This patch changes some macros into constants since macros are the
devil.

* wtf/Gigacage.cpp:
* wtf/Gigacage.h:

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

6 months agoRemove some last vestiges of assisted node terminology in WebKit
wenson_hsieh@apple.com [Fri, 18 Jan 2019 19:10:04 +0000 (19:10 +0000)]
Remove some last vestiges of assisted node terminology in WebKit
https://bugs.webkit.org/show_bug.cgi?id=193572

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView _showKeyboard]):
(-[WKContentView _hideKeyboard]):

Add a FIXME about invoking `-reloadInputViews` on watchOS when the focused element is blurred.

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView updateCurrentFocusedElementInformation:]):
(-[WKContentView _startAssistingKeyboard]): Deleted.
(-[WKContentView _stopAssistingKeyboard]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):

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

6 months agoFetchResponse::url should return the empty string for tainted responses
ajuma@chromium.org [Fri, 18 Jan 2019 18:44:54 +0000 (18:44 +0000)]
FetchResponse::url should return the empty string for tainted responses
https://bugs.webkit.org/show_bug.cgi?id=193553

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js:
(fetchNoCors):

Source/WebCore:

Check whether the response is tainted in FetchResponse::url, to match
the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::url const):

LayoutTests:

* http/wpt/fetch/response-opaque-clone.html:

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

6 months agowebkitpy: Implement device type specific expected results (Follow-up fix)
jbedard@apple.com [Fri, 18 Jan 2019 18:37:11 +0000 (18:37 +0000)]
webkitpy: Implement device type specific expected results (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=192162
<rdar://problem/46345449>

Unreviewed test gardening.

* tiled-drawing/ios/iphone7: Removed.

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

6 months agoAdd a new SPI to request for cache storage quota increase
youenn@apple.com [Fri, 18 Jan 2019 18:19:40 +0000 (18:19 +0000)]
Add a new SPI to request for cache storage quota increase
https://bugs.webkit.org/show_bug.cgi?id=193323

Reviewed by Alex Christensen.

Source/WebKit:

Add a delegate on the WebSiteDataStore for WebKit to ask for quota update.
The current SPI is currently CacheStorage specific but future work should
make it so that other storage like IDB use the same mechanism.
By default, quota remains unchanged if delegate is not implemented.

* NetworkProcess/NetworkProcess.cpp:
* UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager):
(-[WKWebsiteDataStore _quotaDelegate]):
(-[WKWebsiteDataStore set_quotaDelegate:]):
* UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestCacheStorageSpace):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::quotaManager):
(WebKit::WebsiteDataStore::setQuotaManager):
* UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added.
(WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager):
(WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace):
* WebKit.xcodeproj/project.pbxproj:

Tools:

Implement WebsiteDataStore quota delegate to handle quota requests.
By default, do not update quota.
Update quota if test calls the new testRunner.allowCacheStorageQuotaIncrease method.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::allowCacheStorageQuotaIncrease):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::allowCacheStorageQuotaIncrease):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(-[CacheStorageQuotaManager init]):
(-[CacheStorageQuotaManager _requestCacheStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]):
(WTR::initializeWebViewConfiguration):
(WTR::TestController::cocoaResetStateToConsistentValues):
(WTR::TestController::allowCacheStorageQuotaIncrease):

LayoutTests:

Use new testRunner method to bump the cache quota and verify adding a
cache entry works when bumping the cache quota.

* http/wpt/cache-storage/cache-quota.any.js:
(promise_test):

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

6 months ago[ews-build] Pass owner to the triggered builds
aakash_jain@apple.com [Fri, 18 Jan 2019 18:16:16 +0000 (18:16 +0000)]
[ews-build] Pass owner to the triggered builds
https://bugs.webkit.org/show_bug.cgi?id=193574

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(BuildFactory.propertiesToPassToTriggers):

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

6 months ago[ews-app] Send patch author as a build property
aakash_jain@apple.com [Fri, 18 Jan 2019 18:14:08 +0000 (18:14 +0000)]
[ews-app] Send patch author as a build property
https://bugs.webkit.org/show_bug.cgi?id=193560

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/fetcher.py:
(BugzillaPatchFetcher.fetch):

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

6 months agowebkitpy: Implement device type specific expected results (Follow-up fix)
jbedard@apple.com [Fri, 18 Jan 2019 17:54:52 +0000 (17:54 +0000)]
webkitpy: Implement device type specific expected results (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=192162
<rdar://problem/46345449>

Unreviewed infrastructure fix.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run): Don't boot a device if no tests are available to run on it.

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

6 months agoA track source should be unmuted whenever reenabled after setDirection changes
youenn@apple.com [Fri, 18 Jan 2019 17:19:26 +0000 (17:19 +0000)]
A track source should be unmuted whenever reenabled after setDirection changes
https://bugs.webkit.org/show_bug.cgi?id=193554
<rdar://problem/47366196>

Reviewed by Eric Carlson.

Source/WebCore:

Ensure that track gets unmuted after being fired as part of track event.
Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
some enqueued samples might not be from the right active video track or there might be no active video track.

Test: webrtc/video-setDirection.html

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):

LayoutTests:

* webrtc/video-setDirection-expected.txt: Added.
* webrtc/video-setDirection.html: Added.

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

6 months agowebkitpy: Implement device type specific expected results (Follow-up fix)
jbedard@apple.com [Fri, 18 Jan 2019 16:54:23 +0000 (16:54 +0000)]
webkitpy: Implement device type specific expected results (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=192162
<rdar://problem/46345449>

Unreviewed infrastructure fix.

* Scripts/webkitpy/api_tests/manager.py:
(Manager._initialize_devices): Use DEVICE_TYPE when running API tests.

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

6 months agowebkitpy: Implement device type specific expected results (Part 2)
jbedard@apple.com [Fri, 18 Jan 2019 16:37:59 +0000 (16:37 +0000)]
webkitpy: Implement device type specific expected results (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=192162
<rdar://problem/46345449>

Rubber-stamped by Aakash Jain.

Tools:

This change uses device_type to select a different set of TestExpectation files based on the type of device running
tests. This requires multiple baseline search paths to be used in a single instantiation of run-webkit-tests. Note
that while multiple baseline search paths are used, any single test will only ever be run on a single device type.

* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
(LayoutTestFinder.find_tests): Pass device_type through.
* Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py:
(LayoutTestFinderTests.test_touched_but_skipped_test): Allow device_type to be passed in.
* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.__init__): Make _expectations an OrderedDict indexed by device_type, add current_device_type.
(Manager._collect_tests): Pass device type to test finder.
(Manager._needs_web_platform_test):
(Manager._prepare_lists): Index _expectations by device type.
(Manager._test_input_for_file):
(Manager._test_is_slow): Ditto.
(Manager._test_should_dump_jsconsolelog_in_stderr):
(Manager._test_should_dump_jsconsolelog_in_stderr): Ditto.
(Manager._get_test_inputs):
(Manager._update_worker_count):
(Manager._set_up_run): Use current_device_type instead of passing device_type in.
(Manager.run): Re-write function to gather and parse expectations from multiple baseline search paths. In the event
that a test can be run on multiple device types, the first device in the device type list which is eligible will be
the one which runs the test.
(Manager._run_test_subset):
(Manager._run_tests): Index _expectations by current_device_type.
(Manager._print_expectation_line_for_test): Ditto.
(Manager._print_expectations_for_subset): Ditto.
(Manager.print_expectations): Re-write function to gather and parse expectations from multiple baseline search paths.
Unlike run, this function will behave the same regardless of what devices are available.
(Manager._custom_device_for_test): Deleted.
* Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
(ManagerTest.test_uses_custom_device): Deleted.
(ManagerTest.test_uses_custom_device.get_manager): Deleted.
* Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
(JSONLayoutResultsGenerator.__init__): Pass expectations as a dictionary indexed by device type.
(JSONLayoutResultsGenerator._insert_failure_summaries): The number of fixable tests must take into consideration
all of the expectations.
* Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py:
(FakePort.skipped_layout_tests): Allow device_type to be passed in.
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectations.__init__): Allow device_type to be passed through.
(TestExpectations.parse_all_expectations): Pick expectations_dict by device type.
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Allow device_type to be passed in.
* Scripts/webkitpy/layout_tests/models/test_run_results.py:
(summarize_results):
* Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py:
(summarized_results): Expectations are stored in a dictionary indexed by device_type. When determining the expectation
a test ran with, one must check all expectations to find the first non-skip expectation.
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(RunTest.test_device_type_test_division):
(RunTest):
(RunTest.test_device_type_specific_listing):
* Scripts/webkitpy/port/base.py:
(Port): Add default values for DEVICE_TYPE and DEFAULT_DEVICE_TYPES.
(Port.supported_device_types): The result of this function will change based on what devices are available.
* Scripts/webkitpy/port/device_port.py:
(DevicePort._device_type_with_version): Replace DEFAULT_DEVICE_TYPE with DEVICE_TYPE.
(DevicePort.default_child_processes): DEVICE_TYPE is a general type, so the built-in comparison of the DeviceType object
can be used.
(DevicePort.supported_device_types): Generates a list of device types determined by the available devices, if there are
any, or the DEFAULT_DEVICE_TYPES of the port.
* Scripts/webkitpy/port/ios.py:
(IOSPort): Change DEFAULT_DEVICE_TYPE to DEVICE_TYPE.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort): Set the DEFAULT_DEVICE_TYPES to the devices currently used to run layout tests.
* Scripts/webkitpy/port/watch.py:
(WatchPort): Change DEFAULT_DEVICE_TYPE to DEVICE_TYPE.
* Scripts/webkitpy/port/watch_simulator.py:
(WatchSimulatorPort): Set the DEFAULT_DEVICE_TYPES to the device currently used to run layout tests.
* Scripts/webkitpy/xcode/device_type.py:
(DeviceType):
(DeviceType.__hash__): Allow DeviceType to be used as a dictionary index.

LayoutTests:

Move iPad and iPhone 7 tests to their respective platform specific directories.

* TestExpectations:
* fast/events/touch/ios/iphone7: Removed.
* fast/forms/ios/ipad: Removed.
* fast/text-autosizing/ios/ipad: Removed.
* fast/viewport/ios/ipad: Removed.
* media/controls/ipad: Removed.
* media/modern-media-controls/media-documents/ipad: Removed.
* media/modern-media-controls/pip-support/ipad: Removed.
* platform/ios-wk1/TestExpectations:
* platform/ios/TestExpectations:
* platform/ipad: Added.
* platform/ipad/fast: Added.
* platform/ipad/fast/forms: Added.
* platform/ipad/fast/forms/choose-select-option-expected.txt: Added.
* platform/ipad/fast/forms/choose-select-option.html: Added.
* platform/ipad/fast/forms/focus-input-via-button-expected.txt: Added.
* platform/ipad/fast/forms/focus-input-via-button.html: Added.
* platform/ipad/fast/forms/multiple-select-updates-renderer-expected.txt: Added.
* platform/ipad/fast/forms/multiple-select-updates-renderer.html: Added.
* platform/ipad/fast/forms/select-form-run-twice-expected.txt: Added.
* platform/ipad/fast/forms/select-form-run-twice.html: Added.
* platform/ipad/fast/forms/select-with-title-expected.txt: Added.
* platform/ipad/fast/forms/select-with-title.html: Added.
* platform/ipad/fast/forms/unfocus-inside-fixed-hittest-expected.txt: Added.
* platform/ipad/fast/forms/unfocus-inside-fixed-hittest.html: Added.
* platform/ipad/fast/text-autosizing: Added.
* platform/ipad/fast/text-autosizing/programmatic-text-size-adjust-expected.txt: Added.
* platform/ipad/fast/text-autosizing/programmatic-text-size-adjust.html: Added.
* platform/ipad/fast/text-autosizing/text-size-adjust-inline-style-expected.html: Added.
* platform/ipad/fast/text-autosizing/text-size-adjust-inline-style.html: Added.
* platform/ipad/fast/viewport: Added.
* platform/ipad/fast/viewport/empty-meta-expected.txt: Added.
* platform/ipad/fast/viewport/empty-meta.html: Added.
* platform/ipad/fast/viewport/meta-viewport-ignored-expected.txt: Added.
* platform/ipad/fast/viewport/meta-viewport-ignored.html: Added.
* platform/ipad/fast/viewport/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport-expected.txt: Added.
* platform/ipad/fast/viewport/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html: Added.
* platform/ipad/fast/viewport/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport-expected.txt: Added.
* platform/ipad/fast/viewport/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html: Added.
* platform/ipad/fast/viewport/width-is-device-width-expected.txt: Added.
* platform/ipad/fast/viewport/width-is-device-width.html: Added.
* platform/ipad/media: Added.
* platform/ipad/media/controls: Added.
* platform/ipad/media/controls/close-page-with-picture-in-picture-video-assertion-failure-expected.txt: Added.
* platform/ipad/media/controls/close-page-with-picture-in-picture-video-assertion-failure.html: Added.
* platform/ipad/media/controls/resources: Added.
* platform/ipad/media/controls/resources/picture-in-picture.html: Added.
* platform/ipad/media/modern-media-controls: Added.
* platform/ipad/media/modern-media-controls/media-documents: Added.
* platform/ipad/media/modern-media-controls/media-documents/media-document-audio-ios-sizing-expected.txt: Added.
* platform/ipad/media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html: Added.
* platform/ipad/media/modern-media-controls/media-documents/media-document-video-ios-sizing-expected.txt: Added.
* platform/ipad/media/modern-media-controls/media-documents/media-document-video-ios-sizing.html: Added.
* platform/ipad/media/modern-media-controls/pip-support: Added.
* platform/ipad/media/modern-media-controls/pip-support/pip-support-enabled-expected.txt: Added.
* platform/ipad/media/modern-media-controls/pip-support/pip-support-enabled.html: Added.
* platform/ipad/media/modern-media-controls/pip-support/pip-support-tap-expected.txt: Added.
* platform/ipad/media/modern-media-controls/pip-support/pip-support-tap.html: Added.
* platform/iphone-7: Added.
* platform/iphone-7/fast: Added.
* platform/iphone-7/fast/events: Added.
* platform/iphone-7/fast/events/touch: Added.
* platform/iphone-7/fast/events/touch/force-press-event-expected.txt: Added.
* platform/iphone-7/fast/events/touch/force-press-event.html: Added.
* platform/iphone-7/fast/events/touch/force-press-on-link-expected.txt: Added.
* platform/iphone-7/fast/events/touch/force-press-on-link.html: Added.
* platform/iphone-7/fast/events/touch/prevent-default-touchmove-prevents-scrolling-expected.txt: Added.
* platform/iphone-7/fast/events/touch/prevent-default-touchmove-prevents-scrolling.html: Added.
* platform/iphone-7/tiled-drawing: Added.
* platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt: Added.
* platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html: Added.
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:
* tiled-drawing/ios: Removed.

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

6 months ago[WPE] run-qt-wpe-minibrowser needlessly expects a --wpe argument
philn@webkit.org [Fri, 18 Jan 2019 16:12:44 +0000 (16:12 +0000)]
[WPE] run-qt-wpe-minibrowser needlessly expects a --wpe argument
https://bugs.webkit.org/show_bug.cgi?id=193575

Reviewed by Michael Catanzaro.

Allow the script to run without explicit port argument because
it's specific to the WPE port anyway.

* Scripts/run-qt-wpe-minibrowser: Manually insert --wpe in argv
and simplify the rest of the code accordingly.

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

6 months ago[GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via...
cturner@igalia.com [Fri, 18 Jan 2019 15:59:22 +0000 (15:59 +0000)]
[GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
https://bugs.webkit.org/show_bug.cgi?id=192229

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Covered by existing tests.

* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat): There is a defect in some C++11
compiles where they will copy this return value since the type
doesn't exactly match. Force a move with WTFMove.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
Deleted. No longer used by anything.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
Rename these methods to avoid "namespacing names".
(webkit_media_clear_key_decrypt_class_init):
(finalize):
(handleKeyResponse): This is a temporary fix, we need some more
reorganisation to be full driven by CDMInstance APIs for decryption.
(findAndSetKey):
(decrypt):
(webKitMediaClearKeyDecryptorFinalize): Deleted.
(webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
(webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
(webKitMediaClearKeyDecryptorDecrypt): Deleted.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
(webkit_media_common_encryption_decrypt_class_init):
(finalize):
(transformCaps):
(transformInPlace):
(isCDMInstanceAvailable):
(sinkEventHandler):
(queryHandler):
(changeState):
(setContext):
(webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
(webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
(webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
(webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
(webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
(webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
(webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
Deleted. No longer passing key information over bus messages.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

Tools:

* MiniBrowser/wpe/main.cpp:
(main): Enable encrypted-media by default.

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

6 months ago[Flatpak] Missing KeyboardInterrupt exception handler
philn@webkit.org [Fri, 18 Jan 2019 15:40:26 +0000 (15:40 +0000)]
[Flatpak] Missing KeyboardInterrupt exception handler
https://bugs.webkit.org/show_bug.cgi?id=193570

Reviewed by Michael Catanzaro.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox): Basic KeyboardInterrupt handling.

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

6 months ago[LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
zalan@apple.com [Fri, 18 Jan 2019 14:42:46 +0000 (14:42 +0000)]
[LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
https://bugs.webkit.org/show_bug.cgi?id=193564

Reviewed by Antti Koivisto.

Source/WebCore:

Float boxes prevent collapsing through.

Test: fast/block/float/float-in-descendant-formatting-context.html

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/float/float-in-descendant-formatting-context-expected.txt: Added.
* fast/block/float/float-in-descendant-formatting-context.html: Added.

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

6 months ago[LFC] Do not skip float boxes that are not part of the current formatting context...
zalan@apple.com [Fri, 18 Jan 2019 14:39:58 +0000 (14:39 +0000)]
[LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
https://bugs.webkit.org/show_bug.cgi?id=193562

Reviewed by Antti Koivisto.

Source/WebCore:

The current floating context's (float) boxes could belong to descendant formatting contexts.
We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).

<div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
While computing the height for "container", the float box needs to be taken into account even though
it is part of another (descendant) formatting context (the inline formatting context established by its parent div).

* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
(WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

6 months ago[LFC][BFC] Check for inflow children while computing height for block formatting...
zalan@apple.com [Fri, 18 Jan 2019 14:25:08 +0000 (14:25 +0000)]
[LFC][BFC] Check for inflow children while computing height for block formatting context roots.
https://bugs.webkit.org/show_bug.cgi?id=193555

Reviewed by Antti Koivisto.

Source/WebCore:

This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

6 months ago[WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
commit-queue@webkit.org [Fri, 18 Jan 2019 14:12:53 +0000 (14:12 +0000)]
[WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
https://bugs.webkit.org/show_bug.cgi?id=192590

Patch by Yacine Bandou <yacine.bandou@softathome.com> on 2019-01-18
Reviewed by Philippe Normand.

When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.

On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.

* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::uninitialize):

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

6 months ago[WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is...
commit-queue@webkit.org [Fri, 18 Jan 2019 13:46:29 +0000 (13:46 +0000)]
[WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
https://bugs.webkit.org/show_bug.cgi?id=192586

Patch by Yacine Bandou <yacine.bandou@softathome.com> on 2019-01-18
Reviewed by Philippe Normand.

When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
the AudioDestinationNode is not destroyed.

In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
the resources leak.

AudioContext::uninitialize() is not called immediately since r94608.
This modification can now be reverted without regression in WebAudio tests.

Test: webaudio/mediaelementaudiosourcenode-gc.html

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::stop):

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

6 months ago[WPE] Add Qt extension
philn@webkit.org [Fri, 18 Jan 2019 13:07:38 +0000 (13:07 +0000)]
[WPE] Add Qt extension
https://bugs.webkit.org/show_bug.cgi?id=191464

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsWPE.cmake: Add ENABLE_WPE_QT_API CMake option. Disabled by default.

Source/WebKit:

This new extension is a QML plugin embedding a WPE ViewBackend
implementation. It provides a public API very similar to Qt's
WebView module. It comes with a simple mini-browser implemented in
QML.

QtWPE is known to work with the Wayland-EGL (in GNOME and Weston
compositors) and EGLFS QPAs.

* PlatformWPE.cmake:
* UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: Added.
(WPEQmlExtensionPlugin::registerTypes):
* UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.h: Added.
* UIProcess/API/wpe/qt/WPEQtView.cpp: Added.
(WPEQtView::WPEQtView):
(WPEQtView::~WPEQtView):
(WPEQtView::geometryChanged):
(WPEQtView::configureWindow):
(WPEQtView::createOffscreen):
(WPEQtView::backendCreated):
(WPEQtView::notifyUrlChangedCallback):
(WPEQtView::notifyTitleChangedCallback):
(WPEQtView::notifyLoadProgressCallback):
(WPEQtView::notifyLoadChangedCallback):
(WPEQtView::notifyLoadFailedCallback):
(WPEQtView::updatePaintNode):
(WPEQtView::url const):
(WPEQtView::setUrl):
(WPEQtView::loadProgress const):
(WPEQtView::title const):
(WPEQtView::canGoBack const):
(WPEQtView::isLoading const):
(WPEQtView::canGoForward const):
(WPEQtView::goBack):
(WPEQtView::goForward):
(WPEQtView::reload):
(WPEQtView::stop):
(WPEQtView::loadHtml):
(WPEQtView::jsAsyncReadyCallback):
(WPEQtView::handleJsResult):
(WPEQtView::runJavaScript):
(WPEQtView::mousePressEvent):
(WPEQtView::mouseReleaseEvent):
(WPEQtView::hoverEnterEvent):
(WPEQtView::hoverLeaveEvent):
(WPEQtView::hoverMoveEvent):
(WPEQtView::wheelEvent):
(WPEQtView::keyPressEvent):
(WPEQtView::keyReleaseEvent):
(WPEQtView::touchEvent):
* UIProcess/API/wpe/qt/WPEQtView.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: Added.
(configureCallback):
(WPEQtViewBackend::WPEQtViewBackend):
(WPEQtViewBackend::~WPEQtViewBackend):
(WPEQtViewBackend::configureGlibEglDisplay):
(WPEQtViewBackend::configureEglDisplay):
(WPEQtViewBackend::initialize):
(WPEQtViewBackend::backend const):
(WPEQtViewBackend::resize):
(WPEQtViewBackend::getTexture):
(WPEQtViewBackend::initSurface):
(WPEQtViewBackend::displayImage):
(WPEQtViewBackend::modifiers const):
(WPEQtViewBackend::dispatchHoverEnterEvent):
(WPEQtViewBackend::dispatchHoverLeaveEvent):
(WPEQtViewBackend::dispatchHoverMoveEvent):
(WPEQtViewBackend::dispatchMousePressEvent):
(WPEQtViewBackend::dispatchMouseReleaseEvent):
(WPEQtViewBackend::dispatchWheelEvent):
(WPEQtViewBackend::dispatchKeyEvent):
(WPEQtViewBackend::dispatchTouchEvent):
* UIProcess/API/wpe/qt/WPEQtViewBackend.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: Added.
(WPEQtViewLoadRequest::WPEQtViewLoadRequest):
(WPEQtViewLoadRequest::~WPEQtViewLoadRequest):
(WPEQtViewLoadRequest::url const):
(WPEQtViewLoadRequest::status const):
(WPEQtViewLoadRequest::errorString const):
* UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h: Added.
* UIProcess/API/wpe/qt/WPEQtViewLoadRequestPrivate.h: Added.
(WPEQtViewLoadRequestPrivate::WPEQtViewLoadRequestPrivate):
(WPEQtViewLoadRequestPrivate::~WPEQtViewLoadRequestPrivate):
* UIProcess/API/wpe/qt/qmldir: Added.

Tools:

MiniBrowser and API tests for the WPE Qt API. To run the
MiniBrowser a new script is introduced. Example invocation:

$ run-qt-wpe-minibrowser -platform wayland https://webkit.org

Also note-worthy is the introduction of the python2-subprocess32
dependency to run the GLib API tests.

* MiniBrowser/wpe/CMakeLists.txt:
* MiniBrowser/wpe/qt/CMakeLists.txt: Added.
* MiniBrowser/wpe/qt/main.cpp: Added.
(main):
* MiniBrowser/wpe/qt/main.qml: Added.
* MiniBrowser/wpe/qt/qml.qrc: Added.
* Scripts/run-gtk-tests:
(GtkTestRunner.is_google_test):
(GtkTestRunner):
(GtkTestRunner.is_qt_test):
* Scripts/run-qt-wpe-minibrowser: Added.
* Scripts/run-wpe-tests:
(WPETestRunner):
(WPETestRunner.is_google_test):
(WPETestRunner.is_qt_test):
* TestWebKitAPI/Tests/WPEQt/TestLoad.cpp: Added.
(TestLoad::main):
* TestWebKitAPI/Tests/WPEQt/TestLoadHtml.cpp: Added.
(TestLoadHtml::main):
* TestWebKitAPI/Tests/WPEQt/TestLoadRequest.cpp: Added.
(TestLoadRequest::main):
* TestWebKitAPI/Tests/WPEQt/TestRunJavaScript.cpp: Added.
(TestRunJavaScript::main):
* TestWebKitAPI/Tests/WPEQt/WPEQtTest.cpp: Added.
(waitForSignal):
* TestWebKitAPI/Tests/WPEQt/WPEQtTest.h: Added.
(LoadSpy::LoadSpy):
(LoadSpy::~LoadSpy):
(LoadSpy::onLoadingChanged):
(LoadStartedCatcher::LoadStartedCatcher):
(LoadStartedCatcher::~LoadStartedCatcher):
(LoadStartedCatcher::onLoadingChanged):
(waitForLoadSucceeded):
(waitForLoadFailed):
* TestWebKitAPI/glib/CMakeLists.txt:
* flatpak/flatpakutils.py:
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run_in_sandbox):
* flatpak/org.webkit.CommonModules.yaml:
* flatpak/org.webkit.WPE.yaml:
* flatpak/org.webkit.WPEModules.yaml:
* flatpak/org.webkit.WPEQT.yaml: Copied from Tools/flatpak/org.webkit.WebKit.yaml.
* flatpak/org.webkit.WebKit.yaml:
* glib/api_test_runner.py:
(TestRunner._run_test_qt):
(TestRunner.is_qt_test):
(TestRunner._run_test):

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

6 months agoScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
simon.fraser@apple.com [Fri, 18 Jan 2019 08:07:02 +0000 (08:07 +0000)]
ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
https://bugs.webkit.org/show_bug.cgi?id=193559

Reviewed by Antti Koivisto.

ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
but the code that used it was removed in webkit.org/r229318 so we can remove it and
code that calls it.

* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willDestroyScrollableArea):
(WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
* rendering/RenderLayerCompositor.h:

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

6 months ago[iOS] Content offset jumps erratically when autoscrolling near scroll view content...
wenson_hsieh@apple.com [Fri, 18 Jan 2019 04:15:24 +0000 (04:15 +0000)]
[iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
https://bugs.webkit.org/show_bug.cgi?id=193494
<rdar://problem/46859627>

Reviewed by Simon Fraser and Tim Horton.

Source/WebCore:

When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
the scroll position to be the origin.

However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).

To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
position which is already visible won't cause us to scroll away the content inset area and only show the
unobscured rect.

Tests:  editing/selection/ios/autoscroll-with-top-content-inset.html
        fast/scrolling/ios/scroll-into-view-with-top-content-inset.html

* page/FrameView.cpp:
(WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):

Introduce a helper method that expands the unobscured content rect to include surrounding content insets.

* page/FrameView.h:
* page/Page.h:
(WebCore::Page::contentInsets const):
(WebCore::Page::setContentInsets):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::getRectToExpose const):

Source/WebKit:

Adds `contentInsets` to `VisibleContentRectUpdateInfo`. This keeps track of the visible content insets
surrounding the unobscured content rect. See WebCore ChangeLog for more details.

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode const):
(WebKit::VisibleContentRectUpdateInfo::decode):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::contentInsets const):
(WebKit::operator==):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _computedObscuredInset]):
(-[WKWebView _computedContentInset]):
(-[WKWebView _computedUnobscuredSafeAreaInset]):

We don't care about source compatibility with iOS 10 and below anymore, so we should change these >= iOS 11
target checks to simply `PLATFORM(IOS)`.

(-[WKWebView _updateVisibleContentRects]):

Compute the visible content insets on all sides of the unobscured content rect. These insets are scaled to
content coordinates.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(floatBoxExtent):

Add a helper to convert `UIEdgeInsets` to `WebCore::FloatBoxExtent`, and use it in a few places below.

(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

Update the Page's content insets.

Tools:

Add a new test option to add a top content inset to the test runner's WKWebView's scroll view, and automatically
scroll to reveal this top content inset area when beginning the test (i.e., scroll to (0, -topContentInset)).

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::contentOffsetX const):
(WTR::UIScriptController::contentOffsetY const):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::contentOffsetX const):
(WTR::UIScriptController::contentOffsetY const):
* TestRunnerShared/UIScriptContext/UIScriptController.h:

Also add new UIScriptController methods to ask for the content offset of the platform scroll view.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::contentOffsetX const):
(WTR::UIScriptController::contentOffsetY const):

LayoutTests:

* editing/selection/ios/autoscroll-with-top-content-inset-expected.txt: Added.
* editing/selection/ios/autoscroll-with-top-content-inset.html: Added.

Add a new test to verify that moving the selection by autoscrolling near the top content inset area does not
cause the scroll view's content offset to jump.

* fast/scrolling/ios/scroll-into-view-with-top-content-inset-expected.txt: Added.
* fast/scrolling/ios/scroll-into-view-with-top-content-inset.html: Added.

Add a new test to verify that programmatically scrolling an element that's already visible into view does not
scroll away the scroll view's content inset.

* resources/ui-helper.js:
(window.UIHelper.contentOffset):
(window.UIHelper):

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

6 months agoAudit bytecode fields and ensure that LLInt instructions for accessing them are appro...
mark.lam@apple.com [Fri, 18 Jan 2019 02:11:44 +0000 (02:11 +0000)]
Audit bytecode fields and ensure that LLInt instructions for accessing them are appropriate.
https://bugs.webkit.org/show_bug.cgi?id=193557
<rdar://problem/47369125>

Reviewed by Yusuke Suzuki.

1. Rename some bytecode fields so that it's easier to discern whether the LLInt
   is accessing them the right way:
   - distinguish between targetVirtualRegister and targetLabel.
   - name all StructureID fields as structureID (oldStructureID, newStructureID)
     instead of structure (oldStructure, newStructure).

2. Use bitwise_cast in struct Fits when sizeof(T) == size.
   This prevents potential undefined behavior issues arising from doing
   assignments with reinterpret_cast'ed pointers.

3. Make Special::Pointer an unsigned type (previously int).
   Make ResolveType an unsigned type (previously int).

4. In LowLevelInterpreter*.asm:

   - rename the op macro argument to opcodeName or opcodeStruct respectively.
     This makes it clearer which argument type the macro is working with.

   - rename the name macro argument to opcodeName.

   - fix operator types to match the field type being accessed.  The following
     may have resulted in bugs before:

     1. The following should be read with getu() instead of get() because they
        are unsigned ints:
            OpSwitchImm::m_tableIndex
            OpSwitchChar::m_tableIndex
            OpGetFromArguments::m_index
            OpPutToArguments::m_index
            OpGetRestLength::m_numParametersToSkip

        OpJneqPtr::m_specialPointer should also be read with getu() though this
        wasn't a bug because it was previously an int by default, and is only
        changed to an unsigned int in this patch.

     2.The following should be read with loadi (not loadp) because they are of
       unsigned type (not a pointer):
            OpResolveScope::Metadata::m_resolveType
            CodeBlock::m_numParameters (see prepareForTailCall)

     3. OpPutToScope::Metadata::m_operand should be read with loadp (not loadis)
        because it is a uintptr_t.

     4. The following should be read with loadi (not loadis) because they are
        unsigned ints:
            OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits
            OpPutById::Metadata::m_oldStructureID
            OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand

        These may not have manifested in bugs because the operations that follow
        the load are 32-bit instructions which ignore the high word.

5. Give class GetPutInfo a default constructor so that we can use bitwise_cast
   on it.  Also befriend LLIntOffsetsExtractor so that we can take the offset of
   m_operand in it.

* bytecode/ArithProfile.h:
* bytecode/BytecodeList.rb:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
* bytecode/Fits.h:
* bytecode/GetByIdMetadata.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::clearLLIntGetByIdCache):
* bytecode/PreciseJumpTargetsInlines.h:
(JSC::jumpTargetForInstruction):
(JSC::updateStoredJumpTargetsForInstruction):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFromLLInt):
* bytecode/SpecialPointer.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::Label::setLocation):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareUnsignedAndJump):
(JSC::JIT::emit_compareAndJumpSlow):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareUnsignedAndJump):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emitBinaryDoubleOp):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jmp):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::emit_op_profile_type):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_jmp):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emit_op_profile_type):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::setupGetByIdPrototypeCache):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
* runtime/GetPutInfo.h:

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

6 months agoUnreviewed, rolling out r240124.
tsavell@apple.com [Fri, 18 Jan 2019 00:43:25 +0000 (00:43 +0000)]
Unreviewed, rolling out r240124.

This commit broke an internal build.

Reverted changeset:

"SDK_VARIANT build destinations should be separate from non-
SDK_VARIANT builds"
https://bugs.webkit.org/show_bug.cgi?id=189553
https://trac.webkit.org/changeset/240124

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

6 months agoWeb Inspector: fix Xcode project file list after r239976
drousso@apple.com [Fri, 18 Jan 2019 00:19:07 +0000 (00:19 +0000)]
Web Inspector: fix Xcode project file list after r239976
https://bugs.webkit.org/show_bug.cgi?id=193474

Reviewed by Timothy Hatcher.

* WebCore.xcodeproj/project.pbxproj:

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

6 months agoVersioning.
kocsen_chung@apple.com [Fri, 18 Jan 2019 00:17:46 +0000 (00:17 +0000)]
Versioning.

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

6 months agoUnreviewed WinCairo fix -- hundreds of tests crash after r240031.
ross.kirsling@sony.com [Thu, 17 Jan 2019 22:54:23 +0000 (22:54 +0000)]
Unreviewed WinCairo fix -- hundreds of tests crash after r240031.

* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):

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

6 months ago[Win][HighDPI] Repaint glitches when scrolling.
pvollan@apple.com [Thu, 17 Jan 2019 21:45:07 +0000 (21:45 +0000)]
[Win][HighDPI] Repaint glitches when scrolling.
https://bugs.webkit.org/show_bug.cgi?id=173152
<rdar://problem/45269953>

Reviewed by Brent Fulgham.

Non-integral device scale factors are causing repaint glitches, because the computation of the scroll
delta in pixel coordinates from the scroll delta in logical coordinates will not always be correct.
Instead of blitting the scroll rectangle, repaint the entire region affected by scrolling.

* WebView.cpp:
(WebView::scrollBackingStore):

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

6 months agoFix string concatenation API test after r239920
achristensen@apple.com [Thu, 17 Jan 2019 21:38:34 +0000 (21:38 +0000)]
Fix string concatenation API test after r239920
https://bugs.webkit.org/show_bug.cgi?id=193551
<rdar://problem/47359304>

Reviewed by Youenn Fablet.

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:
(TestWebKitAPI::TEST):
Cocoa platforms' interpretation of UChar/unsigned short equality is not affected by ICU's recent change of UChar's type
in WebKit's build configuration like it apparently is on Linux.

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

6 months agoAdd infrastructure to enable/disable ITP Debug Mode through Preferences
wilander@apple.com [Thu, 17 Jan 2019 21:36:48 +0000 (21:36 +0000)]
Add infrastructure to enable/disable ITP Debug Mode through Preferences
https://bugs.webkit.org/show_bug.cgi?id=193510
<rdar://problem/47330969>

Reviewed by Dean Jackson.

Source/WebCore:

No new tests. These changes are purely for settings/preferences.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
(WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
    Renamed.
* page/Settings.yaml:
    Removed since this particular setting should not be persisted for privacy
    reasons.

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
    These functions are now suited for runtime switching of ITP Debug Mode.
* Shared/WebPreferences.yaml:
    Changed name from ResourceLoadStatisticsDebugMode to ItpDebugModeEnabled.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setItpDebugModeEnabled:]):
(-[WKPreferences _itpDebugModeEnabled]):
    New private preferences functions.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
    Removed support for old experimental user default. Added a new one that's
    not connected to any UI, i.e. merely for command line debugging where
    ITP Debug Mode needs to be on all the time.

LayoutTests:

* http/tests/resourceLoadStatistics/set-custom-prevalent-resource-in-debug-mode.html:
    Changed the order of function calls since testRunner.setStatisticsPrevalentResourceForDebugMode()
    now has to be called before testRunner.setStatisticsDebugMode().

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

6 months ago[ews-build] validate-patch should handle the case when bug_id is None
aakash_jain@apple.com [Thu, 17 Jan 2019 21:28:19 +0000 (21:28 +0000)]
[ews-build] validate-patch should handle the case when bug_id is None
https://bugs.webkit.org/show_bug.cgi?id=193547

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(ValidatePatch._is_bug_closed): Gracefully handle the case when bug_id is None.
(ValidatePatch.start): If bug_id is set as None in build properties, fetch it from the patch.

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

6 months ago[ews-build] Add patch author information in build
aakash_jain@apple.com [Thu, 17 Jan 2019 21:24:44 +0000 (21:24 +0000)]
[ews-build] Add patch author information in build
https://bugs.webkit.org/show_bug.cgi?id=193465

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(ValidatePatch._is_patch_obsolete):

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

6 months ago[ews-build] Pass bug_id to the triggered builds
aakash_jain@apple.com [Thu, 17 Jan 2019 21:14:57 +0000 (21:14 +0000)]
[ews-build] Pass bug_id to the triggered builds
https://bugs.webkit.org/show_bug.cgi?id=193548

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/factories.py:
(BuildFactory.propertiesToPassToTriggers):

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

6 months agoAdopt NSTextCheckingSuppressInitialCapitalizationKey
timothy_horton@apple.com [Thu, 17 Jan 2019 21:12:12 +0000 (21:12 +0000)]
Adopt NSTextCheckingSuppressInitialCapitalizationKey
https://bugs.webkit.org/show_bug.cgi?id=193545

Reviewed by Dean Jackson.

Source/WebCore/PAL:

* pal/spi/mac/NSSpellCheckerSPI.h:

Source/WebKit:

* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::TextChecker::getGuessesForWord):

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

6 months agoSDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
jer.noble@apple.com [Thu, 17 Jan 2019 20:46:05 +0000 (20:46 +0000)]
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553

Reviewed by Tim Horton.

.:

* Makefile.shared:

PerformanceTests:

* MediaTime/Configurations/Base.xcconfig:
* MediaTime/Configurations/SDKVariant.xcconfig: Added.

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WebCore.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/PAL.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebInspectorUI:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebKit:

* Configurations/Base.xcconfig:
* Configurations/BaseTarget.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WebKitLegacy.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.

Tools:

Add a check-webkit-style check that ensures all SDKVariant.xcconfig files match.

* ContentExtensionTester/Configurations/Base.xcconfig:
* ContentExtensionTester/Configurations/SDKVariant.xcconfig: Added.
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/SDKVariant.xcconfig: Added.
* ImageDiff/cg/Configurations/Base.xcconfig:
* ImageDiff/cg/Configurations/SDKVariant.xcconfig: Added.
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/SDKVariant.xcconfig: Added.
* MobileMiniBrowser/Configurations/Base.xcconfig:
* MobileMiniBrowser/Configurations/SDKVariant.xcconfig: Added.
* Scripts/webkitpy/style/checker.py:
(_all_categories):
(FileType):
(CheckerDispatcher._file_type):
(CheckerDispatcher._create_checker):
* Scripts/webkitpy/style/checkers/sdkvariant.py: Added.
(SDKVariantChecker):
(SDKVariantChecker.__init__):
(SDKVariantChecker.check):
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/SDKVariant.xcconfig: Added.
* WebEditingTester/Configurations/Base.xcconfig:
* WebEditingTester/Configurations/SDKVariant.xcconfig: Added.
* WebKitLauncher/Configurations/SDKVariant.xcconfig: Added.
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/SDKVariant.xcconfig: Added.
* lldb/lldbWebKitTester/Configurations/Base.xcconfig:
* lldb/lldbWebKitTester/Configurations/SDKVariant.xcconfig: Added.

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

6 months agoMediaPlayerPrivateAVFoundationObjC can return incorrect paused information
jer.noble@apple.com [Thu, 17 Jan 2019 20:24:09 +0000 (20:24 +0000)]
MediaPlayerPrivateAVFoundationObjC can return incorrect paused information
https://bugs.webkit.org/show_bug.cgi?id=193499

Reviewed by Eric Carlson.

MediaPlayerPrivateAVFoundation uses rate() as an indicator of whether the player
is paused or not. This is incorrect when playback is stalled waiting for more data.
For MPPAVFObjC, use the timeControlStatus as a more accurate indicator of whether
the player is playing.

Now that we have correct play state information, we can remove the handlePlaybackCommand()
path when playing remotely for a more direct approach of notifying the HTMLMediaElement
that the play state has changed.

Drive-by fix: Before throwing away the AVPlayer, clear its output context. This keeps
remote devices from keeping the AVPlayer alive.

Drive-by fix #2: The NullMediaPlayer should always return "true" for paused(), not "false",
since it can't possibly play anything.

* platform/graphics/MediaPlayer.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::paused const):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::platformPaused const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPaused const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):

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

7 months ago[Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
jiewen_tan@apple.com [Thu, 17 Jan 2019 19:34:29 +0000 (19:34 +0000)]
[Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
https://bugs.webkit.org/show_bug.cgi?id=193478
<rdar://problem/34368591>

Reviewed by Brent Fulgham.

By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
website that assumes submit buttons are focusable, and will prohibit users from completing immigration
forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.

This quirk is for ceac.state.gov specifically, and therefore no tests.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isMouseFocusable const):
(WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
* html/HTMLFormControlElement.h:

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

7 months agoFix WinCairo build after r240117
achristensen@apple.com [Thu, 17 Jan 2019 19:32:56 +0000 (19:32 +0000)]
Fix WinCairo build after r240117
https://bugs.webkit.org/show_bug.cgi?id=193529

* PlatformWin.cmake:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:

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

7 months agoAdd release logging for incoming and outgoing webrtc audio tracks
youenn@apple.com [Thu, 17 Jan 2019 19:23:45 +0000 (19:23 +0000)]
Add release logging for incoming and outgoing webrtc audio tracks
https://bugs.webkit.org/show_bug.cgi?id=185545

Reviewed by Eric Carlson.

Add logging of audio tracks. When doing a WebRTC call,
one log line is added each second for each audio track.
Validated that logging is done through manual testing.

Refactored code to use LogHelper and apply it to video sources as well.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
(WebCore::sourceFromNewReceiver): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::logChannel const):
(WebCore::RealtimeIncomingAudioSource::logger const):
* platform/mediastream/RealtimeIncomingAudioSource.h:
(WebCore::RealtimeIncomingAudioSource::setLogger):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::logChannel const):
(WebCore::RealtimeIncomingVideoSource::logger const):
* platform/mediastream/RealtimeIncomingVideoSource.h:
(WebCore::RealtimeIncomingVideoSource::setLogger):
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
(WebCore::RealtimeOutgoingAudioSource::logChannel const):
(WebCore::RealtimeOutgoingAudioSource::logger const):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::setLogger):
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
(WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
(WebCore::RealtimeOutgoingVideoSource::logChannel const):
(WebCore::RealtimeOutgoingVideoSource::logger const):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
(WebCore::RealtimeOutgoingVideoSource::setLogger):
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):

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

7 months ago(iPad) Link tapping is sluggish on many sites
dino@apple.com [Thu, 17 Jan 2019 19:15:57 +0000 (19:15 +0000)]
(iPad) Link tapping is sluggish on many sites
https://bugs.webkit.org/show_bug.cgi?id=193522
<rdar://problem/47102987>

Reviewed by Wenson Hsieh.

Source/WebKit:

Some WKWebView clients might set the initial zoom scale of the page to
something other than 1, which disables the "fast tap" behaviour.
The fix is very simple -- just check against the initial scale rather
than 1.

The most likely regression from this would be pages designed for desktop,
but provide a viewport tag saying width=device-width and initial-scale.
They might stop allowing double-tap-to-zoom.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _allowsDoubleTapGestures]): Check against initial page scale.

LayoutTests:

Add a test that checks a double tap will trigger a click
event on a page that is at initial scale.

Extra bonus: for some reason adding this test, or making this code
change, uncovered a couple of bugs in existing tests. The
viewport-zooms-from-element-to-initial-scale test was completely wrong
because it was expecting the incorrect result, which was triggered by
the zoom callback firing early at a forced scale value. The
viewport-no-width-value-allows-double-tap test was triggering a JS
error in its UI script. I modernised both of these to use UIHelper instead.

* fast/events/ios/fast-click-double-tap-sends-click-when-initial-scale-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-sends-click-when-initial-scale.html: Added.
* fast/events/ios/viewport-no-width-value-allows-double-tap.html:
* fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt:
* fast/events/ios/viewport-zooms-from-element-to-initial-scale.html:
* resources/ui-helper.js: Add doubleTapAt and zoomByDoubleTapAt helpers. Remove the
unnecessary "Done" return value from many of the callbacks. Give zoomToScale a return
value.
(window.UIHelper.tapAt.return.new.Promise):
(window.UIHelper.tapAt):
(window.UIHelper.doubleTapAt.return.new.Promise):
(window.UIHelper.doubleTapAt):
(window.UIHelper.zoomByDoubleTappingAt):
(window.UIHelper.activateAt.return.new.Promise):
(window.UIHelper.activateAt):
(window.UIHelper.toggleCapsLock):
(window.UIHelper.ensurePresentationUpdate.return.new.Promise):
(window.UIHelper.ensurePresentationUpdate):
(window.UIHelper.activateAndWaitForInputSessionAt.return.new.Promise.):
(window.UIHelper.activateFormControl.return.new.Promise.):
(window.UIHelper.replaceTextAtRange):
(window.UIHelper.zoomToScale):
(window.UIHelper.stylusTapAt.return.new.Promise):
(window.UIHelper.stylusTapAt):

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

7 months ago[Win] gperf command not found
pvollan@apple.com [Thu, 17 Jan 2019 19:13:50 +0000 (19:13 +0000)]
[Win] gperf command not found
https://bugs.webkit.org/show_bug.cgi?id=193538
<rdar://problem/47250549>

Reviewed by Brent Fulgham.

CMake only searches for gperf if ENABLE_WEBCORE is on. ENABLE_WEBCORE needs to be set to ON.

* Source/cmake/OptionsAppleWin.cmake:

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

7 months agoStop using NetworkStorageSession::storageSession in WebCore
achristensen@apple.com [Thu, 17 Jan 2019 19:10:53 +0000 (19:10 +0000)]
Stop using NetworkStorageSession::storageSession in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193529

Reviewed by Tim Horton.

Source/WebCore:

Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object.
I've called this client StorageSessionProvider::storageSession.  Right now it just looks in NetworkStorageSession::storageSession,
but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::CookieJar::create):
(WebCore::CookieJar::CookieJar):
(WebCore::CookieJar::cookies const):
(WebCore::CookieJar::setCookies):
(WebCore::CookieJar::cookiesEnabled const):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
(WebCore::CookieJar::getRawCookies const):
(WebCore::CookieJar::deleteCookie):
* loader/CookieJar.h:
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* page/Page.h:
* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
* page/SocketProvider.h:
* platform/network/NetworkingContext.h:
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake):
(WebCore::SocketStreamHandleImpl::platformSendHandshake):
* platform/network/StorageSessionProvider.h: Added.
(WebCore::StorageSessionProvider::~StorageSessionProvider):
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::createSocketStream):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkSocketStream.cpp:
(WebKit::NetworkSocketStream::create):
(WebKit::NetworkSocketStream::NetworkSocketStream):
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/NetworkStorageSessionProvider.h: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
* WebProcess/Network/WebSocketProvider.h:
* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::WebCookieJar):
* WebProcess/WebPage/WebCookieJar.h:

Source/WebKitLegacy:

* WebCoreSupport/PageStorageSessionProvider.h: Added.
* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Misc/WebCache.mm:
(+[WebCache addImageToCache:forURL:forFrame:]):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::initWithFrame):

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

7 months agoLayout Test js/dfg-int-overflow-in-loop.html is failing
pvollan@apple.com [Thu, 17 Jan 2019 19:03:08 +0000 (19:03 +0000)]
Layout Test js/dfg-int-overflow-in-loop.html is failing
https://bugs.webkit.org/show_bug.cgi?id=193540

Unreviewed test gardening.

* platform/win/TestExpectations:

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

7 months agoGet rid of Sputnik tests.
ross.kirsling@sony.com [Thu, 17 Jan 2019 18:34:40 +0000 (18:34 +0000)]
Get rid of Sputnik tests.
https://bugs.webkit.org/show_bug.cgi?id=193464

Rubber stamped by Saam Barati.

* sputnik/: Removed.
* platform/gtk/sputnik/: Removed.
* platform/ios/sputnik/: Removed.
* platform/mac/sputnik/: Removed.
* platform/wpe/sputnik/: Removed.

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wpe/TestExpectations:
Remove all sputnik/ lines.

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

7 months agoStringObjectUse should not be a structure check for the original string object structure
sbarati@apple.com [Thu, 17 Jan 2019 17:50:27 +0000 (17:50 +0000)]
StringObjectUse should not be a structure check for the original string object structure
https://bugs.webkit.org/show_bug.cgi?id=193483
<rdar://problem/47280522>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/cant-eliminate-string-object-structure-check-when-string-object-is-proven.js: Added.
(foo):
(a.valueOf.0):

Source/JavaScriptCore:

Prior to this patch, the use kind for StringObjectUse implied that we
do a StructureCheck on the input operand for the *original* StringObject
structure. This is generally not how we use UseKinds, so it's no surprise
that this is buggy. A UseKind should map to a set of SpeculatedTypes, not an
actual set of structures. This patch changes the meaning of StringObjectUse
to mean an object where jsDynamicCast<StringObject*> would succeed.

This patch also fixes a bug that was caused by the old and weird usage of the
UseKind to mean StructureCheck. Consider a program like this:
```
S1 = Original StringObject structure
S2 = Original StringObject structure with the field "f" added

a: GetLocal()
b: CheckStructure(@a, {S2})
c: ToString(StringObject:@a)
```

According to AI, in the above program, we would exit at @c, since
StringObject:@a implies a structure check of {S1}, and the intersection
of {S1} and {S2} is {}. So, we'd convert the program to be:
```
a: GetLocal()
b: CheckStructure(@a, {S2})
c: Check(StringObject:@a)
d: Unreachable
```

However, AI would set the proof status of the StringObject:@a edge
to be proven, since the SpeculatedType for @a is SpecStringObject.
This was incorrect of AI to do because the SpeculatedType itself
didn't capture the full power of StringObjectUse. However, having
a UseKind mean CheckStructure is weird precisely because what AI was
doing is a natural fit to how we typically we think about UseKinds.

So the above program would then incorrectly be converted to this, and
we'd crash when reaching the Unreachable node:
```
a: GetLocal()
b: CheckStructure(@a, {S2})
d: Unreachable
```

This patch makes it so that StringObjectUse just means that the object that
filters through a StringObjectUse check must !!jsDynamicCast<StringObject*>.
This is now in line with all other UseKinds. It also lets us simplify a bunch
of other code that had weird checks for the StringObjectUse UseKind.

This patch also makes it so that anywhere where we used to rely on
StringObjectUse implying a structure check we actually emit an explicit
CheckStructure node.

* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ExitKind.cpp:
(JSC::exitKindToString):
* bytecode/ExitKind.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGCSEPhase.cpp:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGEdgeUsesStructure.h: Removed.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::attemptToForceStringArrayModeByToStringConversion):
(JSC::DFG::FixupPhase::addCheckStructureForOriginalStringObjectUse):
(JSC::DFG::FixupPhase::fixupToPrimitive):
(JSC::DFG::FixupPhase::fixupToStringOrCallStringConstructor):
(JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
(JSC::DFG::FixupPhase::isStringObjectUse): Deleted.
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::canOptimizeStringObjectAccess):
* dfg/DFGMayExit.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOrStringValueOf):
(JSC::DFG::SpeculativeJIT::speculateStringObject):
(JSC::DFG::SpeculativeJIT::speculateStringOrStringObject):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure): Deleted.
* dfg/DFGUseKind.h:
(JSC::DFG::alreadyChecked):
(JSC::DFG::usesStructure): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToStringOrCallStringConstructorOrStringValueOf):
(JSC::FTL::DFG::LowerDFGToB3::speculateStringObject):
(JSC::FTL::DFG::LowerDFGToB3::speculateStringOrStringObject):
(JSC::FTL::DFG::LowerDFGToB3::speculateStringObjectForCell):
(JSC::FTL::DFG::LowerDFGToB3::speculateStringObjectForStructureID): Deleted.
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/StringObject.h:
(JSC::StringObject::createStructure):
* runtime/StringPrototype.h:

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

7 months ago[JSC] Add generateHeapSnapshotForGCDebugging function to dump GCDebugging data
yusukesuzuki@slowstart.org [Thu, 17 Jan 2019 17:32:38 +0000 (17:32 +0000)]
[JSC] Add generateHeapSnapshotForGCDebugging function to dump GCDebugging data
https://bugs.webkit.org/show_bug.cgi?id=193526

Reviewed by Michael Saboff.

This patch adds generateHeapSnapshotForGCDebugging to JSC shell to dump heap snapshot JSON string with GCDebugging option.
GCDebuggingSnapshot mode is slightly different from InspectorSnapshot in terms of both the output data and the behavior.
It always takes full snapshot, and it reports internal data too. This is useful to view the live heap objects after running
the code. Also, generateHeapSnapshotForGCDebugging returns String instead of parsing it to JSObject internally by calling
JSON.parse. If we convert the String to bunch of objects by using JSON.parse, it is difficult to call generateHeapSnapshotForGCDebugging
multiple times for debugging. Currently, it only generates a large string, which is easily distinguishable in the heap inspector tool.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionGenerateHeapSnapshotForGCDebugging):

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

7 months ago[EME] Remove Amazon Prime Video from quirks list
jonlee@apple.com [Thu, 17 Jan 2019 16:36:31 +0000 (16:36 +0000)]
[EME] Remove Amazon Prime Video from quirks list
https://bugs.webkit.org/show_bug.cgi?id=193514
rdar://problem/47295330

Reviewed by Jer Noble.

* page/Quirks.cpp:
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):

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

7 months ago[LFC][BFC] An element with transform is a containing block for positioned descendants.
zalan@apple.com [Thu, 17 Jan 2019 16:24:14 +0000 (16:24 +0000)]
[LFC][BFC] An element with transform is a containing block for positioned descendants.
https://bugs.webkit.org/show_bug.cgi?id=193534

Reviewed by Antti Koivisto.

Source/WebCore:

"For elements whose layout is governed by the CSS box model, any value other than none for the transform
property also causes the element to establish a containing block for all descendants."
https://www.w3.org/TR/css-transforms-1/

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::containingBlock const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

7 months agoScrollingCoordinator: separate updating node geometry from node layers
simon.fraser@apple.com [Thu, 17 Jan 2019 16:07:24 +0000 (16:07 +0000)]
ScrollingCoordinator: separate updating node geometry from node layers
https://bugs.webkit.org/show_bug.cgi?id=193527

Reviewed by Antti Koivisto.

Updating scrolling tree node layers happens in a different code path from updating geometry;
the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.

We can also clean up the ScrollingCoordinator API and have a single function that updates
node layers (handling different node types), and separate functions for pushing viewport-constrained
and scrolling node geometry.

No observable behavior change.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setNodeLayers):
(WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
(WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
(WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
(WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
(WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:

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

7 months ago[LFC][BFC][Quirk] Take body padding and border into account when stretching height.
zalan@apple.com [Thu, 17 Jan 2019 16:06:22 +0000 (16:06 +0000)]
[LFC][BFC][Quirk] Take body padding and border into account when stretching height.
https://bugs.webkit.org/show_bug.cgi?id=193528

Reviewed by Antti Koivisto.

Source/WebCore:

* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::verticalBorder const):
(WebCore::Display::Box::horizontalBorder const):
(WebCore::Display::Box::verticalPadding const):
(WebCore::Display::Box::horizontalPadding const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

7 months agoSource/WebCore:
zalan@apple.com [Thu, 17 Jan 2019 16:00:14 +0000 (16:00 +0000)]
Source/WebCore:
[LFC][BFC] For height computation, the bottom edge of the last line box value should not include top border/padding
https://bugs.webkit.org/show_bug.cgi?id=193520

Reviewed by Antti Koivisto.

This is similar to the other "10.6.3" cases. The bottom edge of the last inline box is in the coordinate systyem
of the containing block's border box (and for content height computation it needs to be mapped to the containing block's content box instead).

* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

Tools:
[LFC][BFC] For height computation, the bottom edge of the last line box value should include top border/padding
https://bugs.webkit.org/show_bug.cgi?id=193520

Reviewed by Antti Koivisto.

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

7 months ago[ews-build] unapply-patch step should not update source
aakash_jain@apple.com [Thu, 17 Jan 2019 13:52:45 +0000 (13:52 +0000)]
[ews-build] unapply-patch step should not update source
https://bugs.webkit.org/show_bug.cgi?id=193234

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CleanWorkingDirectory): Use clean-webkit script to clean the working directory.
(UnApplyPatchIfRequired): Use CleanWorkingDirectory as base class.

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

7 months ago[JSC] ToThis omission in DFGByteCodeParser is wrong
yusukesuzuki@slowstart.org [Thu, 17 Jan 2019 08:10:53 +0000 (08:10 +0000)]
[JSC] ToThis omission in DFGByteCodeParser is wrong
https://bugs.webkit.org/show_bug.cgi?id=193513
<rdar://problem/45842236>

Reviewed by Saam Barati.

JSTests:

* stress/to-this-omission-with-different-strict-modes.js: Added.
(thisA):
(thisAStrictWrapper):

Source/JavaScriptCore:

DFGByteCodeParser omitted ToThis node when we have `ToThis(ToThis(value))`. This semantics is wrong if ToThis has different semantics
in the sloppy mode and the strict mode. If we convert `ToThisInSloppyMode(ToThisInStrictMode(boolean))` to `ToThisInStrictMode(boolean)`,
we get boolean instead of BooleanObject.

This optimization is introduced more than 7 years ago, and from that, we have several optimizations that can remove such ToThis nodes
in BytecodeParser, AI, and Fixup. Furthermore, this optimization is simply wrong since `toThis()` function of JSCell can be defined
as they want. Before ensuring all the toThis function is safe, we should not fold `ToThis(ToThis(value))` => `ToThis(value)`.
This patch just removes the problematic optimization. The performance numbers look neutral.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):

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

7 months agoStub out scrolling tree classes for overflow scrolling nodes on macOS
simon.fraser@apple.com [Thu, 17 Jan 2019 07:46:10 +0000 (07:46 +0000)]
Stub out scrolling tree classes for overflow scrolling nodes on macOS
https://bugs.webkit.org/show_bug.cgi?id=193524

Reviewed by Antti Koivisto.

Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change
ScrollingTreeMac::createScrollingTreeNode() to create these nodes.

Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask
the scrolling coordinator if it can coordinate scrolling for this layer; no behavior
change for existing code paths.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::usesAsyncScrolling const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
* rendering/RenderLayerCompositor.h:

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

7 months agoAdd UI in analysis task page to show commit testability information.
dewei_zhu@apple.com [Thu, 17 Jan 2019 05:56:18 +0000 (05:56 +0000)]
Add UI in analysis task page to show commit testability information.
https://bugs.webkit.org/show_bug.cgi?id=192972

Reviewed by Ryosuke Niwa.

Add UI in custom analysis task configuration and customizable test group form to show testability information.
Fix a bug in 'CustomAnalysisTaskConfigurator._updateCommitSetMap' that 'currentComparison' is incorrectly set.
SQL to update existing database:
    ALTER TABLE commits ADD COLUMN IF NOT EXISTS commit_testability varchar(128) DEFAULT NULL;

* browser-tests/custom-analysis-task-configurator-tests.js: Added a unit test for the bug in
'CustomAnalysisTaskConfigurator._updateCommitSetMap'.
Added a unit test to make sure 'CustomAnalysisTaskConfigurator' still works when commit fetching never returns.
* browser-tests/index.html: Imported ''custom-analysis-task-configurator-tests.js'.
* init-database.sql: Increase 'commit_testability' field length from 64 characters to 128.
* public/v3/components/custom-analysis-task-configurator.js: Added UI to show testability information.
(CustomAnalysisTaskConfigurator):
(CustomAnalysisTaskConfigurator.prototype._didUpdateSelectedPlatforms): Should reset related field for corresponding
repositories that user does not specify revision.
(CustomAnalysisTaskConfigurator.prototype._updateMapFromSpecifiedRevisionsForConfiguration): A helper function
to update '_specifiedCommits' and '_invalidRevisionsByConfiguration' per '_specifiedRevisions'.
(CustomAnalysisTaskConfigurator.prototype.render):
(CustomAnalysisTaskConfigurator.prototype._updateCommitSetMap): Fixed a bug that 'currentComparison' is incorrectly set.
(CustomAnalysisTaskConfigurator.prototype._computeCommitSet):
(CustomAnalysisTaskConfigurator.prototype.async._fetchCommitsForConfiguration):
(CustomAnalysisTaskConfigurator.prototype.async._resolveRevision):
(CustomAnalysisTaskConfigurator.prototype._buildRevisionTable):
(CustomAnalysisTaskConfigurator.prototype._buildTestabilityList):
(CustomAnalysisTaskConfigurator.prototype._selectRepositoryGroup):
(CustomAnalysisTaskConfigurator.prototype._buildRevisionInput):
(CustomAnalysisTaskConfigurator.cssTemplate):
* public/v3/components/customizable-test-group-form.js: Added UI to show testability information.
(CustomizableTestGroupForm.prototype._renderCustomRevisionTable):
(CustomizableTestGroupForm.prototype._constructTestabilityRows.):
(CustomizableTestGroupForm.prototype._constructTestabilityRows):
(CustomizableTestGroupForm.prototype._constructRevisionRadioButtons):
Changing either revision editor or radio button should trigger a re-render as testability
information for updated revision may change.
(CustomizableTestGroupForm.cssTemplate):
* public/v3/models/commit-set.js:
(IntermediateCommitSet.prototype.commitsWithTestability): Renamed from 'commitsWithTestabilityWarnings'.
(IntermediateCommitSet.prototype.commitsWithTestabilityWarnings): Deleted.

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

7 months agoUnreviewed GTK and WPE test gardening.
aboya@igalia.com [Thu, 17 Jan 2019 01:37:38 +0000 (01:37 +0000)]
Unreviewed GTK and WPE test gardening.
https://bugs.webkit.org/show_bug.cgi?id=193521

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/fetch/security/dangling-markup-mitigation-data-url.tentative.sub-expected.txt: Added.
* platform/gtk/inspector/canvas/recording-bitmaprenderer-expected.txt:
* platform/wpe/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/fetch/security/dangling-markup-mitigation-data-url.tentative.sub-expected.txt: Added.

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

7 months ago[WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
justin_fan@apple.com [Thu, 17 Jan 2019 01:35:01 +0000 (01:35 +0000)]
[WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
https://bugs.webkit.org/show_bug.cgi?id=193473

Reviewed by Dean Jackson and Myles Maxfield.

Source/WebCore:

Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct.
As of now I cannot determine an analog for WebGPU's shaderLocation in Metal.

Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.

* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex.

LayoutTests:

Refactor the vertex shader to use the vertex stage input, rather than buffer resources.

* webgpu/vertex-buffer-triangle-strip.html:

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

7 months agoAdd a new SPI for controlling getUserMedia
youenn@apple.com [Thu, 17 Jan 2019 01:18:05 +0000 (01:18 +0000)]
Add a new SPI for controlling getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=192793

Reviewed by Eric Carlson.

Source/WebKit:

Some weaknesses of the current getUserMedia/enumerateDevices SPI were found.
In particular:
- The hash salt should be handled by WebKit not by apps using WebKit.
- No need to expose the frame URL, only the top level origin is needed.
- The names of the callback are changed to improve the intent of these callbacks.
Addressed these by creating a new SPI which will replace the current one.
The current SPI will be removed later on.

Did some refactoring by making the callbacks not return false.
Instead, implement the default behavior inside the request objects as deny methods.
Some further refactoring will be done as a follow-up to better align the C API with the Cocoa API.

* UIProcess/API/APIUIClient.h:
(API::UIClient::decidePolicyForUserMediaPermissionRequest):
(API::UIClient::checkUserMediaPermissionForOrigin):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mediaCaptureState]):
(-[WKWebView _setMediaCaptureMuted:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/glib/WebKitUIClient.cpp:
* UIProcess/Cocoa/MediaCaptureUtilities.h: Added.
* UIProcess/Cocoa/MediaCaptureUtilities.mm: Added.
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::requestUserMediaAuthorizationForFrame):
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
(WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange):
* UIProcess/UserMediaPermissionCheckProxy.h:
(WebKit::UserMediaPermissionCheckProxy::deny):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
* UIProcess/UserMediaPermissionRequestProxy.h:

Tools:

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController _webView:requestUserMediaAuthorizationForFrame:devices:decisionHandler:]):
(-[WK2BrowserWindowController _webView:isMediaCaptureAuthorizedForFrame:decisionHandler:]):
* TestWebKitAPI/Tests/WebKit/GetUserMediaNavigation.mm:
(-[NavigationWhileGetUserMediaPromptDisplayedUIDelegate _webView:requestMediaCaptureAuthorizationForFrame:devices:decisionHandler:]):
* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
(-[GetUserMediaRepromptUIDelegate _webView:requestMediaCaptureAuthorizationForFrame:devices:decisionHandler:]):
* TestWebKitAPI/Tests/WebKit/MediaStreamTrackDetached.mm:
(-[MediaStreamTrackDetachedUIDelegate _webView:requestMediaCaptureAuthorizationForFrame:devices:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/UserMediaDisabled.mm:
(-[UserMediaUIDelegate _webView:requestMediaCaptureAuthorizationForFrame:devices:decisionHandler:]):
(-[UserMediaUIDelegate _webView:isMediaCaptureAuthorizedForFrame:decisionHandler:]):
* TestWebKitAPI/Tests/WebKitCocoa/UserMediaSimulateFailedSandbox.mm:
(-[SimulateFailedSandboxUIDelegate _webView:requestMediaCaptureAuthorizationForFrame:devices:decisionHandler:]):
(-[SimulateFailedSandboxUIDelegate _webView:isMediaCaptureAuthorizedForFrame:decisionHandler:]):

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

7 months agoPipe cache quota request from Network Process to UIProcess
youenn@apple.com [Thu, 17 Jan 2019 01:16:07 +0000 (01:16 +0000)]
Pipe cache quota request from Network Process to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=193296

Reviewed by Alex Christensen.

When cache storage hits quota for a given origin, pipe the request back to NetworkProcess.
No record will be put until the quota request is answered.
The request is sent from CacheStorage::Caches to CacheStorage::Engine and to NetworkProcess.
NetworkProcess then sends it to NetworkProcessProxy.
Currently NetworkProcessProxy just answers by keeping the quota as it is.
In the future, NetworkProcessProxy should make a delegate call to let the app using WebKit
make a decision on the quota. This will allow prompting user to bump it as done for other data.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestCacheStorageSpace):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::~Engine):
(WebKit::CacheStorage::Engine::from):
(WebKit::CacheStorage::Engine::Engine):
(WebKit::CacheStorage::Engine::requestSpace):
(WebKit::CacheStorage::Engine::requestSpaceCompleted):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::put):
(WebKit::CacheStorage::Cache::retryPuttingPendingRecords):
* NetworkProcess/cache/CacheStorageEngineCache.h:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::requestSpace):
(WebKit::CacheStorage::Caches::notifyCachesOfRequestSpaceEnd):
* NetworkProcess/cache/CacheStorageEngineCaches.h:
(WebKit::CacheStorage::Caches::isRequestingSpace const):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestCacheStorageSpace):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

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

7 months ago[WHLSL] Add the function stage checker
mmaxfield@apple.com [Thu, 17 Jan 2019 01:08:27 +0000 (01:08 +0000)]
[WHLSL] Add the function stage checker
https://bugs.webkit.org/show_bug.cgi?id=193479

Reviewed by Dean Jackson and Robin Morisset.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/CheckNativeFuncStages.mjs into C++.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
(WebCore::WHLSL::AST::CallExpression::function):
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Added.
(WebCore::WHLSL::FunctionStageChecker::FunctionStageChecker):
(WebCore::WHLSL::checkFunctionStages):
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Added.
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
(WebCore::WHLSL::Intrinsics::add):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
(WebCore::WHLSL::Intrinsics::ddx const):
(WebCore::WHLSL::Intrinsics::ddy const):
(WebCore::WHLSL::Intrinsics::allMemoryBarrier const):
(WebCore::WHLSL::Intrinsics::deviceMemoryBarrier const):
(WebCore::WHLSL::Intrinsics::groupMemoryBarrier const):
(WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

7 months ago[WHLSL] Delete the 'restricted' keyword
mmaxfield@apple.com [Thu, 17 Jan 2019 00:59:15 +0000 (00:59 +0000)]
[WHLSL] Delete the 'restricted' keyword
https://bugs.webkit.org/show_bug.cgi?id=193469

Reviewed by Dean Jackson and Robin Morisset.

This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
(WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
(WebCore::WHLSL::AST::FunctionDefinition::block):
(WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
(WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
(WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
(WebCore::WHLSL::resolveFunctionOverloadImpl):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):

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

7 months ago[WHLSL] Implement the recursion checker
mmaxfield@apple.com [Thu, 17 Jan 2019 00:53:40 +0000 (00:53 +0000)]
[WHLSL] Implement the recursion checker
https://bugs.webkit.org/show_bug.cgi?id=193436

Reviewed by Saam Barati.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/RecursionChecker.mjs into C++.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
(WebCore::WHLSL::AST::CallExpression::function):
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp.
(WebCore::WHLSL::checkRecursion):
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Added.
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

7 months ago[WHLSL] Add the literal type checker
mmaxfield@apple.com [Thu, 17 Jan 2019 00:31:20 +0000 (00:31 +0000)]
[WHLSL] Add the literal type checker
https://bugs.webkit.org/show_bug.cgi?id=193430

Reviewed by Dean Jackson.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LiteralTypeChecker.mjs into C++.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
(WebCore::WHLSL::AST::FloatLiteralType::value const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
(WebCore::WHLSL::AST::IntegerLiteralType::value const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const):
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Added.
(WebCore::WHLSL::getNativeTypeDeclaration):
(WebCore::WHLSL::LiteralTypeChecker::visit):
(WebCore::WHLSL::checkLiteralTypes):
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

7 months agosendBeacon to previously-unvisited https domain always fails
achristensen@apple.com [Thu, 17 Jan 2019 00:20:11 +0000 (00:20 +0000)]
sendBeacon to previously-unvisited https domain always fails
https://bugs.webkit.org/show_bug.cgi?id=193508

Reviewed by Geoffrey Garen.

* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::didReceiveChallenge):
If a ping load is doing a TLS handshake, continue if the server has good certificates.

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

7 months ago[LFC][BFC] Inflow non-replaced used width should not be negative.
zalan@apple.com [Thu, 17 Jan 2019 00:17:58 +0000 (00:17 +0000)]
[LFC][BFC] Inflow non-replaced used width should not be negative.
https://bugs.webkit.org/show_bug.cgi?id=193495

Reviewed by Antti Koivisto.

Source/WebCore:

min-width (initial value 0) enforces non-negative used width.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

7 months ago[WHLSL] Add a handwritten parser
mmaxfield@apple.com [Thu, 17 Jan 2019 00:14:38 +0000 (00:14 +0000)]
[WHLSL] Add a handwritten parser
https://bugs.webkit.org/show_bug.cgi?id=192355

Reviewed by Dean Jackson.

The parser is a mechanical representation of WHLSL's ANTLR grammar at
https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. The parser
uses Expected<> to return an appropriate Error string when parsing fails.

This patch doesn't include the AST nodes themselves - those are in
https://bugs.webkit.org/show_bug.cgi?id=192991. I split up the patch to
aid easier reviewing.

No new tests because the parser isn't hooked up yet.

* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::Parser):
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::Parser::fail):
(WebCore::WHLSL::Parser::peek):
(WebCore::WHLSL::Parser::tryType):
(WebCore::WHLSL::Parser::tryTypes):
(WebCore::WHLSL::Parser::consumeType):
(WebCore::WHLSL::Parser::consumeTypes):
(WebCore::WHLSL::digitValue):
(WebCore::WHLSL::intLiteralToInt):
(WebCore::WHLSL::uintLiteralToUint):
(WebCore::WHLSL::floatLiteralToFloat):
(WebCore::WHLSL::Parser::consumeIntegralLiteral):
(WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
(WebCore::WHLSL::recognizeSimpleUnsignedInteger):
(WebCore::WHLSL::Parser::parseConstantExpression):
(WebCore::WHLSL::Parser::parseTypeArgument):
(WebCore::WHLSL::Parser::parseTypeArguments):
(WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
(WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
(WebCore::WHLSL::Parser::parseAddressSpaceType):
(WebCore::WHLSL::Parser::parseNonAddressSpaceType):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseTypeDefinition):
(WebCore::WHLSL::Parser::parseBuiltInSemantic):
(WebCore::WHLSL::Parser::parseResourceSemantic):
(WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
(WebCore::WHLSL::Parser::parseStageInOutSemantic):
(WebCore::WHLSL::Parser::parseSemantic):
(WebCore::WHLSL::Parser::parseQualifiers):
(WebCore::WHLSL::Parser::parseStructureElement):
(WebCore::WHLSL::Parser::parseStructureDefinition):
(WebCore::WHLSL::Parser::parseEnumerationDefinition):
(WebCore::WHLSL::Parser::parseEnumerationMember):
(WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
(WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
(WebCore::WHLSL::Parser::parseAttributeBlock):
(WebCore::WHLSL::Parser::parseParameter):
(WebCore::WHLSL::Parser::parseParameters):
(WebCore::WHLSL::Parser::parseFunctionDefinition):
(WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration):
(WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
(WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
(WebCore::WHLSL::Parser::parseFunctionDeclaration):
(WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
(WebCore::WHLSL::Parser::parseBlock):
(WebCore::WHLSL::Parser::parseBlockBody):
(WebCore::WHLSL::Parser::parseIfStatement):
(WebCore::WHLSL::Parser::parseSwitchStatement):
(WebCore::WHLSL::Parser::parseSwitchCase):
(WebCore::WHLSL::Parser::parseForLoop):
(WebCore::WHLSL::Parser::parseWhileLoop):
(WebCore::WHLSL::Parser::parseDoWhileLoop):
(WebCore::WHLSL::Parser::parseVariableDeclaration):
(WebCore::WHLSL::Parser::parseVariableDeclarations):
(WebCore::WHLSL::Parser::parseStatement):
(WebCore::WHLSL::Parser::parseEffectfulExpression):
(WebCore::WHLSL::Parser::parseEffectfulAssignment):
(WebCore::WHLSL::Parser::parseEffectfulPrefix):
(WebCore::WHLSL::Parser::parseEffectfulSuffix):
(WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
(WebCore::WHLSL::Parser::parseSuffixOperator):
(WebCore::WHLSL::Parser::parseExpression):
(WebCore::WHLSL::Parser::parseTernaryConditional):
(WebCore::WHLSL::Parser::parseAssignment):
(WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
(WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
(WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
(WebCore::WHLSL::Parser::parsePossibleShift):
(WebCore::WHLSL::Parser::parsePossibleAdd):
(WebCore::WHLSL::Parser::parsePossibleMultiply):
(WebCore::WHLSL::Parser::parsePossiblePrefix):
(WebCore::WHLSL::Parser::parsePossibleSuffix):
(WebCore::WHLSL::Parser::parseCallExpression):
(WebCore::WHLSL::Parser::parseTerm):
* Modules/webgpu/WHLSL/WHLSLParser.h:
(WebCore::WHLSL::Parser::Error::Error):
(WebCore::WHLSL::Parser::backtrackingScope):
(WebCore::WHLSL::Parser::SuffixExpression::SuffixExpression):
(WebCore::WHLSL::Parser::SuffixExpression::operator bool const):

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

7 months agoIndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not...
sihui_liu@apple.com [Wed, 16 Jan 2019 23:52:36 +0000 (23:52 +0000)]
IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
https://bugs.webkit.org/show_bug.cgi?id=193093

Reviewed by Brady Eidson.

performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
(WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):

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

7 months agoASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::Networ...
youenn@apple.com [Wed, 16 Jan 2019 23:50:26 +0000 (23:50 +0000)]
ASSERTION FAILED: m_networkLoadInformationByID.contains(identifier) in WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics
https://bugs.webkit.org/show_bug.cgi?id=189097
<rdar://problem/43856423>

Reviewed by Alex Christensen.

In case where the inspector is launched, it will instruct the NetworkConnectionToWebProcess to start capturing network metrics.
If this happens in the middle of a load, addNetworkLoadInformationMetrics might fail since addNetworkLoadInformation will not be called.
To fix this issue, store whether to capture metrics at NetworkResourceLoader level.

To ensure that the case of switching back and forth capture of metrics, disable loader capture of metrics whenver NetworkConnectionToWebProcess is asked to.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
(WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics const):
* NetworkProcess/NetworkResourceLoader.h:

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

7 months agoRevert r239938
achristensen@apple.com [Wed, 16 Jan 2019 23:32:34 +0000 (23:32 +0000)]
Revert r239938
https://bugs.webkit.org/show_bug.cgi?id=193267
<rdar://problem/47297304>

* Configurations/WebContent-iOS.entitlements:

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

7 months agoRegression(r240046) Several API tests are crashing
cdumez@apple.com [Wed, 16 Jan 2019 23:17:02 +0000 (23:17 +0000)]
Regression(r240046) Several API tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=193509

Reviewed by Geoffrey Garen.

The crashes would happen because loadRequestShared() would take a WebProcessProxy& in parameter but
then call reattachToWebProcess() if the page is not valid, which would replace m_process and invalidate
our process reference.

To address the issue, move the reattachToWebProcess() call to loadRequest(), before calling
loadRequestShared(). Also, update *Shared() methods to take a Ref<WebProcessProxy>&& instead
of a WebProcessProxy& in parameter. Since we call client delegates, we need to make sure
our process stays alive.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didPerformClientRedirect):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
(WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
(WebKit::ProvisionalPageProxy::startURLSchemeTask):
(WebKit::ProvisionalPageProxy::backForwardGoToItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::frameDidBecomeFrameSet):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::unableToImplementPolicy):
(WebKit::WebPageProxy::willSubmitForm):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformClientRedirectShared):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
(WebKit::WebPageProxy::runOpenPanel):
(WebKit::WebPageProxy::printFrame):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
(WebKit::WebPageProxy::learnWord):
(WebKit::WebPageProxy::ignoreWord):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::editingRangeCallback):
(WebKit::WebPageProxy::rectForCharacterRangeCallback):
(WebKit::WebPageProxy::focusedFrameChanged):
(WebKit::WebPageProxy::frameSetLargestFrameChanged):
(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::startURLSchemeTaskShared):
(WebKit::WebPageProxy::stopURLSchemeTask):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
* UIProcess/WebPageProxy.h:

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

7 months agoInternal build fix.
achristensen@apple.com [Wed, 16 Jan 2019 22:52:00 +0000 (22:52 +0000)]
Internal build fix.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::layerContentsFormat):

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

7 months agoclang-tidy: Fix unnecessary copy/ref churn of for loop variables in libwebrtc
ddkilzer@apple.com [Wed, 16 Jan 2019 22:44:54 +0000 (22:44 +0000)]
clang-tidy: Fix unnecessary copy/ref churn of for loop variables in libwebrtc
<https://webkit.org/b/193498>

Reviewed by Youenn Fablet.

Fix unwanted copying/ref churn of loop variables by making them
const references.

* Source/webrtc/modules/bitrate_controller/loss_based_bandwidth_estimation.cc:
* Source/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc:
* Source/webrtc/p2p/base/mdns_message.cc:
* Source/webrtc/p2p/base/port.cc:
* Source/webrtc/p2p/base/stunrequest.cc:
* Source/webrtc/pc/jseptransportcontroller.cc:
* Source/webrtc/pc/peerconnection.cc:
* Source/webrtc/pc/rtcstatscollector.cc:
* Source/webrtc/pc/rtpreceiver.cc:
* Source/webrtc/pc/rtptransceiver.cc:
* Source/webrtc/pc/statscollector.cc:
* Source/webrtc/pc/trackmediainfomap.cc:
* Source/webrtc/rtc_base/filerotatingstream.cc:
* Source/webrtc/rtc_base/opensslsessioncache.cc:
* Source/webrtc/video/receive_statistics_proxy.cc:
* WebKit/0002-libwebrtc-fix-unnecessary-copy-of-for-loop-variables.diff: Added.

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

7 months agoWeb Inspector: Fix TreeOutline TypeError:​ this._indexesForSubtree is not a function
mattbaker@apple.com [Wed, 16 Jan 2019 22:04:35 +0000 (22:04 +0000)]
Web Inspector: Fix TreeOutline TypeError:​ this._indexesForSubtree is not a function
https://bugs.webkit.org/show_bug.cgi?id=193501
<rdar://problem/47323967>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.removeChildAtIndex):

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

7 months agoUnreviewed build fix.
timothy_horton@apple.com [Wed, 16 Jan 2019 21:06:45 +0000 (21:06 +0000)]
Unreviewed build fix.

* pal/spi/ios/UIKitSPI.h:
I don't even.

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

7 months agoServiceWorkerContainer is leaking due to a ref cycle
youenn@apple.com [Wed, 16 Jan 2019 20:51:19 +0000 (20:51 +0000)]
ServiceWorkerContainer is leaking due to a ref cycle
https://bugs.webkit.org/show_bug.cgi?id=193462
<rdar://problem/47026303>

Reviewed by Brady Eidson.

ServiceWorkerContainer keeps a reference to its ready promise.
The ready promise keeps a ref to its value which is a ServiceWorkerRegistration.
ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer.

To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped.

Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::stop):

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

7 months agoBuild fix for iOSMac Reveal
megan_gardner@apple.com [Wed, 16 Jan 2019 20:48:48 +0000 (20:48 +0000)]
Build fix for iOSMac Reveal
https://bugs.webkit.org/show_bug.cgi?id=193503

Unreviewed build fix.

* pal/spi/ios/UIKitSPI.h:

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

7 months agoMake didCommitChangesForLayer() explicitly about the platform layer changing because...
simon.fraser@apple.com [Wed, 16 Jan 2019 20:40:59 +0000 (20:40 +0000)]
Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping
https://bugs.webkit.org/show_bug.cgi?id=193290

Reviewed by Tim Horton.

RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for
the flushed layer, but it's not clear what has changed at this point.

didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the
case where the underlying platform layer for a GraphicsLayer changes because the layer swaps
between tiled and non-tiled, and structural layer changes; we need to push the new layer to
the scrolling tree because it operates on platform layers. So the only work that
didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't
need to do any geometry updating. Move towards that goal by renaming this callback to
didChangePlatformLayerForLayer() to make its function more explicit.

* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer):
(WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::didChangePlatformLayerForLayer):
(WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted.
(WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted.
(WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted.
* rendering/RenderLayerCompositor.h:

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

7 months agoRegression(PSON) View becomes blank after click a cross-site download link
cdumez@apple.com [Wed, 16 Jan 2019 20:40:02 +0000 (20:40 +0000)]
Regression(PSON) View becomes blank after click a cross-site download link
https://bugs.webkit.org/show_bug.cgi?id=193361
<rdar://problem/47099573>

Reviewed by Geoffrey Garen.

Source/WebCore:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
When restoring from PageCache, make sure we notify the client that the load was committed
*before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
logic in the UIProcess.

Source/WebKit:

The issue tracked by rdar://problem/47099573 is that a provisional load may get
canceled (or converted into a download) *after* we've decided to process-swap.
In such cases, the view should keep displaying the current site and it should
still be interactive. However, with the previous PSON model, the view (pageProxy)
would have already swapped to the new process and would end up displaying the
initially empty document.

To address the issue, this patch introduces the concept of a provisional load
in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional
process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the
provisional page until after the load was committed in the new process. This means
that the view / WebPageProxy keeps using the old process and displays the current
content until a load has committed in the provisional page. If no load commits
in the provisional process (e.g. because the load is cancelled or converted into
a download), then we merely destroy the ProvisionalPageProxy and terminate its
process, without impacting the WebPageProxy.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to
delay attaching the drawing area in case of a process-swap, no matter what
now that the previous process is kept alive until the provisional load is
committed in the new process.

* Shared/WebPolicyAction.h:
Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of
process-swap, we now tell the previous process to simply ignore the load, while
we create a ProvisionalPageProxy to do the new load in a new process.
Suspension of the previous page in the old process, happens later, when a load
is actually committed in the new process.

* Sources.txt:
Add new ProvisionalPageProxy file.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _killWebContentProcessAndResetState]):
When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current
process and the provisional one, to maintain previous behavior in our API tests.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/wpe/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/API/wpe/PageClientImpl.h:
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
(WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
(WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
(WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
* UIProcess/AcceleratedDrawingAreaProxy.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::createDrawingAreaProxy):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::~DrawingAreaProxy):
(WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::process):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
(WebKit::DrawingAreaProxyImpl::update):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* 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/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _createDrawingAreaProxy:]):
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy):
(WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
(WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
(WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/mac/WebPageProxyMac.mm:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/PageClientImpl.h:
* UIProcess/win/PageClientImpl.cpp:
(WebKit::PageClientImpl::createDrawingAreaProxy):
* UIProcess/win/PageClientImpl.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
Pass the drawing area's associated process when constructing it and store it as a member
in addition to the page. This is necessary now that a page can be associated with 2
WebProcesses at a time, each having its own drawing area.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
Pass the process.

* UIProcess/ProvisionalPageProxy.cpp: Added.
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::processDidTerminate):
(WebKit::ProvisionalPageProxy::takeDrawingArea):
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::processDidFinishLaunching):
(WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didPerformClientRedirect):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
(WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
(WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
(WebKit::ProvisionalPageProxy::startURLSchemeTask):
(WebKit::ProvisionalPageProxy::backForwardGoToItem):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
(WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
* UIProcess/ProvisionalPageProxy.h: Added.
(WebKit::ProvisionalPageProxy::page):
(WebKit::ProvisionalPageProxy::mainFrame const):
(WebKit::ProvisionalPageProxy::process):
(WebKit::ProvisionalPageProxy::processSwapRequestedByClient const):
(WebKit::ProvisionalPageProxy::navigationID const):
(WebKit::ProvisionalPageProxy::drawingArea const):
New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from
the provisional process.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
(WebKit::SuspendedPageProxy::unsuspend):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier
when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy
which tries to register itself as an IPC message receiver for the same pageID when
a process-swap occurs and we're switching to a suspended page.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::isMainFrame const):
WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame.
Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's
m_mainFrame to maintain previous behavior.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::provisionalDrawingArea const):
Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but
the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot.

(WebKit::WebPageProxy::swapToWebProcess):
swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess()
later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs
to initialize some data members such as the drawing area and the main frame as it is transferring them over from
the ProvisionalPageProxy which started the provisional load.

(WebKit::WebPageProxy::finishAttachingToWebProcess):
We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
committed in the provisional process.

(WebKit::WebPageProxy::setDrawingArea):
(WebKit::WebPageProxy::initializeWebPage):
- We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been
  committed in the provisional process.
- Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess().

(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not
Yes. This avoids hitting some assertions as this was already called during the first API call if needed.

(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
(WebKit::WebPageProxy::stopLoading):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
In case of process swap, tell the previous process to ignore the load instead of suspending it right away.
Suspension now happens later, only if we end up committing the provisional load in the new process.
Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used
to happen a bit later but it is clearer if we do this as early as possible I think.

(WebKit::WebPageProxy::commitProvisionalPage):
When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of:
- Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess().
- Suspending the current page.
- Letting the client know the load is comitted
- Destroy the ProvisionalPageProxy.
This work used to happen earlier in continueNavigationInNewProcess().

(WebKit::WebPageProxy::continueNavigationInNewProcess):
Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy,
without actually having the WebPageProxy switch to the new process yet.

(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didCreateWindow):
Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this.

(WebKit::WebPageProxy::didDestroyNavigation):
On process-swap, when telling the previous process to ignore the load and starting the new load in a new
ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore
the call since the navigation is merely taken over by the ProvisionalPageProxy.

(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
Moved some PSON logic to the ProvisionalPageProxy instead.

(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):

(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it.

(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::frameDidBecomeFrameSet):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
(WebKit::WebPageProxy::unableToImplementPolicy):
(WebKit::WebPageProxy::willSubmitForm):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformClientRedirectShared):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::runJavaScriptAlert):
(WebKit::WebPageProxy::runJavaScriptConfirm):
(WebKit::WebPageProxy::runJavaScriptPrompt):
(WebKit::WebPageProxy::unavailablePluginButtonClicked):
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
(WebKit::WebPageProxy::runOpenPanel):
(WebKit::WebPageProxy::printFrame):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
(WebKit::WebPageProxy::learnWord):
(WebKit::WebPageProxy::ignoreWord):
(WebKit::WebPageProxy::didReceiveEvent):
(WebKit::WebPageProxy::editingRangeCallback):
(WebKit::WebPageProxy::rectForCharacterRangeCallback):
(WebKit::WebPageProxy::focusedFrameChanged):
(WebKit::WebPageProxy::frameSetLargestFrameChanged):

(WebKit::WebPageProxy::provisionalProcessDidTerminate):
Cancel the provisiona load and destroy the ProvisionalPageProxy if
the provisional process crashes.

(WebKit::WebPageProxy::resetState):
Drop some code that is no longer needed.

(WebKit::WebPageProxy::creationParameters):
- Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have
more than one call site. This was just some bad factoring.
- Take the process in parameter now that we page can be associated with several processes at a time.

(WebKit::WebPageProxy::exceededDatabaseQuota):
(WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::startURLSchemeTaskShared):
(WebKit::WebPageProxy::stopURLSchemeTask):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
(WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
(WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::visitedLinkStore):
(WebKit::WebPageProxy::provisionalPageProxy const):

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::hasProvisionalPageWithID const):
(WebKit::WebProcessProxy::updateBackForwardItem):
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::canTerminateChildProcess):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::addProvisionalPageProxy):
(WebKit::WebProcessProxy::removeProvisionalPageProxy):
Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the
item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID
associated with this process yet, because it is still a ProvisionalPageProxy.

* UIProcess/WebURLSchemeHandler.cpp:
(WebKit::WebURLSchemeHandler::startTask):
* UIProcess/WebURLSchemeHandler.h:
* UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::create):
(WebKit::WebURLSchemeTask::WebURLSchemeTask):
(WebKit::WebURLSchemeTask::didPerformRedirection):
(WebKit::WebURLSchemeTask::didReceiveResponse):
(WebKit::WebURLSchemeTask::didReceiveData):
(WebKit::WebURLSchemeTask::didComplete):
(WebKit::WebURLSchemeTask::pageDestroyed):
* UIProcess/WebURLSchemeTask.h:
Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to
the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently
associated with the page in case of process swap.

* WebKit.xcodeproj/project.pbxproj:
Add ProvisionalPageProxy class.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::toPolicyAction):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldAttachDrawingAreaOnPageTransition):
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didReceivePolicyDecision):
Stop dealing with WebPolicyAction::Suspend as it no longer exists.

(WebKit::WebPage::didCompletePageTransition):

(WebKit::WebPage::setIsSuspended):
Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend.
setIsSuspended(true) IPC is sent when we actually commit the provisional page.

* WebProcess/WebPage/WebPage.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):

LayoutTests:

Skip test testing the cross-process DOMWindow API as I broke it with this patch.
The feature is far from ready and off by default anyway. I will add support back
in a follow-up.

* platform/wk2/TestExpectations:

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

7 months agoFrequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
timothy_horton@apple.com [Wed, 16 Jan 2019 20:35:09 +0000 (20:35 +0000)]
Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>

Reviewed by Zalan Bujtas.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
Adjust the null-check a bit; Zalan pointed out that the layout could
be responsible for the Frame/RenderView going away, so we should bail
*after* layout, not before.

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

7 months agoWeb Inspector: extend overlay element bounds lines to the right/below as well
drousso@apple.com [Wed, 16 Jan 2019 19:56:34 +0000 (19:56 +0000)]
Web Inspector: extend overlay element bounds lines to the right/below as well
https://bugs.webkit.org/show_bug.cgi?id=193336

Reviewed by Matt Baker.

This patch is purely a visual change for WebInspector, and doesn't affect anything else.

* inspector/InspectorOverlayPage.js:
(_drawBounds):

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

7 months agobmalloc should use JSC VM tag for gigacage
keith_miller@apple.com [Wed, 16 Jan 2019 19:08:21 +0000 (19:08 +0000)]
bmalloc should use JSC VM tag for gigacage
https://bugs.webkit.org/show_bug.cgi?id=193496

Reviewed by Mark Lam.

Source/bmalloc:

This patch moves the VMTag info from WTF to bmalloc so that we can
tag gigacage memory with the unused JSC memory tag. The JSC memory
tag was previously used for wasm but since wasm is now allocated
out of the primitive cage it was unused.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/BVMTags.h: Copied from Source/WTF/wtf/VMTags.h.
* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):
* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate):
(bmalloc::vmZeroAndPurge):

Source/WTF:

Move most of the macros for vm tagging to bmalloc.

* wtf/VMTags.h:

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

7 months agoPrevent WorkerRunLoop::runInMode from spinning in nested cases
youenn@apple.com [Wed, 16 Jan 2019 19:07:22 +0000 (19:07 +0000)]
Prevent WorkerRunLoop::runInMode from spinning in nested cases
https://bugs.webkit.org/show_bug.cgi?id=193359
<rdar://problem/46345353>

Reviewed by Joseph Pecoraro.

Speculative fix for some cases where service worker is spinning and consuming a lot of CPU.
The hypothesis is that:
- Service Worker is checking for its script freshness through WorkerScriptLoader.
This triggers the worker run loop to be nested.
- The run loop timer is active and needs to fire immediately.
The hypothesis is that this happens in some cases like restarting a device after sleep mode.

WorkerRunLoop::runInMode will then compute a 0 timeout value for getting a message.
This will trigger a timeout while waiting for the message queue.
Since the run loop is nested,  the run loop timer will not be able to fire,
and it will keep ask to fire immediately.
runInMode will return timeout as a result and WorkerRunLoop::run will call it immediately.

The fix is to prevent the shared timer to fire only when the run loop is being debugged through the web inspector.
We compute this by checking the run loop mode as debuggerMode().
Did some refactoring by introducing helper routines for running the loop and posting task in debugger mode.

* inspector/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
(WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
(WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController):
* workers/WorkerRunLoop.cpp:
(WebCore::ModePredicate::ModePredicate):
(WebCore::WorkerRunLoop::WorkerRunLoop):
(WebCore::debuggerMode):
(WebCore::RunLoopSetup::RunLoopSetup):
(WebCore::RunLoopSetup::~RunLoopSetup):
(WebCore::WorkerRunLoop::run):
(WebCore::WorkerRunLoop::runInDebuggerMode):
(WebCore::WorkerRunLoop::runInMode):
(WebCore::WorkerRunLoop::Task::performTask):
* workers/WorkerRunLoop.h:
(WebCore::WorkerRunLoop::isBeingDebugged const):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::startRunningDebuggerTasks):
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
(WebCore::ServiceWorkerInspectorProxy::connectToWorker):
(WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
(WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):

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

7 months agoRefactor new bytecode structs so that the fields are prefixed with "m_".
mark.lam@apple.com [Wed, 16 Jan 2019 18:44:25 +0000 (18:44 +0000)]
Refactor new bytecode structs so that the fields are prefixed with "m_".
https://bugs.webkit.org/show_bug.cgi?id=193467

Reviewed by Saam Barati and Tadeu Zagallo.

This makes it easier to do a manual audit of type correctness of the LLInt
instructions used to access these fields.  Without this change, it would be
difficult (and error prone) to distinguish the difference between field names and
macro variables.  This audit will be done after this patch lands.

* bytecode/BytecodeGeneratorification.cpp:
(JSC::BytecodeGeneratorification::BytecodeGeneratorification):
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFromLLInt):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffset):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow):
(JSC::CodeBlock::getArrayProfile):
(JSC::CodeBlock::notifyLexicalBindingShadowing):
(JSC::CodeBlock::tryGetValueProfileForBytecodeOffset):
(JSC::CodeBlock::arithProfileForPC):
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
* bytecode/CodeBlockInlines.h:
(JSC::CodeBlock::forEachValueProfile):
(JSC::CodeBlock::forEachArrayProfile):
(JSC::CodeBlock::forEachArrayAllocationProfile):
(JSC::CodeBlock::forEachObjectAllocationProfile):
(JSC::CodeBlock::forEachLLIntCallLinkInfo):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
* bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:
(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::clearLLIntGetByIdCache):
* bytecode/PreciseJumpTargetsInlines.h:
(JSC::jumpTargetForInstruction):
(JSC::extractStoredJumpTargetsForInstruction):
(JSC::updateStoredJumpTargetsForInstruction):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFromLLInt):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::dumpLineColumnEntry):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::fuseCompareAndJump):
(JSC::BytecodeGenerator::fuseTestAndJmp):
(JSC::BytecodeGenerator::emitEqualityOp):
(JSC::BytecodeGenerator::endSwitch):
(JSC::StructureForInContext::finalize):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleVarargsCall):
(JSC::DFG::ByteCodeParser::parseGetById):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::handlePutByVal):
(JSC::DFG::ByteCodeParser::handlePutAccessorById):
(JSC::DFG::ByteCodeParser::handlePutAccessorByVal):
(JSC::DFG::ByteCodeParser::handleNewFunc):
(JSC::DFG::ByteCodeParser::handleNewFuncExp):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareCatchOSREntry):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):
* generator/Argument.rb:
* generator/Metadata.rb:
* generator/Opcode.rb:
* jit/JIT.h:
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareUnsignedAndJump):
(JSC::JIT::emit_compareUnsigned):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emit_op_inc):
(JSC::JIT::emit_op_dec):
(JSC::JIT::emit_op_mod):
(JSC::JIT::emit_op_negate):
(JSC::JIT::emitBitBinaryOpFastPath):
(JSC::JIT::emit_op_bitnot):
(JSC::JIT::emitRightShiftFastPath):
(JSC::JIT::emit_op_add):
(JSC::JIT::emitMathICFast):
(JSC::JIT::emitMathICSlow):
(JSC::JIT::emit_op_div):
(JSC::JIT::emit_op_mul):
(JSC::JIT::emit_op_sub):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareUnsignedAndJump):
(JSC::JIT::emit_compareUnsigned):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_op_inc):
(JSC::JIT::emit_op_dec):
(JSC::JIT::emitBinaryDoubleOp):
(JSC::JIT::emit_op_mod):
* jit/JITCall.cpp:
(JSC::JIT::emitPutCallResult):
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileTailCall):
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::emitPutCallResult):
(JSC::JIT::emit_op_ret):
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::emitValueProfilingSiteIfProfiledOpcode):
(JSC::JIT::emitValueProfilingSite):
(JSC::JIT::copiedGetPutInfo):
(JSC::JIT::copiedArithProfile):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_mov):
(JSC::JIT::emit_op_end):
(JSC::JIT::emit_op_jmp):
(JSC::JIT::emit_op_new_object):
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emit_op_is_empty):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_is_undefined_or_null):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_ret):
(JSC::JIT::emit_op_to_primitive):
(JSC::JIT::emit_op_set_function_name):
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emit_op_throw):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
(JSC::JIT::emit_op_to_number):
(JSC::JIT::emit_op_to_string):
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_get_parent_scope):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emit_op_debug):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emit_op_get_scope):
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_new_regexp):
(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emitNewFuncExprCommon):
(JSC::JIT::emit_op_new_array):
(JSC::JIT::emit_op_new_array_with_size):
(JSC::JIT::emit_op_has_structure_property):
(JSC::JIT::emit_op_has_indexed_property):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emit_op_get_direct_pname):
(JSC::JIT::emit_op_enumerator_structure_pname):
(JSC::JIT::emit_op_enumerator_generic_pname):
(JSC::JIT::emit_op_profile_type):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
(JSC::JIT::emit_op_profile_control_flow):
(JSC::JIT::emit_op_argument_count):
(JSC::JIT::emit_op_get_rest_length):
(JSC::JIT::emit_op_get_argument):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_mov):
(JSC::JIT::emit_op_end):
(JSC::JIT::emit_op_jmp):
(JSC::JIT::emit_op_new_object):
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_is_empty):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_is_undefined_or_null):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_to_primitive):
(JSC::JIT::emit_op_set_function_name):
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_to_number):
(JSC::JIT::emit_op_to_string):
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_get_parent_scope):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emit_op_debug):
(JSC::JIT::emit_op_get_scope):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emit_op_has_structure_property):
(JSC::JIT::emit_op_has_indexed_property):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emit_op_get_direct_pname):
(JSC::JIT::emit_op_enumerator_structure_pname):
(JSC::JIT::emit_op_enumerator_generic_pname):
(JSC::JIT::emit_op_profile_type):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITOperations.cpp:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emitPutByValWithCachedId):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter_by_id):
(JSC::JIT::emit_op_put_getter_by_val):
(JSC::JIT::emit_op_put_setter_by_val):
(JSC::JIT::emit_op_del_by_id):
(JSC::JIT::emit_op_del_by_val):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emit_op_in_by_id):
(JSC::JIT::emitSlow_op_in_by_id):
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emit_op_get_from_arguments):
(JSC::JIT::emit_op_put_to_arguments):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter_by_id):
(JSC::JIT::emit_op_put_getter_by_val):
(JSC::JIT::emit_op_put_setter_by_val):
(JSC::JIT::emit_op_del_by_id):
(JSC::JIT::emit_op_del_by_val):
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emitPutByValWithCachedId):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emit_op_in_by_id):
(JSC::JIT::emitSlow_op_in_by_id):
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emit_op_get_from_arguments):
(JSC::JIT::emit_op_put_to_arguments):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::setupGetByIdPrototypeCache):
(JSC::LLInt::getByVal):
(JSC::LLInt::genericCall):
(JSC::LLInt::varargsSetup):
(JSC::LLInt::commonCallEval):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
(JSC::updateArithProfileForUnaryArithOp):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):

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

7 months agoJSFunction::canUseAllocationProfile() should account for builtin functions with no...
mark.lam@apple.com [Wed, 16 Jan 2019 18:10:44 +0000 (18:10 +0000)]
JSFunction::canUseAllocationProfile() should account for builtin functions with no own prototypes.
https://bugs.webkit.org/show_bug.cgi?id=193423
<rdar://problem/46209355>

Reviewed by Saam Barati.

JSTests:

* microbenchmarks/sinkable-new-object-with-builtin-constructor.js: Added.
* stress/constructing-builtin-functions-with-getter-prototype-should-only-call-getter-once-per-new-1.js: Added.
* stress/constructing-builtin-functions-with-getter-prototype-should-only-call-getter-once-per-new-2.js: Added.
* stress/jsfunction-cannot-use-allocation-profile-with-builtin-functions-with-no-prototype.js: Added.

Source/JavaScriptCore:

JSFunction::canUseAllocationProfile() should return false for most builtins
because the majority of them have no prototype property.  The only exception to
this is the few builtin functions that are explicitly used as constructors.

For these builtin constructors, JSFunction::canUseAllocationProfile() should also
return false if the prototype property is a getter or custom getter because
getting the prototype would then be effectful.

* dfg/DFGOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::canUseAllocationProfile):
* runtime/PropertySlot.h:

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

7 months agoIndexedDB: leak WebIDBConnectionToClient for retain cycle
sihui_liu@apple.com [Wed, 16 Jan 2019 17:11:47 +0000 (17:11 +0000)]
IndexedDB: leak WebIDBConnectionToClient for retain cycle
https://bugs.webkit.org/show_bug.cgi?id=193097
<rdar://problem/46899601>

Reviewed by David Kilzer.

Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live
forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself.

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

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

7 months ago[WTF] Compilation fails with system malloc
berto@igalia.com [Wed, 16 Jan 2019 16:32:36 +0000 (16:32 +0000)]
[WTF] Compilation fails with system malloc
https://bugs.webkit.org/show_bug.cgi?id=172445

Reviewed by Michael Catanzaro.

Follow-up to r217270. The sysinfo() system call is specific to
Linux so update the #ifdef checks accordingly.

* wtf/RAMSize.cpp:
(WTF::computeRAMSize):

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

7 months agoAdd more assertions to find root cause for release assert hit in StyleResolver
antti@apple.com [Wed, 16 Jan 2019 16:03:31 +0000 (16:03 +0000)]
Add more assertions to find root cause for release assert hit in StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=193488
<rdar://problem/30983040>

Reviewed by Zalan Bujtas.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::~StyleResolver):

Release assert we are not resolving tree style.

* dom/Document.cpp:
(WebCore::Document::setIsResolvingTreeStyle):
* dom/Document.h:
(WebCore::Document::isResolvingTreeStyle const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::Scope::~Scope):

Set isResolvingTreeStyle bit when we have a tree resolver scope.

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

7 months ago[LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non...
zalan@apple.com [Wed, 16 Jan 2019 15:23:24 +0000 (15:23 +0000)]
[LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
https://bugs.webkit.org/show_bug.cgi?id=193470

Reviewed by Antti Koivisto.

Source/WebCore:

Non-auto vertical margin values (which is mostly the case) should be set as used values.

Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/non-auto-top-bottom-height-with-margins-expected.txt: Added.
* fast/block/block-only/non-auto-top-bottom-height-with-margins.html: Added.

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