WebKit-https.git
6 months agoSeveral PasteImage API tests are flaky
wenson_hsieh@apple.com [Thu, 28 Feb 2019 20:52:49 +0000 (20:52 +0000)]
Several PasteImage API tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=195160

Reviewed by Tim Horton.

Some of these tests, such as PasteTIFFImage, don't wait for the inserted image element to finish loading before
querying the image element's size; a few other tests, such as PastePNGFile, are racy since they may begin
listening for a "load" event after image load is already complete.

To address this, make these tests first register a "load" event handler, then run script to insert an image
element into the document, and finally wait until the load event is observed before checking image size.

* TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:

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

6 months agocloop.rb shift mask should depend on the word size being shifted.
mark.lam@apple.com [Thu, 28 Feb 2019 20:48:50 +0000 (20:48 +0000)]
cloop.rb shift mask should depend on the word size being shifted.
https://bugs.webkit.org/show_bug.cgi?id=195181
<rdar://problem/48484164>

Reviewed by Yusuke Suzuki.

Previously, we're always masking the shift amount with 0x1f.  This is only correct
for 32-bit words.  For 64-bit words, the mask should be 0x3f.  For pointer sized
shifts, the mask depends on sizeof(uintptr_t).

* offlineasm/cloop.rb:

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

6 months agoUnreviewed, reduce the count in the stress/read-dead-bytecode-locals-in-must-handle...
ysuzuki@apple.com [Thu, 28 Feb 2019 20:17:53 +0000 (20:17 +0000)]
Unreviewed, reduce the count in the stress/read-dead-bytecode-locals-in-must-handle-values2.js
https://bugs.webkit.org/show_bug.cgi?id=195144

1e8 takes too much time in the Debug build. I tried 1e5 with the old Debug build and it successfully reproduced the issue.
Change the number from 1e8 to 1e5.

* stress/read-dead-bytecode-locals-in-must-handle-values2.js:
(foo):

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

6 months agoUnreviewed, rolling out r242210.
zalan@apple.com [Thu, 28 Feb 2019 19:58:11 +0000 (19:58 +0000)]
Unreviewed, rolling out r242210.
https://bugs.webkit.org/show_bug.cgi?id=195179

it broke hover menus on losaltosonline.com (Requested by zalan
on #webkit).

Reverted changeset:

"[ContentChangeObserver] Move timer removal code from
DOMWindow::clearTimeout to DOMTimer::removeById"
https://bugs.webkit.org/show_bug.cgi?id=195143
https://trac.webkit.org/changeset/242210

Patch by Commit Queue <commit-queue@webkit.org> on 2019-02-28

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

6 months ago[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTi...
zalan@apple.com [Thu, 28 Feb 2019 19:19:51 +0000 (19:19 +0000)]
[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
https://bugs.webkit.org/show_bug.cgi?id=195143
<rdar://problem/48462351>

Reviewed by Simon Fraser.

Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::removeById):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:

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

6 months agoFix Resource Timing buffer edge cases for WPT
commit-queue@webkit.org [Thu, 28 Feb 2019 19:09:32 +0000 (19:09 +0000)]
Fix Resource Timing buffer edge cases for WPT
https://bugs.webkit.org/show_bug.cgi?id=193213

Patch by Charles Vazac <cvazac@akamai.com> on 2019-02-28
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/buffer-full-add-after-full-event.html:
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt:
* web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt:
* web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt:

Source/WebCore:

Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html

* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
the secondary buffer.

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

6 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.PageZoomLevelAfterSwap
cdumez@apple.com [Thu, 28 Feb 2019 18:51:55 +0000 (18:51 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.PageZoomLevelAfterSwap
https://bugs.webkit.org/show_bug.cgi?id=195107

Reviewed by Alex Christensen.

Give some time for the zoom level to get restored.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months ago[Curl] HTTP Body is missing with redirection.
commit-queue@webkit.org [Thu, 28 Feb 2019 18:44:49 +0000 (18:44 +0000)]
[Curl] HTTP Body is missing with redirection.
https://bugs.webkit.org/show_bug.cgi?id=191651

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-02-28
Reviewed by Don Olmstead.

Source/WebCore:

Implement updateFromDelegatePreservingOldProperties for curl port.

Tests: http/tests/navigation/post-301-response.html
       http/tests/navigation/post-302-response.html
       http/tests/navigation/post-303-response.html
       http/tests/navigation/post-307-response.html
       http/tests/navigation/post-308-response.html

* platform/Curl.cmake:
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
* platform/network/curl/ResourceRequestCurl.cpp: Added.
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):

LayoutTests:

* platform/wincairo/TestExpectations:

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

6 months ago[CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
commit-queue@webkit.org [Thu, 28 Feb 2019 18:28:01 +0000 (18:28 +0000)]
[CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
https://bugs.webkit.org/show_bug.cgi?id=195159

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2019-02-28
Reviewed by Don Olmstead.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Use COORDINATED_GRAPHICS instead.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/PlatformLayer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData):
(WebCore::ImageBufferData::~ImageBufferData):
* platform/graphics/cairo/ImageBufferDataCairo.h:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
* platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
(Nicosia::GC3DLayer::swapBuffersIfNeeded):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
(WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
(WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
(WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintsIntoWindow const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):

Source/WebKit:

Use COORDINATED_GRAPHICS instead.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/SimpleViewportController.cpp:
* Shared/CoordinatedGraphics/SimpleViewportController.h:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
(WebKit::WebPage::viewportPropertiesDidChange):
* WebProcess/gtk/WebProcessMainGtk.cpp:

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

6 months agoLocale names can be nullptr
mmaxfield@apple.com [Thu, 28 Feb 2019 18:22:34 +0000 (18:22 +0000)]
Locale names can be nullptr
https://bugs.webkit.org/show_bug.cgi?id=195171
<rdar://problem/48262376>

Reviewed by Dean Jackson.

Nullptr can't be used in keys to HashMaps, so take an early out in this case.

This is a partial revert of r241288.

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):

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

6 months agoStop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
sihui_liu@apple.com [Thu, 28 Feb 2019 18:15:22 +0000 (18:15 +0000)]
Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=194958

Reviewed by Geoffrey Garen.

Source/WebKit:

ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::createLegacy):
(API::indexedDBDatabaseDirectory):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/IndexedDBUserDelete.mm:
(TEST):

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

6 months agoFix timing out tests following r241747
dbates@webkit.org [Thu, 28 Feb 2019 17:45:38 +0000 (17:45 +0000)]
Fix timing out tests following r241747
(https://bugs.webkit.org/show_bug.cgi?id=193599)

Fix up the path to ui-helper.js so that we actually load it.

* fast/forms/ios/focus-button.html:
* fast/forms/ios/focus-checkbox.html:
* fast/forms/ios/focus-checked-checkbox.html:
* fast/forms/ios/focus-checked-radio.html:
* fast/forms/ios/focus-radio.html:
* fast/forms/ios/focus-reset-button.html:
* fast/forms/ios/focus-search-field.html:
* fast/forms/ios/focus-submit-button.html:
* fast/forms/ios/focus-text-field.html:
* fast/forms/ios/focus-textarea.html:

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

6 months agoTest times out on ARM/MIPS
dinfuehr@igalia.com [Thu, 28 Feb 2019 17:34:25 +0000 (17:34 +0000)]
Test times out on ARM/MIPS
https://bugs.webkit.org/show_bug.cgi?id=195168

Unreviewed. Skip test on ARM/MIPS.

* stress/read-dead-bytecode-locals-in-must-handle-values2.js:

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

6 months ago[CoordinatedGraphics] Unify all LayerTreeHost classes
carlosgc@webkit.org [Thu, 28 Feb 2019 13:17:41 +0000 (13:17 +0000)]
[CoordinatedGraphics] Unify all LayerTreeHost classes
https://bugs.webkit.org/show_bug.cgi?id=195094

Reviewed by Žan Doberšek.

There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
ports.

* PlatformWin.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
(WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
(WebKit::LayerTreeHost::LayerTreeHost):
(WebKit::LayerTreeHost::~LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::scheduleLayerFlush):
(WebKit::LayerTreeHost::cancelPendingLayerFlush):
(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::setRootCompositingLayer):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::invalidate):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::forceRepaint):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::sizeDidChange):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportAttributes):
(WebKit::LayerTreeHost::didChangeViewport):
(WebKit::LayerTreeHost::setIsDiscardable):
(WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):
(WebKit::LayerTreeHost::didFlushRootLayer):
(WebKit::LayerTreeHost::commitSceneState):
(WebKit::LayerTreeHost::frameComplete):
(WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
(WebKit::LayerTreeHost::didDestroyGLContext):
(WebKit::LayerTreeHost::willRenderFrame):
(WebKit::LayerTreeHost::didRenderFrame):
(WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
(WebKit::LayerTreeHost::renderNextFrame):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
* WebProcess/WebPage/LayerTreeHost.cpp: Removed.
* WebProcess/WebPage/LayerTreeHost.h: Removed.
* WebPage/win/LayerTreeHost.h: Added.

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

6 months ago[ews-app] Update method to save build to handle builder_display_name
aakash_jain@apple.com [Thu, 28 Feb 2019 12:28:34 +0000 (12:28 +0000)]
[ews-app] Update method to save build to handle builder_display_name
https://bugs.webkit.org/show_bug.cgi?id=195047

Reviewed by Dewei Zhu.

* BuildSlaveSupport/ews-app/ews/models/build.py: Updated to handle builder_name and builder_display_name.
* BuildSlaveSupport/ews-app/ews/views/results.py: Ditto.

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

6 months agoWeb Inspector: Revert -webkit-border-end changes that are unreliable
commit-queue@webkit.org [Thu, 28 Feb 2019 09:02:43 +0000 (09:02 +0000)]
Web Inspector: Revert -webkit-border-end changes that are unreliable
https://bugs.webkit.org/show_bug.cgi?id=195149

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-28
Reviewed by Matt Baker.

* UserInterface/Views/CPUUsageIndicatorView.css:
(.cpu-usage-indicator-view > .details):
(body[dir=ltr] .cpu-usage-indicator-view > .details):
(body[dir=rtl] .cpu-usage-indicator-view > .details):
* UserInterface/Views/CPUUsageStackedView.css:
(.cpu-usage-stacked-view > .details):
(body[dir=ltr] .cpu-usage-stacked-view > .details):
(body[dir=rtl] .cpu-usage-stacked-view > .details):
* UserInterface/Views/CPUUsageView.css:
(.cpu-usage-view > .details):
(body[dir=ltr] .cpu-usage-view > .details):
(body[dir=rtl] .cpu-usage-view > .details):
* UserInterface/Views/MemoryCategoryView.css:
(.memory-category-view > .details):
(body[dir=ltr] .memory-category-view > .details):
(body[dir=rtl] .memory-category-view > .details):

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

6 months ago[Web GPU] Enable Web GPU only on 64-bit
justin_fan@apple.com [Thu, 28 Feb 2019 08:27:37 +0000 (08:27 +0000)]
[Web GPU] Enable Web GPU only on 64-bit
https://bugs.webkit.org/show_bug.cgi?id=195139

Because Metal is only supported on 64 bit apps.

Unreviewed build fix.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

6 months agoWeb Inspector: Cleanup some Chart code
commit-queue@webkit.org [Thu, 28 Feb 2019 08:07:16 +0000 (08:07 +0000)]
Web Inspector: Cleanup some Chart code
https://bugs.webkit.org/show_bug.cgi?id=195147

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-28
Reviewed by Matt Baker.

* UserInterface/Views/RangeChart.js:
(WI.RangeChart.prototype.layout):
(WI.RangeChart):
* UserInterface/Views/StackedColumnChart.js:
(WI.StackedColumnChart.prototype.layout):
(WI.StackedColumnChart):

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

6 months agoWeb Inspector: Add a new Scanner TimelineMarker to show up when mousing over Timeline...
joepeck@webkit.org [Thu, 28 Feb 2019 06:54:21 +0000 (06:54 +0000)]
Web Inspector: Add a new Scanner TimelineMarker to show up when mousing over TimelineView graphs
https://bugs.webkit.org/show_bug.cgi?id=195079

Reviewed by Devin Rousso.

* UserInterface/Base/Utilities.js:
(Note.prototype.enclosingNodeOrSelfWithClassInArray):
Helper for a set of classes.

* UserInterface/Models/TimelineMarker.js:
Add a new marker type, "Scanner".

* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
(WI.CPUTimelineView.prototype._handleGraphMouseMove):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView):
(WI.MemoryTimelineView.prototype._graphPositionForMouseEvent):
(WI.MemoryTimelineView.prototype._handleGraphMouseMove):
Update a scanner time when mousing over various graphs that span the entire time range.
These use the containing graph element because there was a single pixel between
adjacent graphs which would cause the scanner to flicker because the mouse event target
was not an svg element.

* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype.hidden):
(WI.TimelineOverview.prototype.updateScannerTime):
(WI.TimelineOverview.prototype.clearScanner):
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerTimeDidChange):
(WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerDidClear):
Update the overview's ruler with scanner changes.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker.scanner):
* UserInterface/Views/TimelineRuler.js:
(WI.TimelineRuler):
(WI.TimelineRuler.prototype.clearMarkers):
(WI.TimelineRuler.prototype.updateScannerTime):
(WI.TimelineRuler.prototype.clearScanner):
(WI.TimelineRuler.prototype._updateMarkers):
Have a special scanner marker that updates.

* UserInterface/Views/TimelineView.js:
New events that a TimelineView can dispatch to update the overview.

* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
Scanner marker colors.

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

6 months agoThe parser is failing to record the token location of new in new.target.
mark.lam@apple.com [Thu, 28 Feb 2019 06:44:15 +0000 (06:44 +0000)]
The parser is failing to record the token location of new in new.target.
https://bugs.webkit.org/show_bug.cgi?id=195127
<rdar://problem/39645578>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/parser-should-record-token-location-of-new-dot-target.js: Added.

Source/JavaScriptCore:

Also adjust the token location for the following to be as shown:

    new.target
    ^
    super
    ^
    import.meta
    ^

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseMemberExpression):

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

6 months ago[JSC] mustHandleValues for dead bytecode locals should be ignored in DFG phases
ysuzuki@apple.com [Thu, 28 Feb 2019 06:25:23 +0000 (06:25 +0000)]
[JSC] mustHandleValues for dead bytecode locals should be ignored in DFG phases
https://bugs.webkit.org/show_bug.cgi?id=195144
<rdar://problem/47595961>

Reviewed by Mark Lam.

JSTests:

* stress/read-dead-bytecode-locals-in-must-handle-values1.js: Added.
(bar):
(foo):
* stress/read-dead-bytecode-locals-in-must-handle-values2.js: Added.
(bar):
(foo):

Source/JavaScriptCore:

DFGMaximalFlushInsertionPhase inserts Flush for all the locals at the end of basic blocks. This enlarges the live ranges of
locals in DFG, and it sometimes makes DFG value live while it is dead in bytecode. The issue happens when we use mustHandleValues
to widen AbstractValue in CFAPhase. At that time, DFG tells "this value is live in DFG", but it may be dead in the bytecode level.
At that time, we attempt to merge AbstractValue with dead mustHandleValue, which is cleared as jsUndefined() in
DFG::Plan::cleanMustHandleValuesIfNecessary before start compilation, and crash because jsUndefined() may be irrelevant to the FlushFormat
in VariableAccessData.

This patch makes the type of mustHandleValues Operands<Optional<JSValue>>. We clear dead JSValues in DFG::Plan::cleanMustHandleValuesIfNecessary.
And we skip handling dead mustHandleValue in DFG phases.

* bytecode/Operands.h:
(JSC::Operands::isLocal const):
(JSC::Operands::isVariable const): Deleted.
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::injectOSR):
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
(JSC::DFG::compile):
* dfg/DFGDriver.h:
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::reconstruct):
* dfg/DFGJITCode.h:
* dfg/DFGOperations.cpp:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::Plan):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
(JSC::DFG::Plan::cleanMustHandleValuesIfNecessary):
* dfg/DFGPlan.h:
(JSC::DFG::Plan::mustHandleValues const):
* dfg/DFGPredictionInjectionPhase.cpp:
(JSC::DFG::PredictionInjectionPhase::run):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::disableHoistingAcrossOSREntries):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* jit/JITOperations.cpp:

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

6 months agofast/scrolling/ios/hit-testing-iframe-002.html always fails
simon.fraser@apple.com [Thu, 28 Feb 2019 05:27:43 +0000 (05:27 +0000)]
fast/scrolling/ios/hit-testing-iframe-002.html always fails
https://bugs.webkit.org/show_bug.cgi?id=195108

Reviewed by Frédéric Wang.

Errant ; in this.style.background='green;'

* fast/scrolling/ios/hit-testing-iframe-002.html:
* platform/ios-wk2/TestExpectations:

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

6 months ago[ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserve...
zalan@apple.com [Thu, 28 Feb 2019 04:39:22 +0000 (04:39 +0000)]
[ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
https://bugs.webkit.org/show_bug.cgi?id=195128
<rdar://problem/48456752>

Reviewed by Simon Fraser.

Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.

* WebCore.xcodeproj/project.pbxproj:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h: Removed.

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

6 months agoRoll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
simon.fraser@apple.com [Thu, 28 Feb 2019 04:35:25 +0000 (04:35 +0000)]
Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::nameForRegister):

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::lastModified const):
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString):
* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded):
(WebCore::MathMLElement::collectStyleForPresentationAttribute):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw):
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString):
(WebCore::gcTimerString):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const):
(WebCore::DateComponents::toString const):
* platform/LocalizedStrings.cpp:
(WebCore::localizedString):
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const):

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(timeToString):

Source/WTF:

* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Deleted.
* wtf/HexNumber.h:
(WTF::StringTypeAdapter<HexNumberBuffer>::toString const):
* wtf/text/StringConcatenate.h:
(WTF::makeString):
(WTF::pad): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::StringTypeAdapter): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::length const): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::is8Bit const): Deleted.
(WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::writeTo const): Deleted.
* wtf/text/StringConcatenateNumbers.h:
(WTF::FormattedNumber::fixedPrecision):
(WTF::FormattedNumber::fixedWidth):
(WTF::StringTypeAdapter<FormattedNumber>::toString const):
* wtf/text/StringOperators.h:
(WTF::StringAppend::StringAppend):
* wtf/text/StringView.h:
(WTF::StringView::invalidate):
* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments):
(WTF::String::format):
* wtf/text/WTFString.h:

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

6 months agoFlaky API Test: TestWebKitAPI.ServiceWorkers.ServiceWorkerAndCacheStorageSpecificDire...
youenn@apple.com [Thu, 28 Feb 2019 03:42:46 +0000 (03:42 +0000)]
Flaky API Test: TestWebKitAPI.ServiceWorkers.ServiceWorkerAndCacheStorageSpecificDirectories
https://bugs.webkit.org/show_bug.cgi?id=194959

Reviewed by Chris Dumez.

Spin loop until getting the condition to remove flakiness.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

6 months agoUnreviewed, fix -Wformat warning
mcatanzaro@igalia.com [Thu, 28 Feb 2019 02:37:55 +0000 (02:37 +0000)]
Unreviewed, fix -Wformat warning

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCompletePageTransition):

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

6 months agoUnreviewed GTK test gardening
aboya@igalia.com [Thu, 28 Feb 2019 02:22:29 +0000 (02:22 +0000)]
Unreviewed GTK test gardening
https://bugs.webkit.org/show_bug.cgi?id=195138

* platform/gtk/TestExpectations:
* platform/gtk/compositing/visibility/root-visibility-toggle-expected.txt: Added.
* platform/gtk/editing/deleting/smart-delete-001-expected.txt: Removed.
* platform/gtk/editing/deleting/smart-delete-002-expected.txt: Removed.
* platform/gtk/editing/deleting/smart-delete-003-expected.txt: Removed.
* platform/gtk/editing/deleting/smart-delete-004-expected.txt: Removed.
* platform/gtk/fast/css/apple-system-colors-expected.txt: Added.
* platform/gtk/fast/text/ja-sans-serif-expected.png: Added.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt: Added.

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

6 months ago[ews-build] Buildbot should include builder_display_name in the build events
aakash_jain@apple.com [Thu, 28 Feb 2019 01:47:03 +0000 (01:47 +0000)]
[ews-build] Buildbot should include builder_display_name in the build events
https://bugs.webkit.org/show_bug.cgi?id=195045

Reviewed by Dewei Zhu.

* BuildSlaveSupport/ews-build/events.py:
(Events.buildStarted): Included builder_display_name in event data. Also renamed
buildername to builder_name to be consistent in naming style.
(Events.buildFinished): Ditto.

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

6 months ago[ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeO...
zalan@apple.com [Thu, 28 Feb 2019 00:58:13 +0000 (00:58 +0000)]
[ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195091
<rdar://problem/48427271>

Reviewed by Tim Horton.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::isObservingContentChanges):
* platform/ios/wak/WKContentObservation.cpp:
(WKObservingContentChanges): Deleted.
(WKStartObservingContentChanges): Deleted.
(WKStopObservingContentChanges): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:

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

6 months agoREGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
bfulgham@apple.com [Thu, 28 Feb 2019 00:57:37 +0000 (00:57 +0000)]
REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
https://bugs.webkit.org/show_bug.cgi?id=195072

Reviewed by Ryosuke Niwa.

ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
was disconnected), just like we do for other message send cases.

This patch switches from using the m_networkProcessConnection member (which might be null) to use the
'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

6 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
cdumez@apple.com [Thu, 28 Feb 2019 00:54:19 +0000 (00:54 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
https://bugs.webkit.org/show_bug.cgi?id=194480

Reviewed by Brady Eidson.

Source/WebKit:

The StorageManager would only start listening for IPC on a given connection when
StorageManager::processWillOpenConnection() is called. This gets called from
WebsiteDataStore::webProcessWillOpenConnection() which gets called from
WebProcessLifetimeTracker::webPageEnteringWebProcess().

webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
after process-swapping. This means that IPC comming from the *provisional* process
would not get processed and we would only start processing IPC on the provisional
process's connection when it would get committed.

To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
now have several processes. We also make sure that webPageEnteringWebProcess() gets
called for the provisional process as soon as we create the provisional page, instead
of waiting for it to get committed.

* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::connectionWillOpen):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::connectionWillOpen):
(WebKit::WebPageProxy::webProcessWillShutDown):
(WebKit::WebPageProxy::processDidTerminate):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::webProcessLifetimeTracker):
* UIProcess/WebProcessLifetimeObserver.cpp:
(WebKit::WebProcessLifetimeObserver::addWebPage):
(WebKit::WebProcessLifetimeObserver::removeWebPage):
* UIProcess/WebProcessLifetimeObserver.h:
* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::addObserver):
(WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
(WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
(WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
(WebKit::WebProcessLifetimeTracker::processIsRunning):
* UIProcess/WebProcessLifetimeTracker.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connectionWillOpen):
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
(WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
(WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
(WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
(WebKit::StorageManager::processWillOpenConnection):
(WebKit::StorageManager::processDidCloseConnection):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
(WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
(WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::webPageWillOpenConnection):
(WebKit::WebsiteDataStore::webPageDidCloseConnection):

Tools:

Update existing API test to make it more likely to reproduce the issue.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoUniversal links from Google search results pages don't open the app.
beidson@apple.com [Thu, 28 Feb 2019 00:50:30 +0000 (00:50 +0000)]
Universal links from Google search results pages don't open the app.
<rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
  an iframe if it is from the same security origin as the main frame.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ShouldOpenExternalURLsInNewWindowActions.mm:
* TestWebKitAPI/cocoa/TestNavigationDelegate.h:
* TestWebKitAPI/cocoa/TestNavigationDelegate.mm:
(-[TestNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):

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

6 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses
cdumez@apple.com [Thu, 28 Feb 2019 00:47:42 +0000 (00:47 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.NumberOfCachedProcesses
https://bugs.webkit.org/show_bug.cgi?id=195102

Reviewed by Geoffrey Garen.

If the number of processes is not yet what we expect, wait a bit and check again to give
processes some time to exit.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoFlaky API Test: TestWebKitAPI.ProcessSwap.NavigateToDataURLThenBack
cdumez@apple.com [Thu, 28 Feb 2019 00:43:38 +0000 (00:43 +0000)]
Flaky API Test: TestWebKitAPI.ProcessSwap.NavigateToDataURLThenBack
https://bugs.webkit.org/show_bug.cgi?id=194545

Reviewed by Brady Eidson.

Make sure the test navigates forward and then back only once. Previously, navigating
back would trigger a navigation again in a timer.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months ago[ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeO...
zalan@apple.com [Thu, 28 Feb 2019 00:08:20 +0000 (00:08 +0000)]
[ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195090
<rdar://problem/48426771>

Reviewed by Tim Horton.

Also remove some unused functions from WKContentObservationInternal.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingDOMTimerScheduling): Deleted.
(WKStopObservingDOMTimerScheduling): Deleted.
(WKIsObservingDOMTimerScheduling): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:

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

6 months agoWeb Inspector: Use Element.closest for internal code
drousso@apple.com [Wed, 27 Feb 2019 23:54:42 +0000 (23:54 +0000)]
Web Inspector: Use Element.closest for internal code
https://bugs.webkit.org/show_bug.cgi?id=173747

Reviewed by Joseph Pecoraro.

Replace usage of added utility functions on the `Node` prototype with the built-in
`Element.prototype.closest` as it's more flexible and is capable of doing the same thing.

* UserInterface/Base/Utilities.js:
(Node.prototype.enclosingNodeOrSelfWithClass): Deleted.
(Node.prototype.enclosingNodeOrSelfWithNodeNameInArray): Deleted.
(Node.prototype.enclosingNodeOrSelfWithNodeName): Deleted.
* UserInterface/Base/Main.js:
(WI.handlePossibleLinkClick):
(WI._focusedContentBrowser):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.set selectedIndex):
(WI.CompletionSuggestionsView.prototype.update):
(WI.CompletionSuggestionsView.prototype._itemClicked):
* UserInterface/Views/ConsoleGroup.js:
(WI.ConsoleGroup.prototype._titleClicked):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype._mouseWasClicked):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._startEditingTarget):
(WI.DOMTreeElement.prototype._populateTagContextMenu):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._startEditing):
(WI.DataGrid.prototype._editingCancelled):
(WI.DataGrid.prototype.dataGridNodeFromNode):
(WI.DataGrid.prototype.dataGridNodeFromPoint):
(WI.DataGrid.prototype._headerCellClicked):
(WI.DataGrid.prototype._mouseoverColumnCollapser):
(WI.DataGrid.prototype._mouseoutColumnCollapser):
(WI.DataGrid.prototype._clickInColumnCollapser):
(WI.DataGrid.prototype._contextMenuInHeader):
(WI.DataGrid.prototype._contextMenuInDataTable):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.isEventWithinDisclosureTriangle):
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype._handleMouseDown):
(WI.LegacyTabBar.prototype._handleClick):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._handleContextMenuEvent):
(WI.LogContentView.prototype._mousedown):
(WI.LogContentView.prototype._targetInMessageCanBeSelected):
(WI.LogContentView.prototype._mousemove):
(WI.LogContentView.prototype._mouseup):
(WI.LogContentView.prototype._ondragstart):
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype._mouseDown):
(WI.NavigationBar.prototype._mouseMoved):
* UserInterface/Views/Popover.js:
(WI.Popover.prototype.handleEvent):
* UserInterface/Views/TabBar.js:
(WI.TabBar.prototype._handleMouseDown):
(WI.TabBar.prototype._handleClick):
* UserInterface/Views/Table.js:
(WI.Table.prototype._handleMouseDown):
(WI.Table.prototype._handleContextMenu):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.treeElementFromNode):

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

6 months ago[iOS] Web pages shouldn't be able to present a keyboard after the web view resigns...
wenson_hsieh@apple.com [Wed, 27 Feb 2019 23:54:02 +0000 (23:54 +0000)]
[iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
https://bugs.webkit.org/show_bug.cgi?id=195118
<rdar://problem/43411940>

Reviewed by Tim Horton.

Source/WebKit:

It's currently possible for websites to redirect focus into an editable element on the page by programmatically
requesting focus within the "blur" event handler. This is because our current heuristics:

(1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
    the case where the page moves focus between different elements on the page.
(2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
    the case where a focused element should show the keyboard when first responder is restored on a web view
    (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
    again).

In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.

To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
before showing the keyboard due to activity state change or focused element change.

Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView textInputTraits]):

Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
terminology used in WebKit.

(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
logic into a lambda function and using early returns. See above for more details.

(-[WKContentView _elementDidBlur]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):

LayoutTests:

Add a test to verify that after resigning first responder (e.g. tapping 'Done' on the keyboard, or focusing a
native input field elsewhere in the app), the page cannot force the keyboard to appear by focusing an input
field.

* fast/events/ios/do-not-show-keyboard-when-focusing-after-blur-expected.txt: Added.
* fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html: Added.

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

6 months ago[ContentChangeObserver] Move style recalc handling from global to ContentChangeObserv...
zalan@apple.com [Wed, 27 Feb 2019 23:29:04 +0000 (23:29 +0000)]
[ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195087

Reviewed by Simon Fraser.

Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
(WKStartObservingStyleRecalcScheduling): Deleted.
(WKStopObservingStyleRecalcScheduling): Deleted.
(WKIsObservingStyleRecalcScheduling): Deleted.
(WKSetShouldObserveNextStyleRecalc): Deleted.
(WKShouldObserveNextStyleRecalc): Deleted.
* platform/ios/wak/WKContentObservation.h:

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

6 months ago[ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver...
zalan@apple.com [Wed, 27 Feb 2019 23:20:44 +0000 (23:20 +0000)]
[ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195070
<rdar://problem/48417650>

Reviewed by Tim Horton.

Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
(WebCore::ContentChangeObserver::setObservedContentChange):
(WebCore::ContentChangeObserver::containsObservedDOMTimer):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingDOMTimerScheduling):
(WKSetObservedContentChange):
(WebThreadGetObservedDOMTimers): Deleted.
(WebThreadCountOfObservedDOMTimers): Deleted.
(WebThreadClearObservedDOMTimers): Deleted.
(WebThreadContainsObservedDOMTimer): Deleted.
(WebThreadAddObservedDOMTimer): Deleted.
(WebThreadRemoveObservedDOMTimer): Deleted.
* platform/ios/wak/WKContentObservation.h:

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

6 months agoFix build errors after Web GPU buffer updates changed some IDL fields from unsigned...
justin_fan@apple.com [Wed, 27 Feb 2019 23:09:19 +0000 (23:09 +0000)]
Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.

Unreviewed build fix.

* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::setSubData):
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUBufferBinding.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:

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

6 months agoWeb Inspector: REGRESSION(r242118): Debugger: event breakpoints have no icon
drousso@apple.com [Wed, 27 Feb 2019 22:24:43 +0000 (22:24 +0000)]
Web Inspector: REGRESSION(r242118): Debugger: event breakpoints have no icon
https://bugs.webkit.org/show_bug.cgi?id=195119

Reviewed by Matt Baker.

* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement):

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

6 months agoHigh Sierra Debug JSC test queue should use faster hardware
ryanhaddad@apple.com [Wed, 27 Feb 2019 21:37:15 +0000 (21:37 +0000)]
High Sierra Debug JSC test queue should use faster hardware
https://bugs.webkit.org/show_bug.cgi?id=194603

Rubber-stamped by Alexey Proskuryakov.

Adjust queues to free up faster hardware for use on the High Sierra Debug JSC queue.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:
* QueueStatusServer/config/queues.py:
* Scripts/webkitpy/common/config/ews.json:
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
(test_ews_name):

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

6 months agoAdopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::Netwo...
wilander@apple.com [Wed, 27 Feb 2019 21:34:26 +0000 (21:34 +0000)]
Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=195071
<rdar://problem/48417690>

Reviewed by Alex Christensen and Brent Fulgham.

Source/WebCore:

No new tests. This patch maintains functionality covered by plenty of layout
tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.

This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
and makes the necessary infrastructure changes to support that.

The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
HashSets since we never used the counts for anything. This change simplified
encoding and decoding for IPC and will eventually simplify encoding and
decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
model version 14 and below.

The patch also makes WebCore::RegistrableDomain's String constructor private.
A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
is introduced to better signal to users that creating a registrable domain
object with a string may create an object that doesn't match a registrable
domain in a valid HTTP-family URL. This change (private String constructor)
motivated a change in WebCore::AdClickAttribution where the Source and
Destination structs now take a URL as parameter instead of a String.

Finally, this patch harmonizes parameter and variable naming, going from
"origin" to "domain" and "mainFrame" to "topFrame."

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Source::deletedValue):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Destination::deletedValue):
(WebCore::AdClickAttribution::decode):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::statisticsForURL):
(WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashSet):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::appendHashSet):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
(WebCore::encodeHashCountedSet): Deleted.
(WebCore::encodeOriginHashSet): Deleted.
(WebCore::decodeOriginHashSet): Deleted.
(WebCore::appendHashCountedSet): Deleted.
* loader/ResourceLoadStatistics.h:
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::uncheckedCreateFromString):
(WebCore::RegistrableDomain::RegistrableDomain):
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForURL):
(WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
and makes the necessary infrastructure changes to support that.

The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
HashSets since we never used the counts for anything. This change simplified
the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.

The patch also makes WebCore::RegistrableDomain's String constructor private.
A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
is introduced to better signal to users that creating a registrable domain
object with a string may create an object that doesn't match a registrable
domain in a valid HTTP-family URL.

Finally, this patch harmonizes parameter and variable naming, going from
"origin" to "domain" and "mainFrame" to "topFrame."

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
(WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
(WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
(WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
(WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
(WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
(WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::sortedPrevalentResourceTelemetry):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
(WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
(WebKit::filterForRegistrableDomains):
(WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
(WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
* NetworkProcess/NetworkSession.h:
* Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
(WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
(WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
(WebKit::NetworkProcessProxy::isPrevalentResource):
(WebKit::NetworkProcessProxy::isVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResource):
(WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
(WebKit::NetworkProcessProxy::setVeryPrevalentResource):
(WebKit::NetworkProcessProxy::setLastSeen):
(WebKit::NetworkProcessProxy::clearPrevalentResource):
(WebKit::NetworkProcessProxy::logUserInteraction):
(WebKit::NetworkProcessProxy::hasHadUserInteraction):
(WebKit::NetworkProcessProxy::clearUserInteraction):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
(WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
(WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
(WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
(WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
(WebKit::NetworkProcessProxy::isGrandfathered):
(WebKit::NetworkProcessProxy::setGrandfathered):
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::hasStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccess):
(WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
* UIProcess/WebPageProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::isPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResource):
(WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
(WebKit::WebsiteDataStore::isVeryPrevalentResource):
(WebKit::WebsiteDataStore::setVeryPrevalentResource):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
(WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
(WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
(WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
(WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
(WebKit::WebsiteDataStore::clearPrevalentResource):
(WebKit::WebsiteDataStore::setLastSeen):
(WebKit::WebsiteDataStore::hasStorageAccess):
(WebKit::WebsiteDataStore::requestStorageAccess):
(WebKit::WebsiteDataStore::grantStorageAccess):
(WebKit::WebsiteDataStore::logUserInteraction):
(WebKit::WebsiteDataStore::hasHadUserInteraction):
(WebKit::WebsiteDataStore::clearUserInteraction):
(WebKit::WebsiteDataStore::setGrandfathered):
(WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
(WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
(WebKit::WebPage::requestStorageAccess):

Tools:

* TestWebKitAPI/Tests/WebCore/AdClickAttribution.cpp:
(TestWebKitAPI::createURL):
    Convenience function.
(TestWebKitAPI::TEST):
    WebCore::AdClickAttribution now takes a URL when creating Source and
    Destination.
* TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp:
(TestWebKitAPI::TEST):
    WebCore::AdClickAttribution now takes a URL when creating Source and
    Destination.

LayoutTests:

* http/tests/navigation/resources/redirect-updates-history-item-done-statistics.html:
    Changed from window.internals.resourceLoadStatisticsForOrigin() to
    window.internals.resourceLoadStatisticsForURL() and now submit a URL.

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

6 months agoFix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
krollin@apple.com [Wed, 27 Feb 2019 21:28:05 +0000 (21:28 +0000)]
Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
https://bugs.webkit.org/show_bug.cgi?id=195109
<rdar://problem/48442272>

Reviewed by Alexey Proskuryakov.

In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
Z's in hexadecimal strings). While these UUIDs haven't caused any
problems in practice over the last six years, they are indeed invalid,
and were discovered via an Xcode-project processing tool that did not
anticipate their format. Fix this by removing the files from the
project and re-adding them.

* WebKit.xcodeproj/project.pbxproj:

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

6 months agoWeb Inspector: Dark Mode: unreadable text in bezier curve editor numeric input fields
drousso@apple.com [Wed, 27 Feb 2019 21:24:53 +0000 (21:24 +0000)]
Web Inspector: Dark Mode: unreadable text in bezier curve editor numeric input fields
https://bugs.webkit.org/show_bug.cgi?id=195018
<rdar://problem/48378541>

Reviewed by Matt Baker.

Simplify some styles using `-webkit-*` properties instead of `[dir=ltr]`/`[dir=rtl]` selectors.

* UserInterface/Views/BezierEditor.css:
(.bezier-editor):
(.bezier-editor > .bezier-preview):
(.bezier-editor > .bezier-preview-timing):
(.bezier-editor > .bezier-container .linear-curve):
(.bezier-editor > .bezier-container .bezier-curve):
(.bezier-editor > .bezier-container .control-line):
(.bezier-editor > .bezier-container .control-handle):
(.bezier-editor > .number-input-container):
(.bezier-editor > .number-input-container > input):
(body[dir=ltr] .bezier-editor > .bezier-preview-timing): Deleted.
(body[dir=rtl] .bezier-editor > .bezier-preview-timing): Deleted.
(body[dir=ltr] .bezier-editor > .number-input-container > input): Deleted.
(body[dir=rtl] .bezier-editor > .number-input-container > input): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
Remove all custom styling on any <input>s, as they look fine with their default styling.

* UserInterface/Views/SpringEditor.css:
(.spring-editor > .spring-preview):
(.spring-editor > .spring-preview > div):
(.spring-editor > .spring-timing > div):

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

6 months ago[Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
justin_fan@apple.com [Wed, 27 Feb 2019 21:10:24 +0000 (21:10 +0000)]
[Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
https://bugs.webkit.org/show_bug.cgi?id=195077
<rdar://problem/47805229>

Reviewed by Dean Jackson.

Source/WebCore:

Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be
used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.

Tests: webgpu/buffer-command-buffer-races.html
       webgpu/map-read-buffers.html

* Modules/webgpu/WebGPUBindGroup.h:
(WebCore::WebGPUBindGroup::bindGroup const):
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
* Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
(WebCore::WebGPUBuffer::setSubData):
(WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
(WebCore::WebGPUBuffer::destroy):
(WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
* Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
(WebCore::GPUBuffer::isVertex const):
(WebCore::GPUBuffer::isUniform const):
(WebCore::GPUBuffer::isStorage const):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::isMappable const):
(WebCore::GPUBuffer::isMapWrite const):
(WebCore::GPUBuffer::isMapRead const):
(WebCore::GPUBuffer::isMapWriteable const):
(WebCore::GPUBuffer::isMapReadable const):
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::usedBuffers const):
(WebCore::GPUCommandBuffer::useBuffer):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
(WebCore::GPUDevice::tryCreateBuffer const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
(WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::commandBuffer const):
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
(WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
(WebCore::GPUBuffer::state const):
(WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
(WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
(WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
(WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
(WebCore::GPUBuffer::registerMappingCallback):
(WebCore::GPUBuffer::runMappingCallback):
(WebCore::GPUBuffer::unmap):
(WebCore::GPUBuffer::destroy):
(WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::tryCreate):
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
(WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
(WebCore::GPURenderPassEncoder::create): Deleted.

Buffer size updates in the IDL:
* Modules/webgpu/GPUBufferDescriptor.idl:
* Modules/webgpu/WebGPUBuffer.idl:
* Modules/webgpu/WebGPUBufferBinding.idl:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
* Modules/webgpu/WebGPUVertexInputDescriptor.idl:

LayoutTests:

Add tests for mapReadAysnc and setSubData calls. Nofity testRunner when done on some drawing tests
that may take more time.

* webgpu/buffer-command-buffer-races-expected.html: Added.
* webgpu/buffer-command-buffer-races.html: Added.
* webgpu/buffer-resource-triangles.html: Use setSubData.
* webgpu/depth-enabled-triangle-strip.html: Ditto.
* webgpu/map-read-buffers-expected.txt: Added.
* webgpu/map-read-buffers.html: Added.
* webgpu/vertex-buffer-triangle-strip.html: Use setSubData.

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

6 months agoRemove LeetCode FetchRequest quirk
youenn@apple.com [Wed, 27 Feb 2019 20:14:20 +0000 (20:14 +0000)]
Remove LeetCode FetchRequest quirk
https://bugs.webkit.org/show_bug.cgi?id=195100

Reviewed by Alex Christensen.

Covered by manual testing.

* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk):

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

6 months agoWeb Inspector: popover colors don't change when transitioning to/from dark mode
drousso@apple.com [Wed, 27 Feb 2019 20:13:14 +0000 (20:13 +0000)]
Web Inspector: popover colors don't change when transitioning to/from dark mode
https://bugs.webkit.org/show_bug.cgi?id=195113
<rdar://problem/48444188>

Reviewed by Timothy Hatcher.

* UserInterface/Views/Popover.js:
(WI.Popover.prototype.dismiss):
(WI.Popover.prototype._addListenersIfNeeded):

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

6 months agoRemove UserMediaProcessManager processState map
youenn@apple.com [Wed, 27 Feb 2019 19:53:42 +0000 (19:53 +0000)]
Remove UserMediaProcessManager processState map
https://bugs.webkit.org/show_bug.cgi?id=195056

Reviewed by Eric Carlson.

Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
To improve on this model, this patch does the following:
- Move the process state to WebProcessProxy.
- Remove the map and replace it by a set of all manager proxies.

This simplifies the handling.
On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::forEach):
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
(WebKit::UserMediaProcessManager::setCaptureEnabled):
(WebKit::UserMediaProcessManager::captureDevicesChanged):
(WebKit::ProcessState::ProcessState): Deleted.
(WebKit::ProcessState::hasVideoExtension const): Deleted.
(WebKit::ProcessState::grantVideoExtension): Deleted.
(WebKit::ProcessState::revokeVideoExtension): Deleted.
(WebKit::ProcessState::hasAudioExtension const): Deleted.
(WebKit::ProcessState::grantAudioExtension): Deleted.
(WebKit::ProcessState::revokeAudioExtension): Deleted.
(WebKit::stateMap): Deleted.
(WebKit::processState): Deleted.
(WebKit::ProcessState::addRequestManager): Deleted.
(WebKit::ProcessState::removeRequestManager): Deleted.
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
(WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
* UIProcess/UserMediaProcessManager.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
(WebKit::WebProcessProxy::hasVideoCaptureExtension const):
(WebKit::WebProcessProxy::grantVideoCaptureExtension):
(WebKit::WebProcessProxy::revokeVideoCaptureExtension):
(WebKit::WebProcessProxy::hasAudioCaptureExtension const):
(WebKit::WebProcessProxy::grantAudioCaptureExtension):
(WebKit::WebProcessProxy::revokeAudioCaptureExtension):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
(WebKit::UserMediaPermissionRequestManager::clear): Deleted.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

6 months ago[macOS] Disable permissive call logging in sandbox
pvollan@apple.com [Wed, 27 Feb 2019 19:47:53 +0000 (19:47 +0000)]
[macOS] Disable permissive call logging in sandbox
https://bugs.webkit.org/show_bug.cgi?id=194061
<rdar://problem/47686253>

Reviewed by Brent Fulgham.

Strict call filtering should be reenabled.

* WebProcess/com.apple.WebProcess.sb.in:

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

6 months ago[HTTPSUpgrade] Use open source database until the feature is ready
cdumez@apple.com [Wed, 27 Feb 2019 19:15:28 +0000 (19:15 +0000)]
[HTTPSUpgrade] Use open source database until the feature is ready
https://bugs.webkit.org/show_bug.cgi?id=195069
<rdar://problem/47838224>

Reviewed by Geoffrey Garen.

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

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

6 months agoUnable to log into chase.com on iPad when DeviceMotionEvent API is disabled
cdumez@apple.com [Wed, 27 Feb 2019 19:03:21 +0000 (19:03 +0000)]
Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
https://bugs.webkit.org/show_bug.cgi?id=195101
<rdar://problem/48423023>

Reviewed by Geoffrey Garen.

Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
tries to register a "devicemotion" event listener and fails because the API is disabled. This is
needed to unblock the site and proceed with the login flow.

Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
guard the quirk behind this flag.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
* page/DOMWindow.h:

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

6 months agoSupport Pointer Events on macOS
commit-queue@webkit.org [Wed, 27 Feb 2019 19:02:03 +0000 (19:02 +0000)]
Support Pointer Events on macOS
https://bugs.webkit.org/show_bug.cgi?id=195008
<rdar://problem/47454419>

Patch by Antoine Quint <graouts@apple.com> on 2019-02-27
Reviewed by Dean Jackson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
and the same behavior also extends to "pointerup".

Tests: pointerevents/mouse/over-enter-out-leave.html
       pointerevents/mouse/pointer-capture.html
       pointerevents/mouse/pointer-event-basic-properties.html
       pointerevents/mouse/pointer-events-before-mouse-events.html
       pointerevents/mouse/pointerdown-prevent-default.html

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
property does not have any effect on macOS.
(WebCore::Document::invalidateRenderingDependentRegions):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::updateTouchActionElements):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
the mouse event.
* dom/PointerEvent.cpp:
(WebCore::pointerEventType):
(WebCore::PointerEvent::create):
* dom/PointerEvent.h:
* page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
(WebCore::hierarchyHasCapturingEventListeners):
(WebCore::EventHandler::updateMouseEventTargetNode):
* page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
(WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
(WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
pending target override needs to be considered to determine whether a given element has pointer capture enabled.
(WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
it is set.
* page/PointerLockController.cpp: Fix a build error which only happened on macOS.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

Add a WebKitLegacy API to enable and disable the Pointer Events runtime feature.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences pointerEventsEnabled]):
(-[WebPreferences setPointerEventsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures): Enable the PointerEvents runtime feature in DumpRenderTree such that tests targeting WK1 may test the Pointer Events feature.
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* platform/mac-wk1/TestExpectations: Mark select tests as failures due to webkit.org/b/195008.
* platform/mac/TestExpectations: Enable the new mouse-based tests.
* pointerevents/mouse/over-enter-out-leave-expected.txt: Added.
* pointerevents/mouse/over-enter-out-leave.html: Added.
* pointerevents/mouse/pointer-capture-expected.txt: Added.
* pointerevents/mouse/pointer-capture.html: Added.
* pointerevents/mouse/pointer-event-basic-properties-expected.txt: Added.
* pointerevents/mouse/pointer-event-basic-properties.html: Added.
* pointerevents/mouse/pointer-events-before-mouse-events-expected.txt: Added.
* pointerevents/mouse/pointer-events-before-mouse-events.html: Added.
* pointerevents/mouse/pointerdown-prevent-default-expected.txt: Added.
* pointerevents/mouse/pointerdown-prevent-default.html: Added.
* pointerevents/utils.js:
(prototype.clear):

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

6 months agoNetwork Process is put to suspended when holding locked IndexedDB files
sihui_liu@apple.com [Wed, 27 Feb 2019 18:55:07 +0000 (18:55 +0000)]
Network Process is put to suspended when holding locked IndexedDB files
https://bugs.webkit.org/show_bug.cgi?id=195024
<rdar://problem/45194169>

Reviewed by Geoffrey Garen.

Source/WebCore:

We found network process was suspended when IDBDatabase was being closed in the background database thread,
holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by
taking background assertion in UI process until the closes are done and locks are released.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::closeDatabase):
(WebCore::IDBServer::IDBServer::didCloseDatabase):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::create):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::idbServer):
(WebKit::NetworkProcess::notifyHoldingLockedFiles):
* NetworkProcess/NetworkProcess.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

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

6 months agoHave a single notion of scroll position in the scrolling tree and derive layoutViewpo...
simon.fraser@apple.com [Wed, 27 Feb 2019 18:47:49 +0000 (18:47 +0000)]
Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
https://bugs.webkit.org/show_bug.cgi?id=194973

Reviewed by Antti Koivisto.

This patch cleans up how the scrolling tree responds to scrolls.

First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
UI process scroll position.

On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
updates related layers on this node (counter-scrolling layers etc), and then tells the
scrolling tree, which recurses through descendant nodes so they can adjust their layer
positions.

On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
which does the above other than setting scrolledContentsLayer (since we're reacting to
layer state changes, not producing them).

updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
ScrollingTree does the tree walk so classes don't have to implement
updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
need to cross frame boundaries).

We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
since the fixed state was computed with the "layout" scroll position, so we have to account
for the scroll delta since the last committed position. It's possible we could improve this
in future.

Source/WebCore:

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
(WebCore::ScrollingTree::mainFrameLayoutViewport):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
(WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
(WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
(WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
(): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):

Source/WebKit:

* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
* UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
(WebKit::ScrollerPairMac::updateValues):
(WebKit::ScrollerPairMac::valuesForOrientation):
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

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

6 months agoSilence log after r242122
achristensen@apple.com [Wed, 27 Feb 2019 18:05:06 +0000 (18:05 +0000)]
Silence log after r242122
https://bugs.webkit.org/show_bug.cgi?id=195074

* UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databasePath const):
m_localStorageDirectory can now be null for ephemeral sessions.
This is not a failure to create a directory and needs no log.
This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.

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

6 months agoscrolling/ios/hit-testing-iframe* tests need to hide the tap highlight
simon.fraser@apple.com [Wed, 27 Feb 2019 17:33:44 +0000 (17:33 +0000)]
scrolling/ios/hit-testing-iframe* tests need to hide the tap highlight
https://bugs.webkit.org/show_bug.cgi?id=195099

Reviewed by Frederic Wang.

These tests were failing because the ref test captured the tap highlight, so hide
it with -webkit-tap-highlight-color: transparent;

* fast/scrolling/ios/hit-testing-iframe-001.html:
* fast/scrolling/ios/hit-testing-iframe-002.html:
* fast/scrolling/ios/hit-testing-iframe-003.html:
* fast/scrolling/ios/hit-testing-iframe-004.html:
* fast/scrolling/ios/hit-testing-iframe-005.html:
* fast/scrolling/ios/hit-testing-iframe-006.html:
* fast/scrolling/ios/mixing-user-and-programmatic-scroll-006.html:
* platform/ios-wk2/TestExpectations: hit-testing-iframe-006.html passes now.

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

6 months ago[MSE] SourceBuffer sample time increment vs. last frame duration check is broken
commit-queue@webkit.org [Wed, 27 Feb 2019 17:31:46 +0000 (17:31 +0000)]
[MSE] SourceBuffer sample time increment vs. last frame duration check is broken
https://bugs.webkit.org/show_bug.cgi?id=194747
<rdar://problem/48148469>

Patch by Ulrich Pflueger <up@nanocosmos.de> on 2019-02-27
Reviewed by Jer Noble.

Source/WebCore:

Prevent unintended frame drops by including last frame duration in discontinuity check.

Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

LayoutTests:

* media/media-source/media-source-append-variable-frame-lengths-with-matching-durations-expected.txt: Added.
* media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html: Added.

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

6 months agoREGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
timothy@apple.com [Wed, 27 Feb 2019 16:59:08 +0000 (16:59 +0000)]
REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
https://bugs.webkit.org/show_bug.cgi?id=195086
rdar://problem/48419124

Reviewed by Tim Horton.

Source/WebCore:

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.

Source/WebKit:

* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
(-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.

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

6 months agoRemove remaining poisoning code.
mark.lam@apple.com [Wed, 27 Feb 2019 07:50:04 +0000 (07:50 +0000)]
Remove remaining poisoning code.
https://bugs.webkit.org/show_bug.cgi?id=194138

Reviewed by Saam Barati.

Source/WTF:

This patch removes the instantiation of Poisoned variants of the various containers
but retains the ability of those containers to work with pointer traits.  This
allows us to use them with smart pointers in the future (just like we used to with
Poisoned values).  At minimum, this ability will be useful when we want to insert
an observer into the container storage type for debugging purposes, or to collect
statistics for profiling.

* WTF.xcodeproj/project.pbxproj:
* wtf/Bag.h:
* wtf/CMakeLists.txt:
* wtf/Platform.h:
* wtf/Poisoned.cpp: Removed.
* wtf/Poisoned.h: Removed.
* wtf/PoisonedUniquePtr.h: Removed.
* wtf/Ref.h:
* wtf/RefCountedArray.h:
* wtf/RefPtr.h:
* wtf/WTFAssertions.cpp:

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Poisoned.cpp: Removed.
* TestWebKitAPI/Tests/WTF/PoisonedRef.cpp: Removed.
* TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp: Removed.
* TestWebKitAPI/Tests/WTF/PoisonedUniquePtr.cpp: Removed.
* TestWebKitAPI/Tests/WTF/PoisonedUniquePtrForNonTriviallyDestructibleArrays.cpp: Removed.
* TestWebKitAPI/Tests/WTF/PoisonedUniquePtrForTriviallyDestructibleArrays.cpp: Removed.

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

6 months agoThe table head of test freshness page should not scroll with the page.
dewei_zhu@apple.com [Wed, 27 Feb 2019 07:33:22 +0000 (07:33 +0000)]
The table head of test freshness page should not scroll with the page.
https://bugs.webkit.org/show_bug.cgi?id=195092

Reviewed by Ryosuke Niwa.

Fix the location of the freshness table head to make it easier to corelate cell with test.

* public/v3/pages/test-freshness-page.js: Changed some style rules to make the table head fixed.
(TestFreshnessPage.prototype._renderTable):
(TestFreshnessPage.cssTemplate):

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

6 months ago[PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
cdumez@apple.com [Wed, 27 Feb 2019 05:46:52 +0000 (05:46 +0000)]
[PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
https://bugs.webkit.org/show_bug.cgi?id=195089

Reviewed by Geoffrey Garen.

Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
cache since we need to do this on memory pressure and when clearing website data.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
* UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcessIfPossible):
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::takeProcess):
(WebKit::WebProcessCache::CachedProcess::~CachedProcess):
* UIProcess/WebProcessCache.h:
(WebKit::WebProcessCache::setIsDisabled): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleMemoryPressureWarning):
(WebKit::WebProcessPool::hasSuspendedPageFor const):
(WebKit::WebProcessPool::clearSuspendedPages):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::maybeShutDown):
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::suspendedPageCount const):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):

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

6 months agoRemove poisons in JSCPoison and uses of them.
mark.lam@apple.com [Wed, 27 Feb 2019 05:43:34 +0000 (05:43 +0000)]
Remove poisons in JSCPoison and uses of them.
https://bugs.webkit.org/show_bug.cgi?id=195082

Reviewed by Yusuke Suzuki.

Also removed unused poisoning code in WriteBarrier, AssemblyHelpers,
DFG::SpeculativeJIT, FTLLowerDFGToB3, and FTL::Output.

* API/JSAPIWrapperObject.h:
(JSC::JSAPIWrapperObject::wrappedObject):
* API/JSCallbackFunction.h:
* API/JSCallbackObject.h:
* API/glib/JSAPIWrapperGlobalObject.h:
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
(JSC::DFG::SpeculativeJIT::compileGetArrayLength):
(JSC::DFG::SpeculativeJIT::compileNewFunctionCommon):
(JSC::DFG::SpeculativeJIT::compileGetExecutable):
(JSC::DFG::SpeculativeJIT::compileCreateThis):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPoisonedPointer): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetExecutable):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArrayLength):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileNewFunction):
(JSC::FTL::DFG::LowerDFGToB3::weakPointer):
(JSC::FTL::DFG::LowerDFGToB3::dynamicPoison): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::dynamicPoisonOnLoadedType): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::dynamicPoisonOnType): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::weakPoisonedPointer): Deleted.
* ftl/FTLOutput.h:
(JSC::FTL::Output::weakPoisonedPointer): Deleted.
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitDynamicPoison): Deleted.
(JSC::AssemblyHelpers::emitDynamicPoisonOnLoadedType): Deleted.
(JSC::AssemblyHelpers::emitDynamicPoisonOnType): Deleted.
* jit/AssemblyHelpers.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_create_this):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitScopedArgumentsGetByVal):
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::nativeForGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):
* parser/UnlinkedSourceCode.h:
* runtime/ArrayPrototype.h:
* runtime/CustomGetterSetter.h:
(JSC::CustomGetterSetter::getter const):
(JSC::CustomGetterSetter::setter const):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::getCallData):
(JSC::InternalFunction::getConstructData):
* runtime/InternalFunction.h:
(JSC::InternalFunction::nativeFunctionFor):
* runtime/JSArrayBuffer.h:
* runtime/JSBoundFunction.h:
* runtime/JSCPoison.cpp: Removed.
* runtime/JSCPoison.h: Removed.
* runtime/JSFunction.h:
* runtime/JSGlobalObject.h:
* runtime/JSScriptFetchParameters.h:
* runtime/JSScriptFetcher.h:
* runtime/JSString.h:
* runtime/NativeExecutable.cpp:
(JSC::NativeExecutable::hashFor const):
* runtime/NativeExecutable.h:
* runtime/Options.h:
* runtime/ScopedArguments.h:
* runtime/Structure.cpp:
(JSC::StructureTransitionTable::setSingleTransition):
* runtime/StructureTransitionTable.h:
(JSC::StructureTransitionTable::map const):
(JSC::StructureTransitionTable::weakImpl const):
(JSC::StructureTransitionTable::setMap):
* runtime/WriteBarrier.h:
* wasm/WasmB3IRGenerator.cpp:
* wasm/WasmInstance.h:
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::clearFunction):
* wasm/js/JSWebAssemblyTable.h:
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunctionBase.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyModuleRecord.h:
* wasm/js/WebAssemblyToJSCallee.h:
* wasm/js/WebAssemblyWrapperFunction.h:

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

6 months agoMove ephemeral local storage from WebProcess to UIProcess
achristensen@apple.com [Wed, 27 Feb 2019 04:40:48 +0000 (04:40 +0000)]
Move ephemeral local storage from WebProcess to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=195074
<rdar://problem/47937975>

Reviewed by Geoff Garen.

Source/WebKit:

Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.

* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
(WebKit::StorageManager::StorageManager):
(WebKit::StorageManager::createLocalStorageMap):
(WebKit::StorageManager::createTransientLocalStorageMap):
(WebKit::StorageManager::createSessionStorageMap):
(WebKit::StorageManager::destroyStorageMap):
(WebKit::StorageManager::getValues):
(WebKit::StorageManager::setItem):
(WebKit::StorageManager::removeItem):
(WebKit::StorageManager::clear):
* UIProcess/WebStorage/StorageManager.h:
* UIProcess/WebStorage/StorageManager.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* WebProcess/WebStorage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
(WebKit::StorageAreaMap::loadValuesIfNeeded):
* WebProcess/WebStorage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::storageArea):
(WebKit::StorageNamespaceImpl::copy):
(): Deleted.
(WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
* WebProcess/WebStorage/StorageNamespaceImpl.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoIncorrect formatting around command in Readme.md
commit-queue@webkit.org [Wed, 27 Feb 2019 04:19:27 +0000 (04:19 +0000)]
Incorrect formatting around command in Readme.md
https://bugs.webkit.org/show_bug.cgi?id=195061

Patch by Gabe Giosia <giosia@google.com> on 2019-02-26
Reviewed by Fujii Hironori.

* ReadMe.md: removed stray period

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

6 months agoREGRESSION: stress/regress-178386.js is timing out on JSC debug bot
ysuzuki@apple.com [Wed, 27 Feb 2019 03:48:25 +0000 (03:48 +0000)]
REGRESSION: stress/regress-178386.js is timing out on JSC debug bot
https://bugs.webkit.org/show_bug.cgi?id=194677
<rdar://problem/48112492>

Reviewed by Mark Lam.

Before r241233, String.fromCharCode (except for an empty string) always returns 16bit string.
This makes the rope generated by padEnd 16bit. When we resolve the rope inside JSON.stringify,
it immediately fails due the large size.

After r241233, String.fromCharCode starts returning 8bit string if possible. So the rope becomes
8bit, and we successfully resolve the rope in this case. Resolving such a large rope takes long
time and that is why stress/regress-178386.js starts timing out. Note that, the test fails with
OOM error anyway because JSON.stringify's builder overflows with such a large string input.

This patch changes the test to produce 16bit string from String.fromCharCode.

* stress/regress-178386.js:

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

6 months agoWeb Inspector: Use system accent color throughout UI
mattbaker@apple.com [Wed, 27 Feb 2019 01:28:02 +0000 (01:28 +0000)]
Web Inspector: Use system accent color throughout UI
https://bugs.webkit.org/show_bug.cgi?id=193507
<rdar://problem/47327971>

Reviewed by Timothy Hatcher.

* UserInterface/Images/Breakpoint.png: Removed.
* UserInterface/Images/Breakpoint.svg: Added.
* UserInterface/Images/Breakpoint@2x.png: Removed.
* UserInterface/Images/BreakpointInactive.png: Removed.
* UserInterface/Images/BreakpointInactive@2x.png: Removed.
Replace breakpoint pixel art with an SVG image that can be styled in CSS.

* UserInterface/Images/CSSVariable.svg:
* UserInterface/Images/CubicBezier.svg:
* UserInterface/Images/UserInputPrompt.svg:
Remove fill color since it is now styled in CSS.

* UserInterface/Views/BezierEditor.css:
(.bezier-editor > .bezier-preview > div):
(@media (prefers-color-scheme: dark)):
(.bezier-editor > .bezier-container .control-handle):
(.bezier-editor > .bezier-container .control-line):
Use system accent color for control handles.

* UserInterface/Views/BreakpointTreeElement.css:
(.item.breakpoint .status > .status-image):
(.item.breakpoint .status > .status-image.resolved):
Use system accent color for breakpoint fill, with a dark outline
to match Xcode and make the button stand out against the selection.

* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype._updateStatus):

* UserInterface/Views/ButtonNavigationItem.css:
(.navigation-bar .item.button > .glyph):

* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt):

* UserInterface/Views/DOMBreakpointTreeElement.js:
* UserInterface/Views/DOMTreeContentView.css:
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint):
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled,):
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree):
(.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled): Deleted.
(.content-view.dom-tree .tree-outline.dom.breakpoints-disabled li .status-image.breakpoint): Deleted.
(.content-view.dom-tree .tree-outline.dom.breakpoints-disabled li .status-image.breakpoint.disabled): Deleted.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li.selected .selection-area):
(.tree-outline.dom li.elements-drag-over .selection-area):
(.tree-outline.dom:focus li:matches(.selected, .hovered) .selection-area):
(.tree-outline.dom li.hovered:not(.selected) .selection-area):
(.tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
Use the system accent color for the "pseudo-class enabled" marker.
(@media (prefers-color-scheme: dark)):
(.tree-outline.dom:focus li.selected .selection-area): Deleted.
Use --selected-background-color for selection and hover styles, which is
set to the system highlight color if available.

* UserInterface/Views/InlineSwatch.css:
(.inline-swatch:matches(.bezier, .spring, .variable)):
(.inline-swatch:matches(.bezier, .spring)): Deleted.
(.inline-swatch.variable): Deleted.

* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):

* UserInterface/Views/NetworkDetailView.css:
(.network .network-detail .navigation-bar .item.radio.button.text-only:before):
(.network .network-detail .navigation-bar .item.radio.button.text-only.selected):
(@media (prefers-color-scheme: dark)):
(.network-detail .item.close > .glyph):

* UserInterface/Views/QuickConsole.css:
(.quick-console > .console-prompt > .glyph):
(.quick-console > .console-prompt::before): Deleted.

* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):
(.navigation-bar .item.radio.button.text-only::before):
(.navigation-bar .item.radio.button.text-only:matches(.selected, :hover)):
(.navigation-bar .item.radio.button.text-only:matches(.selected, :hover)::before):
(.navigation-bar .item.radio.button.text-only:not(.selected):hover::before):
(.navigation-bar .item.radio.button.text-only.selected:active::before):
(.navigation-bar .item.radio.button.text-only:hover): Deleted.
(.navigation-bar .item.radio.button.text-only.selected): Deleted.
(.navigation-bar .item.radio.button.text-only:active): Deleted.
(.navigation-bar .item.radio.button.text-only.selected:active): Deleted.
Use system accent color for selection and hover styles. Since it isn't
yet possible to derive new colors from the accent color in CSS, fake it
with a ::before pseudo-element that can have have `filter` or `opacity`
effects applied to it without altering the button text color.

* UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
(.timeline-overview-graph.rendering-frame > .frame-marker):
Use system accent color for selected frame marker.

* UserInterface/Views/ScopeBar.css:
(.scope-bar > li):
(.scope-bar > li::before):
(.scope-bar.default-item-selected > li.multiple.selected::before):
(.scope-bar > li:matches(.selected, :hover)):
(.scope-bar > li:matches(.selected, :hover)::before):
(.scope-bar > li:not(.selected):hover::before):
(.scope-bar > li.selected:active::before):
(.scope-bar > li:hover): Deleted.
(.scope-bar > li.selected): Deleted.
(.scope-bar > li:active): Deleted.
(.scope-bar > li.selected:active): Deleted.

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings .navigation-bar .item.radio.button.text-only:before):

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor):
(@media (prefers-color-scheme: dark)):

* UserInterface/Views/TextEditor.css:
(.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before):
(.text-editor > .CodeMirror .breakpoint-resolved .CodeMirror-linenumber::before):
(.text-editor > .CodeMirror .has-breakpoint.multiple-breakpoints .CodeMirror-linenumber::before):
(@keyframes text-editor-highlight-fadeout):
(@keyframes text-editor-hovered-expression-highlight-fadeout):
Replace breakpoint pixel art with a solid color (the system accent
color) clipped to the shape of a breakpoint.

* UserInterface/Views/TimelineRecordFrame.css:
(.timeline-record-frame.selected):

* UserInterface/Views/URLBreakpointTreeElement.js:

* UserInterface/Views/Variables.css:
(:root):
(body.window-inactive):
(@media (prefers-color-scheme: dark)):
(body.mac-platform:not(.sierra, .high-sierra)):
Add custom property overrides for system colors where supported.

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

6 months agoRemove conditional compile guard for InsertIntoTextNodeCommand::doReapply
wenson_hsieh@apple.com [Wed, 27 Feb 2019 01:13:50 +0000 (01:13 +0000)]
Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
https://bugs.webkit.org/show_bug.cgi?id=195067
<rdar://problem/44812080>

Reviewed by Tim Horton.

Source/WebCore:

This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
specific guards around this logic.

Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
a very subtle behavior change covered by the new layout test below.

Test: editing/undo/redo-text-insertion-in-non-editable-node.html

* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doReapply):
* editing/InsertIntoTextNodeCommand.h:

LayoutTests:

Add a new layout test to verify that redoing text insertion in a non-editable element (which was previously
editable) does not mutate the text nodes affected by editing. This test case currently fails on iOS, since we
take a separate codepath when redoing that does not contain this additional check.

* editing/undo/redo-text-insertion-in-non-editable-node-expected.txt: Added.
* editing/undo/redo-text-insertion-in-non-editable-node.html: Added.

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

6 months agoCode quality cleanup in NeverDestroyed
keith_miller@apple.com [Wed, 27 Feb 2019 00:59:49 +0000 (00:59 +0000)]
Code quality cleanup in NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=194824

Source/WebCore:

Reviewed by Mark Lam.

name_names.pl should not just assume the layout of LazyNeverDestroyed.

* dom/make_names.pl:
(printNamesCppFile):

Source/WTF:

Reviewed by Yusuke Suzuki.

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

* wtf/NeverDestroyed.h:

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

6 months agoDo not try to observe the timer when Page is nullptr
zalan@apple.com [Wed, 27 Feb 2019 00:36:36 +0000 (00:36 +0000)]
Do not try to observe the timer when Page is nullptr
https://bugs.webkit.org/show_bug.cgi?id=195076

Reviewed by Tim Horton.

Covered by fast/dom/Window/timer-null-script-execution-context.html.

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

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

6 months agowasmToJS() should purify incoming NaNs.
mark.lam@apple.com [Wed, 27 Feb 2019 00:25:34 +0000 (00:25 +0000)]
wasmToJS() should purify incoming NaNs.
https://bugs.webkit.org/show_bug.cgi?id=194807
<rdar://problem/48189132>

Reviewed by Saam Barati.

JSTests:

* wasm/regress/wasmToJS-should-purify-NaNs.js: Added.

Source/JavaScriptCore:

* runtime/JSCJSValue.h:
(JSC::jsNumber):
* runtime/TypedArrayAdaptors.h:
(JSC::IntegralTypedArrayAdaptor::toJSValue):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):

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

6 months ago[Cocoa] Media elements will restart network buffering just before suspending
jer.noble@apple.com [Wed, 27 Feb 2019 00:04:10 +0000 (00:04 +0000)]
[Cocoa] Media elements will restart network buffering just before suspending
https://bugs.webkit.org/show_bug.cgi?id=193691

Reviewed by Eric Carlson.

Source/WebCore:

API Test: WebKit.ProcessSuspendMediaBuffering

Allow the Page to suspend all media buffering in its child Documents.

* dom/Document.cpp:
(WebCore::Document::suspendAllMediaBuffering):
(WebCore::Document::resumeAllMediaBuffering):
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::dataBufferingPermitted const):
(WebCore::MediaElementSession::suspendBuffering):
(WebCore::MediaElementSession::resumeBuffering):
(WebCore::MediaElementSession::bufferingSuspended const):
* html/MediaElementSession.h:
* page/Page.cpp:
(WebCore::Page::suspendAllMediaBuffering):
(WebCore::Page::resumeAllMediaBuffering):
* page/Page.h:
(WebCore::Page::mediaPlaybackIsSuspended const):
(WebCore::Page::mediaBufferingIsSuspended const):
(WebCore::Page::mediaPlaybackIsSuspended): Deleted.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::suspendBuffering):
(WebCore::PlatformMediaSession::resumeBuffering):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
(WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
* platform/audio/PlatformMediaSessionManager.h:

Source/WebKit:

When the WebProcess receives a notification that the process is about to become
suspended, it tells the MemoryPressureHandler to release all critical memory. This
has the side effect of causing AVFoundation-backed media elements to dump their
in-memory caches and start downloading media data again. Instead, media elements
should all stop buffering media data during suspension. Add new testing SPI to
simulate suspension and resume messages.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSuspendImminentlyForTesting]):
(-[WKWebView _processDidResumeForTesting]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WKInkPickerView.mm:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendAllMediaBuffering):
(WebKit::WebPage::resumeAllMediaBuffering):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::suspendAllMediaBuffering):
(WebKit::WebProcess::resumeAllMediaBuffering):
* WebProcess/WebProcess.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSuspendMediaBuffering.mm: Added.
(TEST):

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

6 months agoMove service worker response validation from the service worker client to the service...
youenn@apple.com [Tue, 26 Feb 2019 23:53:22 +0000 (23:53 +0000)]
Move service worker response validation from the service worker client to the service worker itself
https://bugs.webkit.org/show_bug.cgi?id=194716

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebased tests as we now report to the console log any service worker response validation erorr.

* web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-image.https-expected.txt:

Source/WebCore:

Added response validation at service worker side.

No change of behavior except for now logging validation error messages in the console.
Covered by rebased tests.

* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::validateResponse):
(WebCore::ServiceWorkerFetch::processResponse):
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):

Source/WebKit:

Removed response validation as it is now done in service worker side.

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):

LayoutTests:

Rebased tests as we now report to the console log any service worker response validation erorr.

* http/tests/inspector/network/resource-response-service-worker-expected.txt:
* http/tests/workers/service/basic-fetch.https-expected.txt:
* http/tests/workers/service/service-worker-crossorigin-fetch-expected.txt:

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

6 months ago[Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
sihui_liu@apple.com [Tue, 26 Feb 2019 23:38:31 +0000 (23:38 +0000)]
[Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=195036

Reviewed by Geoffrey Garen.

When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but
also transactions in committing process.

Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise
there is a reference cycle of TransactionOpration.

Covered by existing tests storage/indexeddb/IDBObject-leak.html.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the
operation is in completion process.

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

6 months agoFix warnings on ARM and MIPS
dinfuehr@igalia.com [Tue, 26 Feb 2019 22:40:03 +0000 (22:40 +0000)]
Fix warnings on ARM and MIPS
https://bugs.webkit.org/show_bug.cgi?id=195049

Reviewed by Mark Lam.

.:

Disable warnings for changes to the ABI with GCC 7.1.

* Source/cmake/WebKitCompilerFlags.cmake:

Source/JavaScriptCore:

Fix all warnings on ARM and MIPS.

* assembler/MacroAssemblerPrinter.cpp:
(JSC::Printer::printMemory):
* assembler/testmasm.cpp:
(JSC::testProbeModifiesStackValues):
* bytecode/InByIdStatus.cpp:
(JSC::InByIdStatus::computeFor):
* runtime/CachedTypes.cpp:
(JSC::VariableLengthObject::buffer const):
* runtime/JSBigInt.h:
* tools/JSDollarVM.cpp:
(JSC::codeBlockFromArg):

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

6 months ago[ContentChangeObserver] clearContentChangeObservers should be internal to ContentChan...
zalan@apple.com [Tue, 26 Feb 2019 22:31:07 +0000 (22:31 +0000)]
[ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195066
<rdar://problem/48411682>

Reviewed by Tim Horton.

Source/WebCore:

Now all the empty clearContentChangeObservers() implementations can be removed.

* dom/Document.cpp:
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
(WebCore::ContentChangeObserver::willDetachPage):

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::clearContentChangeObservers): Deleted.

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::clearContentChangeObservers): Deleted.

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

6 months ago[iOS] Sandbox should allow mach lookups related to media capturing
pvollan@apple.com [Tue, 26 Feb 2019 22:14:51 +0000 (22:14 +0000)]
[iOS] Sandbox should allow mach lookups related to media capturing
https://bugs.webkit.org/show_bug.cgi?id=194951

Reviewed by Eric Carlson.

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

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

6 months agoUpdate NetworkSession to use Session Cleanup when available
bfulgham@apple.com [Tue, 26 Feb 2019 22:08:33 +0000 (22:08 +0000)]
Update NetworkSession to use Session Cleanup when available
https://bugs.webkit.org/show_bug.cgi?id=195019
<rdar://problem/45149868>

Reviewed by Alex Christensen.

If the build environment supports Session Cleanup, initialize it.

No test changes since this doesn't do anything on the test systems at present.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

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

6 months agoWeb Inspector: Search: no results when opening to Search tab
drousso@apple.com [Tue, 26 Feb 2019 21:50:41 +0000 (21:50 +0000)]
Web Inspector: Search: no results when opening to Search tab
https://bugs.webkit.org/show_bug.cgi?id=195058
<rdar://problem/48407699>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):
If targets aren't available, wait until they are and then perform the search.

* UserInterface/Base/Main.js:
(WI.targetsAvailable): Added.
Expose getter for indicating whether targets are available.

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

6 months agoWeb Inspector: CPU Usage Timeline - Main Thread Indicator
joepeck@webkit.org [Tue, 26 Feb 2019 21:40:50 +0000 (21:40 +0000)]
Web Inspector: CPU Usage Timeline - Main Thread Indicator
https://bugs.webkit.org/show_bug.cgi?id=194972

Reviewed by Devin Rousso.

* UserInterface/Main.html:
* UserInterface/Base/Utilities.js:
(value):
The existing enclosingNode doesn't work for SVG because its names
are lowercase. Add a simplified version for the svg case.

* UserInterface/Views/RangeChart.js: Added.
(WI.RangeChart):
(WI.RangeChart.prototype.get size):
(WI.RangeChart.prototype.set size):
(WI.RangeChart.prototype.addRange):
(WI.RangeChart.prototype.clear):
(WI.RangeChart.prototype.layout):
A new chart that draws rects for given ranges.

* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.recordsOverlappingTimeRange):
Helper to specifically get records touching a range. Useful
for when we have a single pixel spanning (startTime -> endTime)
and we want to find records in that pixel.

* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart rect):
(.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-script):
(.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-style):
(.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-layout):
(.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-paint):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.get indicatorViewHeight):
(WI.CPUTimelineView.prototype.clear):
(WI.CPUTimelineView.prototype.get scrollableElements):
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype.layout):
(WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
(WI.CPUTimelineView.prototype._handleIndicatorClick):
(WI.CPUTimelineView.prototype._attemptSelectIndicatatorTimelineRecord):
(WI.CPUTimelineView.prototype._selectTimelineRecord):
Place the Main Thread Indicator view beneath the big graph.
Clicking inside it selects records in the Timeline Overview.

* UserInterface/Views/CPUUsageIndicatorView.css: Added.
(.cpu-usage-indicator-view):
(.cpu-usage-indicator-view > .details):
(body[dir=ltr] .cpu-usage-indicator-view > .details):
(body[dir=rtl] .cpu-usage-indicator-view > .details):
(body[dir=rtl] .cpu-usage-indicator-view > .graph):
(.cpu-usage-indicator-view > .graph):
(.cpu-usage-indicator-view > .graph,):
* UserInterface/Views/CPUUsageIndicatorView.js: Added.
(WI.CPUUsageIndicatorView):
(WI.CPUUsageIndicatorView.prototype.get chart):
(WI.CPUUsageIndicatorView.prototype.clear):
(WI.CPUUsageIndicatorView.prototype.updateChart):
Converts the CPU samples data into a RangeChart. It works to coalesce
many samples of the same type into a single range to reduce total ranges.

* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._recordSelected):
(WI.TimelineRecordingContentView.prototype._recordWasSelected):
(WI.TimelineRecordingContentView.prototype._selectRecordInTimelineOverview):
(WI.TimelineRecordingContentView.prototype._selectRecordInTimelineView):
* UserInterface/Views/TimelineView.js:
Add a path for a TimelineView to dispatch a record selected event and cause
have the TimelineRecordingContentView react to it by updating the timeline
overview and relevent timeline view.

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

6 months agoMisc cleanup in StructureIDTable after r242096.
mark.lam@apple.com [Tue, 26 Feb 2019 21:40:48 +0000 (21:40 +0000)]
Misc cleanup in StructureIDTable after r242096.
https://bugs.webkit.org/show_bug.cgi?id=195063

Reviewed by Saam Barati.

* runtime/StructureIDTable.cpp:
(JSC::StructureIDTable::allocateID):
- RELEASE_ASSERT that the StructureID allocation will succeed.

* runtime/StructureIDTable.h:
(JSC::StructureIDTable::decode):
(JSC::StructureIDTable::encode):
- Add back a comment that Yusuke requested but was lost when the patch was rolled
  out and relanded.
- Applied bitwise_casts that Saam requested.

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

6 months ago[ContentChangeObserver] Move style recalc schedule observation logic to ContentChange...
zalan@apple.com [Tue, 26 Feb 2019 21:01:28 +0000 (21:01 +0000)]
[ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=195062
<rdar://problem/48409258>

Reviewed by Tim Horton.

Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.

* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didScheduleStyleRecalc):
(WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.

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

6 months agoGardening: 32-bit build fix after r242096.
mark.lam@apple.com [Tue, 26 Feb 2019 20:54:12 +0000 (20:54 +0000)]
Gardening: 32-bit build fix after r242096.
https://bugs.webkit.org/show_bug.cgi?id=194989

Not reviewed.

* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitLoadStructure):

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

6 months agoUnpoison MacroAssemblerCodePtr, ClassInfo pointers, and a few other things.
mark.lam@apple.com [Tue, 26 Feb 2019 20:49:50 +0000 (20:49 +0000)]
Unpoison MacroAssemblerCodePtr, ClassInfo pointers, and a few other things.
https://bugs.webkit.org/show_bug.cgi?id=195039

Reviewed by Saam Barati.

1. Unpoison MacroAssemblerCodePtrs, ReturnAddressPtr.
2. Replace PoisonedClassInfoPtr with ClassInfo*.
3. Replace PoisonedMasmPtr with const void*.
4. Remove all references to CodeBlockPoison, JITCodePoison, and GlobalDataPoison.

* API/JSCallbackObject.h:
* API/JSObjectRef.cpp:
(classInfoPrivate):
* assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr):
(JSC::FunctionPtr::executableAddress const):
(JSC::FunctionPtr::retaggedExecutableAddress const):
(JSC::ReturnAddressPtr::ReturnAddressPtr):
(JSC::ReturnAddressPtr::value const):
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
(JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
(JSC::MacroAssemblerCodePtr:: const):
(JSC::MacroAssemblerCodePtr::operator! const):
(JSC::MacroAssemblerCodePtr::operator== const):
(JSC::MacroAssemblerCodePtr::hash const):
(JSC::MacroAssemblerCodePtr::emptyValue):
(JSC::MacroAssemblerCodePtr::deletedValue):
(JSC::FunctionPtr<tag>::FunctionPtr):
(JSC::MacroAssemblerCodePtr::poisonedPtr const): Deleted.
* b3/B3LowerMacros.cpp:
* b3/testb3.cpp:
(JSC::B3::testInterpreter):
* dfg/DFGOSRExitCompilerCommon.h:
(JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCheckSubClass):
(JSC::DFG::SpeculativeJIT::compileNewStringObject):
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
(JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump):
(JSC::DFG::SpeculativeJIT::emitSwitchChar):
* dfg/DFGSpeculativeJIT.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateDestructibleObject):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::boundThisNoArgsFunctionCallGenerator):
* runtime/JSCPoison.h:
* runtime/JSDestructibleObject.h:
(JSC::JSDestructibleObject::classInfo const):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::classInfo const):
* runtime/Structure.h:
* runtime/VM.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):

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

6 months ago[iOS] Regression(PSON) Scroll position is no longer restored when navigating back...
cdumez@apple.com [Tue, 26 Feb 2019 20:34:36 +0000 (20:34 +0000)]
[iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
https://bugs.webkit.org/show_bug.cgi?id=195054
<rdar://problem/48330549>

Reviewed by Geoff Garen.

Source/WebCore:

Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.

* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/MemoryRelease.h:

Source/WebKit:

We attempt to restore the scroll position twice, on first layout and then on load completion.
Before PSON, the scroll position would fail to get restored on first layout but would succeed
on load completion because the view is tall enough by then. With PSON however, we would
fail to restore the scroll position on load completion because the view would not be tall
enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
and would then get reloaded abd finish loading *after* the load event.

To address the issue, we now make sure to not purge the memory cache on process suspension on
iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::incrementSuspendedPageCount):
(WebKit::WebProcessProxy::decrementSuspendedPageCount):
* UIProcess/WebProcessProxy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setHasSuspendedPageProxy):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

6 months ago[iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site...
rniwa@webkit.org [Tue, 26 Feb 2019 20:24:43 +0000 (20:24 +0000)]
[iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
https://bugs.webkit.org/show_bug.cgi?id=195037
<rdar://problem/48154508>

Reviewed by Antti Koivisto.

Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
as this has been an issue when I was able to reproduce the issue locally.

Also added release logging to help diagnose the issue in the future.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
(WebKit::WebPage::didCompletePageTransition):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::freezeAllLayerTrees):
(WebKit::WebProcess::unfreezeAllLayerTrees):

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

6 months agoCreate WebPageProxy::m_userMediaPermissionRequestManager only when needed
youenn@apple.com [Tue, 26 Feb 2019 19:47:38 +0000 (19:47 +0000)]
Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
https://bugs.webkit.org/show_bug.cgi?id=195051

Reviewed by Eric Carlson.

Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
in some methods to reset its state when main document is changing, view is becoming visible...
This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
(WebKit::WebPageProxy::didChangeMainDocument):
(WebKit::WebPageProxy::viewIsBecomingVisible):
(WebKit::WebPageProxy::clearUserMediaState):
(WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
since there is or was some capturing done for the page.

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

6 months ago[Re-landing] Add some randomness into the StructureID.
mark.lam@apple.com [Tue, 26 Feb 2019 19:41:21 +0000 (19:41 +0000)]
[Re-landing] Add some randomness into the StructureID.
https://bugs.webkit.org/show_bug.cgi?id=194989
<rdar://problem/47975563>

Reviewed by Yusuke Suzuki.

1. On 64-bit, the StructureID will now be encoded as:

    ----------------------------------------------------------------
    | 1 Nuke Bit | 24 StructureIDTable index bits | 7 entropy bits |
    ----------------------------------------------------------------

   The entropy bits are chosen at random and assigned when a StructureID is
   allocated.

2. Instead of Structure pointers, the StructureIDTable will now contain
   encodedStructureBits, which is encoded as such:

    ----------------------------------------------------------------
    | 7 entropy bits |                   57 structure pointer bits |
    ----------------------------------------------------------------

   The entropy bits here are the same 7 bits used in the encoding of the
   StructureID for this structure entry in the StructureIDTable.

3. Retrieval of the structure pointer given a StructureID is now computed as
   follows:

        index = structureID >> 7; // with arithmetic shift.
        encodedStructureBits = structureIDTable[index];
        structure = encodedStructureBits ^ (structureID << 57);

    We use an arithmetic shift for the right shift because that will preserve
    the nuke bit in the high bit of the index if the StructureID was not
    decontaminated before use as expected.

4. Remove unused function loadArgumentWithSpecificClass() in SpecializedThunkJIT.

5. Define StructureIDTable::m_size to be the number of allocated StructureIDs
   instead of always being the same as m_capacity.

6. Change StructureIDTable::s_unusedID's value to 0.

   Its previous value of unusedPointer i.e. 0xd1e7beef, does not make sense for
   StructureID on 64-bit.  Also, there was never any code that initializes unused
   IDs to the s_unusedID.  The only meaningful value for s_unusedID is 0, which
   is the ID we'll get when the freelist is empty, prompting a resize of the
   structureIDTable.

This patch appears to be perf neutral on JetStream 2 run via the cli on a
11" MacBook Air, 13" MacBook Pro, iPhone 6S, and iPhone XR.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::loadStructure):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitLoadStructure):
* jit/AssemblyHelpers.h:
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::loadArgumentWithSpecificClass): Deleted.
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/StructureIDTable.cpp:
(JSC::StructureIDTable::StructureIDTable):
(JSC::StructureIDTable::makeFreeListFromRange):
(JSC::StructureIDTable::resize):
(JSC::StructureIDTable::allocateID):
(JSC::StructureIDTable::deallocateID):
* runtime/StructureIDTable.h:
(JSC::StructureIDTable::decode):
(JSC::StructureIDTable::encode):
(JSC::StructureIDTable::get):
(JSC::StructureIDTable::isValid):

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

6 months agoUnreviewed, rolling out r241970.
commit-queue@webkit.org [Tue, 26 Feb 2019 19:23:11 +0000 (19:23 +0000)]
Unreviewed, rolling out r241970.
https://bugs.webkit.org/show_bug.cgi?id=195057

made the QuickLook.LegacyQuickLookContent API test flakey
(Requested by estes on #webkit).

Reverted changeset:

"[iOS] Break a reference cycle between PreviewLoader and
ResourceLoader"
https://bugs.webkit.org/show_bug.cgi?id=194964
https://trac.webkit.org/changeset/241970

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

6 months ago[ContentChangeObserver] Simplify content observation API by removing explicit DOMTime...
zalan@apple.com [Tue, 26 Feb 2019 18:37:09 +0000 (18:37 +0000)]
[ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
https://bugs.webkit.org/show_bug.cgi?id=195023
<rdar://problem/48381885>

Reviewed by Tim Horton.

Source/WebCore:

In the future we might decide that certain activities don't require DOMTimer observation, but that should
be internal to ContentChangeObserver.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):

Source/WebKit:

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

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

6 months ago[ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to...
zalan@apple.com [Tue, 26 Feb 2019 18:28:42 +0000 (18:28 +0000)]
[ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=195032
<rdar://problem/48388063>

Reviewed by Tim Horton.

This might eventually turn into a regular start/stop content observing call.

* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingStyleResolve):
(WebCore::ContentChangeObserver::stopObservingStyleResolve):

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

6 months ago[Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
commit-queue@webkit.org [Tue, 26 Feb 2019 18:24:41 +0000 (18:24 +0000)]
[Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
https://bugs.webkit.org/show_bug.cgi?id=191652

Patch by Takashi Komori <Takashi.Komori@sony.com> on 2019-02-26
Reviewed by Alex Christensen.

Source/WebKit:

Test: http/tests/security/401-logout/401-logout.php

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
* NetworkProcess/curl/NetworkDataTaskCurl.h:

Tools:

Fix WinCairo MiniBrowser behavior of authentication dialog.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::didReceiveAuthenticationChallenge):

LayoutTests:

Added appropriate expected results for WebKit/WebKitLegacy of WinCairo port.

* platform/wincairo-wk1/http/tests/security/401-logout/401-logout-expected.txt: Added.
* platform/wincairo/TestExpectations:
* platform/wincairo/http/tests/security/401-logout/401-logout-expected.txt: Added.

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

6 months ago[ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
zalan@apple.com [Tue, 26 Feb 2019 18:20:33 +0000 (18:20 +0000)]
[ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195035
<rdar://problem/48389123>

Reviewed by Tim Horton.

Visibility checking logic belongs to ContentChangeObserver.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::elementImplicitVisibility):
(WebCore::ContentChangeObserver::StyleChange::StyleChange):
(WebCore::ContentChangeObserver::StyleChange::~StyleChange):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::elementImplicitVisibility): Deleted.
(WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.

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

6 months agoSplit tests programmatic-scroll-iframe and scroll-iframe
commit-queue@webkit.org [Tue, 26 Feb 2019 18:14:45 +0000 (18:14 +0000)]
Split tests programmatic-scroll-iframe and scroll-iframe
https://bugs.webkit.org/show_bug.cgi?id=195050

This patch splits some iOS frame scrolling tests into separate tests in order to make debugging
and test expectations easier to manage.

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

* fast/scrolling/ios/programmatic-scroll-iframe-001-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-001.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-002-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-002.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-003-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-003.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-004-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-004.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-005-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-005.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-006-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-006.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-007-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-007.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-008-expected.html: Copied from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-008.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe-009-expected.html: Renamed from LayoutTests/fast/scrolling/ios/programmatic-scroll-iframe-expected.html.
* fast/scrolling/ios/programmatic-scroll-iframe-009.html: Added.
* fast/scrolling/ios/programmatic-scroll-iframe.html: Removed.
* fast/scrolling/ios/scroll-iframe-001-expected.html: Added.
* fast/scrolling/ios/scroll-iframe-001.html: Added.
* fast/scrolling/ios/scroll-iframe-002-expected.html: Added.
* fast/scrolling/ios/scroll-iframe-002.html: Added.
* fast/scrolling/ios/scroll-iframe-003-expected.html: Added.
* fast/scrolling/ios/scroll-iframe-003.html: Added.
* fast/scrolling/ios/scroll-iframe-004-expected.html: Added.
* fast/scrolling/ios/scroll-iframe-004.html: Added.
* fast/scrolling/ios/scroll-iframe-expected.html: Removed.
* fast/scrolling/ios/scroll-iframe.html: Removed.

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

6 months agoWebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the...
youenn@apple.com [Tue, 26 Feb 2019 18:09:19 +0000 (18:09 +0000)]
WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
https://bugs.webkit.org/show_bug.cgi?id=195028
<rdar://problem/48243733>

Reviewed by Eric Carlson.

Source/WebKit:

Covered by API test.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

6 months agoVersioning.
kocsen_chung@apple.com [Tue, 26 Feb 2019 18:01:57 +0000 (18:01 +0000)]
Versioning.

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

6 months agoUnreviewed, rolling out r242071.
ryanhaddad@apple.com [Tue, 26 Feb 2019 17:13:14 +0000 (17:13 +0000)]
Unreviewed, rolling out r242071.

Breaks internal builds.

Reverted changeset:

"Add some randomness into the StructureID."
https://bugs.webkit.org/show_bug.cgi?id=194989
https://trac.webkit.org/changeset/242071

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

6 months agoSynchronize MathML WPT tests
commit-queue@webkit.org [Tue, 26 Feb 2019 16:28:39 +0000 (16:28 +0000)]
Synchronize MathML WPT tests
https://bugs.webkit.org/show_bug.cgi?id=195048

This imports changes to the documentation and spec references for MathML.
It also imports a new test for href currently disabled due to bug 187039.

Patch by Frederic Wang <fwang@igalia.com> on 2019-02-26
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

* web-platform-tests/mathml/README.md:
* web-platform-tests/mathml/presentation-markup/fractions/frac-1.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-bar-001.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-001.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-002.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-001.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-002.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-003.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-mrow-001.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-numalign-denomalign-001.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-visibility-001.html:
* web-platform-tests/mathml/presentation-markup/operators/mo-axis-height-1.html:
* web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-2.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-3.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-4.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-5.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-2.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-4.html:
* web-platform-tests/mathml/presentation-markup/spaces/space-1.html:
* web-platform-tests/mathml/presentation-markup/spaces/space-2.html:
* web-platform-tests/mathml/presentation-markup/tables/table-axis-height.html:
* web-platform-tests/mathml/relations/css-styling/color-1.html:
* web-platform-tests/mathml/relations/css-styling/display-1.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-1.html:
* web-platform-tests/mathml/relations/css-styling/lengths-1.html:
* web-platform-tests/mathml/relations/css-styling/lengths-2.html:
* web-platform-tests/mathml/relations/css-styling/lengths-3.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-fraktur.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-sans-serif.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold-script.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-bold.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-double-struck.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-fraktur.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-initial.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-looped.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-monospace.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-sans-serif-bold-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-sans-serif-italic.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-sans-serif.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-script.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-stretched.html:
* web-platform-tests/mathml/relations/css-styling/mathvariant-tailed.html:
* web-platform-tests/mathml/relations/css-styling/visibility-1.html:
* web-platform-tests/mathml/relations/html5-tree/class-1.html:
* web-platform-tests/mathml/relations/html5-tree/class-2.html:
* web-platform-tests/mathml/relations/html5-tree/color-attributes-1.html:
* web-platform-tests/mathml/relations/html5-tree/display-1.html:
* web-platform-tests/mathml/relations/html5-tree/dynamic-1.html:
* web-platform-tests/mathml/relations/html5-tree/href-click-1.html:
* web-platform-tests/mathml/relations/html5-tree/href-click-2.html:
* web-platform-tests/mathml/relations/html5-tree/href-click-3.html: Added.
* web-platform-tests/mathml/relations/html5-tree/integration-point-1.html:
* web-platform-tests/mathml/relations/html5-tree/integration-point-2.html:
* web-platform-tests/mathml/relations/html5-tree/integration-point-3.html:
* web-platform-tests/mathml/relations/html5-tree/required-extensions-1.html:
* web-platform-tests/mathml/relations/html5-tree/required-extensions-2.html:
* web-platform-tests/mathml/relations/html5-tree/unique-identifier-1.html:
* web-platform-tests/mathml/relations/html5-tree/unique-identifier-2.html:
* web-platform-tests/mathml/relations/html5-tree/unique-identifier-3.html:
* web-platform-tests/mathml/relations/html5-tree/w3c-import.log:
* web-platform-tests/mathml/relations/text-and-math/use-typo-metrics-1.html:
* web-platform-tests/mathml/tools/mathvariant-transforms.py:
* web-platform-tests/mathml/tools/utils/w3c-import.log:

LayoutTests:

* TestExpectations: Disable the new href test since testdriver.js is not supported.

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

6 months agoExport MathML fraction tests to WPT
fred.wang@free.fr [Tue, 26 Feb 2019 15:29:40 +0000 (15:29 +0000)]
Export MathML fraction tests to WPT
https://bugs.webkit.org/show_bug.cgi?id=194436

LayoutTests/imported/w3c:

This is just an import of the current MathML WPT tests. It includes fraction tests from
WebKit that were exported in [1]. Some test results have whitespace change, due to [2].

[1] https://github.com/web-platform-tests/wpt/pull/15301
[2] https://github.com/web-platform-tests/wpt/commit/e2dd57c3f273468b3c6a087978c531dcd00933de

Patch by Frederic Wang <fwang@igalia.com> on 2019-02-26
Reviewed by Manuel Rego Casasnovas.

* resources/resource-files.json:
* web-platform-tests/mathml/META.yml: Added.
* web-platform-tests/mathml/OWNERS: Removed.
* web-platform-tests/mathml/README.md:
* web-platform-tests/mathml/presentation-markup/fractions/frac-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/fractions/frac-1.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-bar-001-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-bar-001.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-001-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-001-notref.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-001.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-002-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-color-002.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-001-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-001.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-002-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-002.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-003-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-003-notref.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-003.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-mrow-001-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-mrow-001.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-numalign-denomalign-001-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-numalign-denomalign-001.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt:
* web-platform-tests/mathml/presentation-markup/fractions/frac-parameters-2.html:
* web-platform-tests/mathml/presentation-markup/fractions/frac-visibility-001-expected.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/frac-visibility-001.html: Added.
* web-platform-tests/mathml/presentation-markup/fractions/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/operators/mo-axis-height-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/operators/mo-axis-height-1.html:
* web-platform-tests/mathml/presentation-markup/operators/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/radicals/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-2.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-3.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-4.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-5.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-1.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-2-expected.txt:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-2.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3-expected.txt:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3.html:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-4-expected.txt:
* web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-4.html:
* web-platform-tests/mathml/presentation-markup/scripts/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/spaces/space-1-expected.txt:
* web-platform-tests/mathml/presentation-markup/spaces/space-1.html:
* web-platform-tests/mathml/presentation-markup/spaces/space-2.html:
* web-platform-tests/mathml/presentation-markup/spaces/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/tables/table-axis-height-expected.txt:
* web-platform-tests/mathml/presentation-markup/tables/table-axis-height.html:
* web-platform-tests/mathml/presentation-markup/tables/w3c-import.log:
* web-platform-tests/mathml/relations/css-styling/display-1.html:
* web-platform-tests/mathml/relations/css-styling/displaystyle-1-expected.txt:
* web-platform-tests/mathml/relations/css-styling/displaystyle-1.html:
* web-platform-tests/mathml/relations/css-styling/lengths-3-expected.txt:
* web-platform-tests/mathml/relations/css-styling/lengths-3.html:
* web-platform-tests/mathml/relations/css-styling/w3c-import.log:
* web-platform-tests/mathml/relations/html5-tree/class-2.html:
* web-platform-tests/mathml/relations/html5-tree/display-1-expected.txt:
* web-platform-tests/mathml/relations/html5-tree/display-1.html:
* web-platform-tests/mathml/relations/html5-tree/href-click-1.html:
* web-platform-tests/mathml/relations/html5-tree/href-click-2.html:
* web-platform-tests/mathml/relations/html5-tree/unique-identifier-2.html:
* web-platform-tests/mathml/relations/html5-tree/w3c-import.log:
* web-platform-tests/mathml/relations/text-and-math/w3c-import.log:
* web-platform-tests/mathml/tools/utils/w3c-import.log:
* web-platform-tests/mathml/tools/w3c-import.log:
* web-platform-tests/mathml/w3c-import.log:

LayoutTests:

We removed some fraction tests that have equivalent WPT tests.
Some of them were actually exported from WebKit to WPT in [1]
We also move tests for crashes/asserts/hangs to the top mathml/ directory.

[1] https://github.com/web-platform-tests/wpt/pull/15301

Patch by Frederic Wang <fwang@igalia.com> on 2019-02-26
Reviewed by Manuel Rego Casasnovas.

* mathml/fractions-invalid-expected.html: Moved to parent directory.
* mathml/fractions-invalid.html: Ditto.
* mathml/mfrac-nested-expected.txt: Ditto.
* mathml/mfrac-nested.html:  Ditto.
* mathml/presentation/fractions-box-expected.html: Removed. This is better tested by WPT
tests frac-parameters-1.html, frac-parameters-2.html, frac-1.html.
* mathml/presentation/fractions-box.html: Removed. Ditto.
* mathml/presentation/fractions-color-expected-mismatch.html: Removed. This is exported as
frac-color-001.html.
* mathml/presentation/fractions-color.html: Removed. Ditto.
* mathml/presentation/fractions-linethickness-expected.html: Removed. Covered by WPT tests
frac-linethickness-*.html.
* mathml/presentation/fractions-linethickness.html: Removed. Ditto.
* mathml/presentation/mfrac-linethickness1-expected-mismatch.html: Removed. Ditto.
* mathml/presentation/mfrac-linethickness1.html: Removed. Ditto.
* mathml/presentation/mfrac-linethickness2-expected.html: Removed. Ditto.
* mathml/presentation/mfrac-linethickness2.html: Removed. Ditto.
* mathml/presentation/mfrac-linethickness3-expected-mismatch.html: Removed. Ditto.
* mathml/presentation/mfrac-linethickness3.html: Removed. Ditto.
* mathml/presentation/fractions-mrow-expected.html: Removed. Exported as frac-mrow-001.html.
* mathml/presentation/fractions-mrow.html: Removed. Ditto.
* mathml/presentation/fractions-numalign-denomalign-expected.html: Removed. Exported as
frac-numalign-denomalign-001.html.
* mathml/presentation/fractions-numalign-denomalign.html: Removed. Ditto.
* mathml/presentation/fractions-vertical-alignment-expected.html: Removed. This is better
tests by WPT tests frac-parameters-1.html, frac-parameters-2.html, frac-1.html.
* mathml/presentation/fractions-vertical-alignment.html: Removed. Ditto.

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

6 months ago[EGL] Runtime support for RGB565 pixel layout
philn@webkit.org [Tue, 26 Feb 2019 15:11:29 +0000 (15:11 +0000)]
[EGL] Runtime support for RGB565 pixel layout
https://bugs.webkit.org/show_bug.cgi?id=194817

Reviewed by Carlos Garcia Campos.

Currently our graphics pipeline always relies on a ARGB8888 (32
bpp) pixel configuration. On some low-end (old) embedded platforms
the graphics driver is sometimes optimized for 16 bpp
configurations, such as RGB565. On those platforms the application
can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
"RGB565" to adjust to the best pixel configuration supported by
the screen and graphics driver.

* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig):

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