WebKit-https.git
10 months ago[WebGPU] Replace forward declare of WebGPUCommandBuffer with include
justin_fan@apple.com [Thu, 29 Nov 2018 23:18:38 +0000 (23:18 +0000)]
[WebGPU] Replace forward declare of WebGPUCommandBuffer with include
https://bugs.webkit.org/show_bug.cgi?id=192179

Unreviewed build fix.

No new tests. No behavior change.

* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:

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

10 months ago[ContentObservation] Make WKSetObservedContentChange logic more explicit.
zalan@apple.com [Thu, 29 Nov 2018 23:08:21 +0000 (23:08 +0000)]
[ContentObservation] Make WKSetObservedContentChange logic more explicit.
https://bugs.webkit.org/show_bug.cgi?id=192183

Reviewed by Simon Fraser.

* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
(WebThreadRemoveObservedDOMTimer):

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

10 months agoCSS subresource loads should not be observable from resource timing if the stylesheet...
youenn@apple.com [Thu, 29 Nov 2018 23:06:43 +0000 (23:06 +0000)]
CSS subresource loads should not be observable from resource timing if the stylesheet is opaque
https://bugs.webkit.org/show_bug.cgi?id=192132

Reviewed by Ryosuke Niwa.

Source/WebCore:

Introduce a new ResourceLoaderOptions to determine whether a load is made from a resource that is opaque.
Make use of that option to disable exposing such loads to the web page through resource timing.
The same option might later be used to bypass service workers.

Make use of this option for CSS subresource loads.
When the CSS stylesheet is opaque for the page, set this option.

Test: http/tests/security/clean-origin-exposed-resource-timing.html
      http/tests/security/cross-origin-resource-timing.html

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue):
(WebCore::CSSCursorImageValue::loadImage):
* css/CSSCursorImageValue.h:
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::cachedFont):
* css/CSSFontFaceSrcValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue):
(WebCore::CSSImageSetValue::loadBestFitImage):
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::CSSImageValue):
(WebCore::CSSImageValue::loadImage):
* css/CSSImageValue.h:
* css/CSSStyleSheet.h:
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::setCSSStyleSheet):
(WebCore::StyleRuleImport::requestStyleSheet):
* css/StyleSheetContents.h:
* css/parser/CSSParserContext.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor):
(WebCore::consumeFontFaceSrcURI):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectStyleForPresentationAttribute):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute):
* loader/ResourceLoaderOptions.h:
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::srcValue const):

LayoutTests:

* http/tests/security/clean-origin-css-exposed-resource-timing-expected.txt: Added.
* http/tests/security/clean-origin-css-exposed-resource-timinge-timing.html: Added.
* http/tests/security/cross-origin-css-resource-timing-expected.txt: Added.
* http/tests/security/cross-origin-css-resource-timing.html: Added.
* http/tests/security/resources/loading-subresources.css: Added.
* http/tests/security/resources/imported-loading-subresources.css: Added.

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

10 months agoMove Lookup Code for better cross platform usage
megan_gardner@apple.com [Thu, 29 Nov 2018 22:59:07 +0000 (22:59 +0000)]
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732

Reviewed by Alex Christensen.

Source/WebCore:

Not currenlty testable

DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.

* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):

Source/WebCore/PAL:

* pal/spi/mac/LookupSPI.h:
* pal/spi/mac/RevealSPI.h:

Source/WebKit:

Lookup is being replaced by Reveal. This framework should work on all platforms.
The patch moves the code that we expect will be needed for all platforms to the more
general cocoa area. This patch changes no funcationality, and should not change
anything currently. This work will be build on later when Reveal is ready to support
multiple platforms.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _lookupGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
(WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.

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

10 months ago[Cocoa] Move ServerTimingParser.* into a better group in the Xcode project
commit-queue@webkit.org [Thu, 29 Nov 2018 22:56:04 +0000 (22:56 +0000)]
[Cocoa] Move ServerTimingParser.* into a better group in the Xcode project
https://bugs.webkit.org/show_bug.cgi?id=192180

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-11-29
Reviewed by Simon Fraser.

* WebCore.xcodeproj/project.pbxproj:

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

10 months ago[ContentObservation] DOMTimer::install should explicitly check if timer observation...
zalan@apple.com [Thu, 29 Nov 2018 22:22:15 +0000 (22:22 +0000)]
[ContentObservation] DOMTimer::install should explicitly check if timer observation is on
https://bugs.webkit.org/show_bug.cgi?id=192181

Reviewed by Simon Fraser.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
* platform/ios/wak/WKContentObservation.cpp:
(WKIsObservingDOMTimerScheduling):
* platform/ios/wak/WKContentObservation.h:

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

10 months agowebkitpy: Unify device creation
jbedard@apple.com [Thu, 29 Nov 2018 21:58:30 +0000 (21:58 +0000)]
webkitpy: Unify device creation
https://bugs.webkit.org/show_bug.cgi?id=192158
<rdar://problem/46344757>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/port/device_port.py:
(DevicePort):
(DevicePort.setup_test_run): Use DEVICE_MANAGER to create devices based on the specified device class.
* Scripts/webkitpy/port/ios.py:
(IOSPort): Add DEFAULT_DEVICE_CLASS.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort):
(IOSDevicePort._create_devices): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort._create_devices): Deleted.
* Scripts/webkitpy/port/watch.py:
(WatchPort): Add DEFAULT_DEVICE_CLASS.
* Scripts/webkitpy/port/watch_device.py:
(WatchDevicePort):
(WatchDevicePort._create_devices): Deleted.
* Scripts/webkitpy/port/watch_simulator.py:
(WatchSimulatorPort._create_devices): Deleted.
* Scripts/webkitpy/xcode/device_type_unittest.py:
(DeviceTypeTest.test_from_string): Test that DeviceTypes without hardware types can be constructed
from strings.

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

10 months agoExecuting "insertunorderedlist" while selecting a contenteditable element inside...
rniwa@webkit.org [Thu, 29 Nov 2018 21:50:43 +0000 (21:50 +0000)]
Executing "insertunorderedlist" while selecting a contenteditable element inside a shadow dom hangs the browser
https://bugs.webkit.org/show_bug.cgi?id=184049
<rdar://problem/38931033>

Reviewed by Antti Koivisto.

Source/WebCore:

The primary hung was caused by TextIterator::advance traversing the next node in the tree order using
NodeTraversal::next which doesn't take the composed tree into account. Fixed the bug by traversing
the composed tree while sharing code with StylizedMarkupAccumulator.

This revealed a second hang in InsertListCommand::doApply() caused by endingSelection() being null,
which was caused by CompositeEditCommand::moveParagraphs failing to restore the ending selection properly
because it was computing the text indices difference from the beginning of the document until the destination.

Fixed this second bug by computing the indices against the beginning of the root editable element.
Note that editability never crosses a shadow boundary.

Test: editing/execCommand/insert-unordered-list-in-shadow-tree.html

* dom/ComposedTreeIterator.h:
(WebCore::nextSkippingChildrenInComposedTreeIgnoringUserAgentShadow): Extracted out of nextSkippingChildren
in markup.cpp.
(WebCore::nextInComposedTreeIgnoringUserAgentShadow): Added.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Compute the index from the beginning of the root editable
element as opposed to the beginning of the document.
* editing/TextIterator.cpp:
(WebCore::nextNode): Added.
(WebCore::isDescendantOf): Added.
(WebCore::TextIterator::advance): Use the newly added functions to traverse the composed tree when the options
contains TextIteratorTraversesFlatTree.
* editing/markup.cpp:

LayoutTests:

Added a regression test for executing InsertUnorderedList inside a shadow tree.

* editing/execCommand/insert-ordered-list-in-shadow-tree-expected.txt: Added.
* editing/execCommand/insert-ordered-list-in-shadow-tree.html: Added.

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

10 months agoUpdate web-platform-tests/shadow-dom
rniwa@webkit.org [Thu, 29 Nov 2018 21:26:28 +0000 (21:26 +0000)]
Update web-platform-tests/shadow-dom
https://bugs.webkit.org/show_bug.cgi?id=192137

Reviewed by Antti Koivisto.

Re-imported the shadow DOM tests from wpt.

* resources/import-expectations.json:
* web-platform-tests/shadow-dom/ShadowRoot-interface.html:
* web-platform-tests/shadow-dom/event-dispatch-order.tentative-expected.txt: Added.
* web-platform-tests/shadow-dom/event-dispatch-order.tentative.html: Added.
* web-platform-tests/shadow-dom/input-type-radio-expected.txt: Added.
* web-platform-tests/shadow-dom/input-type-radio.html: Added.
* web-platform-tests/shadow-dom/resources/shadow-dom.js:
(dispatchEventWithLog):
(assert_event_path_equals):
* web-platform-tests/shadow-dom/slots-outside-shadow-dom-expected.txt: Added.
* web-platform-tests/shadow-dom/slots-outside-shadow-dom.html: Added.
* web-platform-tests/shadow-dom/w3c-import.log:

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

10 months ago[ContentObservation] Decouple content change and DOM timer scheduling observation
zalan@apple.com [Thu, 29 Nov 2018 21:25:29 +0000 (21:25 +0000)]
[ContentObservation] Decouple content change and DOM timer scheduling observation
https://bugs.webkit.org/show_bug.cgi?id=192170

Reviewed by Simon Fraser.

Source/WebCore:

This is in preparation for adding style recalc scheduling observation (the main goal here is to simplify the indeterminate change logic).

* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingContentChanges):
(WKStopObservingContentChanges):
(WKStartObservingDOMTimerSchedules):
(WKStopObservingDOMTimerSchedules):
(WKSetObservedContentChange):
(WebThreadAddObservedDOMTimer):
(WKBeginObservingContentChanges): Deleted.
* platform/ios/wak/WKContentObservation.h:

Source/WebKit:

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

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

10 months agoMake reconcileViewportConstrainedLayerPositions start from a specified scrolling...
commit-queue@webkit.org [Thu, 29 Nov 2018 21:22:02 +0000 (21:22 +0000)]
Make reconcileViewportConstrainedLayerPositions start from a specified scrolling node
https://bugs.webkit.org/show_bug.cgi?id=180002

Patch by Frederic Wang <fwang@igalia.com> on 2018-11-29
Reviewed by Simon Fraser.

For non-programmatic scrolling of frames, AsyncScrollingCoordinator::reconcileScrollingState
currently always call reconcileViewportConstrainedLayerPositions for the main frame
since async subframe scrolling is not supported yet (bug 171667 and bug 149264). This
function in turn calls reconcileLayerPositionForViewportRect on the whole scrolling tree to
readjust position of fixed/sticky descendants. This patch refactors a bit the code so that
the operation is actually only applied to the descendants of the frame's scrolling node,
which would mean a small optimization when subframe are asynchronously scrollable. The code
is already covered by reconcile-layer-position-recursive.html.

No new tests, behavior unchanged and already covered by existing tests.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState): Pass the frame's scrolling
node id.
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Start
reconciliation from the specified scrolling node and log its ID.
* page/scrolling/AsyncScrollingCoordinator.h: Add ScrollingNodeID parameter.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Ditto.

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

10 months agoRename *ObservedContentModifier(s) to *ObservedDOMTimer(s)
zalan@apple.com [Thu, 29 Nov 2018 21:13:10 +0000 (21:13 +0000)]
Rename *ObservedContentModifier(s) to *ObservedDOMTimer(s)
https://bugs.webkit.org/show_bug.cgi?id=192168

Reviewed by Simon Fraser.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* platform/ios/wak/WKContentObservation.cpp:
(WKBeginObservingContentChanges):
(WKSetObservedContentChange):
(WebThreadGetObservedDOMTimers):
(WebThreadCountOfObservedDOMTimers):
(WebThreadClearObservedDOMTimers):
(WebThreadContainsObservedDOMTimer):
(WebThreadAddObservedDOMTimer):
(WebThreadRemoveObservedDOMTimer):
(WebThreadCountOfObservedContentModifiers): Deleted.
(WebThreadClearObservedContentModifiers): Deleted.
(WebThreadContainsObservedContentModifier): Deleted.
(WebThreadAddObservedContentModifier): Deleted.
(WebThreadRemoveObservedContentModifier): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:

Source/WebKitLegacy/ios:

There's only one type of content modifier (DOMTimer).

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

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

10 months ago[iOS] Tell AirPlay picker when a file has video
eric.carlson@apple.com [Thu, 29 Nov 2018 21:11:40 +0000 (21:11 +0000)]
[iOS] Tell AirPlay picker when a file has video
https://bugs.webkit.org/show_bug.cgi?id=192155
Source/WebCore/PAL:

Reviewed by Jer Noble.

* pal/spi/ios/MediaPlayerSPI.h:

Source/WebKit:

<rdar://problem/43843865>

Reviewed by Jer Noble.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
Add hasVideo parameter.

* UIProcess/ios/forms/WKAirPlayRoutePicker.h:
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add
hasVideo parameter, pass info to MPMediaControlsViewController.
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted.

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

10 months ago[WebGPU] WebGPURenderPassEncoder::setPipeline, draw, and endPass prototypes
justin_fan@apple.com [Thu, 29 Nov 2018 21:09:08 +0000 (21:09 +0000)]
[WebGPU] WebGPURenderPassEncoder::setPipeline, draw, and endPass prototypes
https://bugs.webkit.org/show_bug.cgi?id=192134

Reviewed by Dean Jackson.

Source/WebCore:

Wrap up prototype features for WebGPURenderPassEncoder.

Test: webgpu/render-command-encoding.html

* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
(WebCore::WebGPUProgrammablePassEncoder::endPass): Returns a reference to the WebGPUCommandBuffer that created this encoder.
(WebCore::WebGPUProgrammablePassEncoder::setPipeline):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Updated to support endPass and setPipeline.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create): Must be provided with the WebGPUCommandBuffer.
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::draw):
* Modules/webgpu/WebGPURenderPassEncoder.h: Updated to cache a reference to the WebGPUCommandBuffer, and for draw.
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h:
(WebCore::WebGPURenderPipeline::renderPipeline):
* Modules/webgpu/WebGPUTexture.cpp:
* Modules/webgpu/WebGPUTexture.h: Replaced include with forward declaration.
* platform/graphics/gpu/GPUProgrammablePassEncoder.h: Updated to support new WebGPU_PassEncoder functionality.
* platform/graphics/gpu/GPURenderPassEncoder.h:
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): Now ends encoding on the MTLCommandEncoder, if not already ended, before freeing it.
* platform/graphics/gpu/GPURenderPipeline.h: Now remembers the GPUPrimitiveTopology that it was created with.
(WebCore::GPURenderPipeline::primitiveTopology const):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::endPass): Calls endEncoding on the backing MTLCommandEncoder, if not already ended.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::setPipeline): Added.
(WebCore::primitiveTypeForGPUPrimitiveTopology): Added. Helper function to convert GPUPrimitiveTopology to MTLPrimitiveType.
(WebCore::GPURenderPassEncoder::draw): Added. Draws using primitive topology specified during pipeline creation.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline): Now must store the GPURenderPipelineDescriptor for later reference.

LayoutTests:

Updating the basic rendering test with more commands, and a prototype WPT-based test for WebGPURenderCommandEncoder's
new functionality.

* webgpu/js/basic-webgpu-functions.js:
(render):
* webgpu/render-command-encoding-expected.txt: Added.
* webgpu/render-command-encoding.html: Added.
* webgpu/render-passes.html:

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

10 months agoCSS Painting API should pass 'this' correctly to paint callback, and repaint when...
justin_michaud@apple.com [Thu, 29 Nov 2018 21:01:15 +0000 (21:01 +0000)]
CSS Painting API should pass 'this' correctly to paint callback, and repaint when properties change.
https://bugs.webkit.org/show_bug.cgi?id=191443

Reviewed by Dean Jackson.

Source/JavaScriptCore:

Export the simpler construct() method for use in WebCore.

* runtime/ConstructData.h:

Source/WebCore:

Instantiate a new instance of the paint class, and pass it as 'this' object when the paint callback is called.
Also, this patch makes sure that custom paint elements get repainted when properties that they care about get changed.
Finally, we fix two reference cycles that caused WorkletGlobalScope to never be destroyed.

Tests: fast/css-custom-paint/animate-repaint.html
       fast/css-custom-paint/animate.html

* bindings/js/JSDOMWrapper.cpp:
* bindings/js/JSPaintWorkletGlobalScopeCustom.cpp:
(WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
* bindings/js/JSWorkletGlobalScopeBase.cpp:
(WebCore::toJS):
* bindings/js/ScriptState.cpp:
(WebCore::execStateFromWorkletGlobalScope):
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* css/CSSPaintImageValue.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::vm):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCustomPaintWatchProperty):
(WebCore::RenderStyle::changeRequiresRepaint const):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* testing/Internals.cpp:
(WebCore::Internals::isAnyWorkletGlobalScopeAlive const):
* testing/Internals.h:
* testing/Internals.idl:
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::devicePixelRatio const):
(WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition):
(WebCore::PaintWorkletGlobalScope::registerPaint):
* worklets/PaintWorkletGlobalScope.h:
(WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
(WebCore::WorkletGlobalScope::~WorkletGlobalScope):
(WebCore::WorkletGlobalScope::prepareForDestruction):
(WebCore::WorkletGlobalScope::allWorkletGlobalScopesSet):
(WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
(WebCore::WorkletGlobalScope::logExceptionToConsole):
(WebCore::WorkletGlobalScope::addConsoleMessage):
(WebCore::WorkletGlobalScope::addMessage):
* worklets/WorkletGlobalScope.h:
(WebCore::WorkletGlobalScope::script):
(WebCore::WorkletGlobalScope::responsibleDocument):
(WebCore::WorkletGlobalScope::responsibleDocument const):
(WebCore::WorkletGlobalScope::identifier const): Deleted.
(WebCore::WorkletGlobalScope::responsableDocument): Deleted.
(WebCore::WorkletGlobalScope::responsableDocument const): Deleted.
* worklets/WorkletScriptController.cpp:
(WebCore::WorkletScriptController::~WorkletScriptController):
(WebCore::WorkletScriptController::disableEval):
(WebCore::WorkletScriptController::disableWebAssembly):
(WebCore::WorkletScriptController::initScript):

LayoutTests:

* fast/css-custom-paint/animate-expected.html: Added.
* fast/css-custom-paint/animate-repaint-expected.txt: Added.
* fast/css-custom-paint/animate-repaint.html: Added.
* fast/css-custom-paint/animate.html: Added.
* fast/css-custom-paint/constructor-expected.html: Added.
* fast/css-custom-paint/constructor.html: Added.
* fast/css-custom-paint/leaks-expected.txt: Added.
* fast/css-custom-paint/leaks.html: Added.
* fast/css-custom-paint/properties.html:
* fast/css-custom-paint/resources/leaks-frame.html: Added.
* platform/mac/fast/css-custom-paint/raf-leak-expected.txt: Added.

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

10 months agoModernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
ap@apple.com [Thu, 29 Nov 2018 20:52:46 +0000 (20:52 +0000)]
Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
https://bugs.webkit.org/show_bug.cgi?id=192041

Reviewed by Tim Horton.

Source/WebCore:

* loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options.
There is a lot of code that needs to be cleaned up here.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):

Source/WTF:

* wtf/Platform.h:

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

10 months agoEWS iOS-sim bots sometimes fails to shutdown simulator
jbedard@apple.com [Thu, 29 Nov 2018 20:42:58 +0000 (20:42 +0000)]
EWS iOS-sim bots sometimes fails to shutdown simulator
https://bugs.webkit.org/show_bug.cgi?id=191864

Reviewed by Aakash Jain.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDevice._shut_down): Increase time to wait for simulated device to
shut down, ignore exit code indicating a device is already shut down.

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

10 months agoUpdating a service worker during a navigation load sometimes makes the load fail
youenn@apple.com [Thu, 29 Nov 2018 20:10:53 +0000 (20:10 +0000)]
Updating a service worker during a navigation load sometimes makes the load fail
https://bugs.webkit.org/show_bug.cgi?id=191986
<rdar://problem/46259790>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/resources/trickle.py: Added.
(main):
* web-platform-tests/service-workers/service-worker/resources/update-fetch-worker.py: Added.
(main):
* web-platform-tests/service-workers/service-worker/update-on-navigation.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/update-on-navigation.https.html: Added.

Source/WebCore:

Previously, we were registering a document as service worker client at creation of the document.
According the service worker spec, this should be done when handling the fetch event of the corresponding navigation load.
This ensures that the service worker will have a client and will not get updated in the middle of the navigation load.

At navigation load start, we do not have a document yet since it is created when receiving the first bytes.
Instead, we register a temporary document when starting the navigation load and unregister it when the real document is registered.

Test: imported/w3c/web-platform-tests/service-workers/service-worker/update-on-navigation.https.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::loadMainResource):
(WebCore::DocumentLoader::clearMainResource):
* loader/DocumentLoader.h:

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

10 months agoUnreviewed, rolling out r238678.
ryanhaddad@apple.com [Thu, 29 Nov 2018 20:09:08 +0000 (20:09 +0000)]
Unreviewed, rolling out r238678.

Breaks internal builds.

Reverted changeset:

"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238678

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

10 months agoAddressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
commit-queue@webkit.org [Thu, 29 Nov 2018 19:59:43 +0000 (19:59 +0000)]
Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
https://bugs.webkit.org/show_bug.cgi?id=192099

Patch by Suresh Koppisetty <skoppisetty@apple.com> on 2018-11-29
Reviewed by Geoffrey Garen.

[NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication].

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

10 months agoA sender created through addTransceiver and populated using addTrack should have...
youenn@apple.com [Thu, 29 Nov 2018 19:54:40 +0000 (19:54 +0000)]
A sender created through addTransceiver and populated using addTrack should have its source set
https://bugs.webkit.org/show_bug.cgi?id=192136

Reviewed by Eric Carlson.

Source/WebCore:

In case libwebrtc backend is already created, we need to make sure to
set the track source to the libwebrtc sender backend that is actually
tied to the sender.

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:

LayoutTests:

* webrtc/video-replace-track-expected.txt:
* webrtc/video-replace-track.html:

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

10 months agoUnreviewed test gardening, skip three datalist tests that are marked as flaky crashes.
ryanhaddad@apple.com [Thu, 29 Nov 2018 19:00:55 +0000 (19:00 +0000)]
Unreviewed test gardening, skip three datalist tests that are marked as flaky crashes.

* TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

10 months agoMove Lookup Code for better cross platform usage
megan_gardner@apple.com [Thu, 29 Nov 2018 18:54:19 +0000 (18:54 +0000)]
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732

Reviewed by Alex Christensen.

Source/WebCore:

Not currenlty testable

DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.

* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):

Source/WebCore/PAL:

* pal/spi/mac/LookupSPI.h:
* pal/spi/mac/RevealSPI.h:

Source/WebKit:

Lookup is being replaced by Reveal. This framework should work on all platforms.
The patch moves the code that we expect will be needed for all platforms to the more
general cocoa area. This patch changes no funcationality, and should not change
anything currently. This work will be build on later when Reveal is ready to support
multiple platforms.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _lookupGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
(WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.

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

10 months agoIndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store
sihui_liu@apple.com [Thu, 29 Nov 2018 18:45:17 +0000 (18:45 +0000)]
IndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store
https://bugs.webkit.org/show_bug.cgi?id=185869
<rdar://problem/40453623>

Reviewed by Geoffrey Garen.

Source/WebCore:

lexicalGlobalObject is casted to JSDOMGlobalObject in CloneSerializer::dumpArrayBufferView,
so we should use JSDOMGlobalObject instead of JSGlobalObject in IDB database thread.

Covered by modified test: storage/indexeddb/objectstore-autoincrement.html

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::create):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWrapper.cpp:
(WebCore::JSDOMObject::JSDOMObject):

LayoutTests:

* storage/indexeddb/objectstore-autoincrement-expected.txt:
* storage/indexeddb/objectstore-autoincrement-private-expected.txt:
* storage/indexeddb/resources/objectstore-autoincrement.js:
(getLincolnAfterInjectedKeySuccess):
(putBobSuccess):
(getBobSuccess):
(addLincolnWithExplicitKeySuccess):
(putAbrahamSuccess):

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

10 months agoUnexpected constructor / instanceof behavior when retrieving indexedDB data in an...
sihui_liu@apple.com [Thu, 29 Nov 2018 18:41:48 +0000 (18:41 +0000)]
Unexpected constructor / instanceof  behavior when retrieving indexedDB data in an iframe
https://bugs.webkit.org/show_bug.cgi?id=185906
<rdar://problem/40583100>

Reviewed by Geoffrey Garen.

Source/WebCore:

ScriptExecutionContext::execState() returned state of main frame, so deserialization of
IDBValue in iframe used constructors of main frame, which is wrong.

Test: storage/indexeddb/instanceof-iframe.html

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::execState):

LayoutTests:

* storage/indexeddb/instanceof-iframe-expected.txt: Added.
* storage/indexeddb/instanceof-iframe.html: Added.
* storage/indexeddb/resources/instanceof-iframe.js: Added.
(test.else.shouldBe):
(test.else.shouldBeTrue):
(test.else.shouldBeFalse):
(test.else.evalAndLog):
(test):
(callback):

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

10 months agoMake generic ScrollAnimator
don.olmstead@sony.com [Thu, 29 Nov 2018 18:36:29 +0000 (18:36 +0000)]
Make generic ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=192128

Reviewed by Michael Catanzaro.

No new tests. No change in behavior.

Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used
by other implementations. Fixed some compilation issues around using
this as a default implementation.

Removing ScrollAnimatorSmooth since it is dead code and doesn't even
compile at this time.

Fixing a compilation issue within LowPowerModeNotifierGLib
implementation that appeared due to unified sources changes.

* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/LowPowerModeNotifier.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::swipeVelocity const):
* platform/ScrollAnimatorSmooth.cpp: Removed.
* platform/ScrollAnimatorSmooth.h: Removed.
* platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp.
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric):
(WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation):
(WebCore::ScrollAnimatorGeneric::scroll):
(WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorGeneric::computeVelocity):
(WebCore::ScrollAnimatorGeneric::handleWheelEvent):
(WebCore::ScrollAnimatorGeneric::willEndLiveResize):
(WebCore::ScrollAnimatorGeneric::updatePosition):
(WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity):
(WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGeneric::showOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea):
(WebCore::ScrollAnimatorGeneric::mouseExitedContentArea):
(WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea):
(WebCore::ScrollAnimatorGeneric::contentAreaDidShow):
(WebCore::ScrollAnimatorGeneric::contentAreaDidHide):
(WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden):
* platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h.
* platform/glib/LowPowerModeNotifierGLib.cpp:
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::swipeVelocity const): Deleted.

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

10 months agoFactor out configuration of the file upload image picker
conrad_shultz@apple.com [Thu, 29 Nov 2018 18:26:46 +0000 (18:26 +0000)]
Factor out configuration of the file upload image picker
https://bugs.webkit.org/show_bug.cgi?id=192138
<rdar://problem/46334871>

Reviewed by Tim Horton.

By factoring configuration of the picker into its own method, it makes it easier
to apply custom configuration in subclasses in the future.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
(-[WKFileUploadPanel _configureImagePicker:]):

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

10 months ago[ES Modules] Allow .mjs content when loaded from file://
dino@apple.com [Thu, 29 Nov 2018 18:26:44 +0000 (18:26 +0000)]
[ES Modules] Allow .mjs content when loaded from file://
https://bugs.webkit.org/show_bug.cgi?id=192100
<rdar://problem/46320065>

Reviewed by Sam Weinig.

Source/WebCore:

Node JS requires ES Module files to be identified by the file
extension of ".mjs" (no relation to Maciej Stachowiak). This new
extension causes issues because it isn't recognised as a JavaScript
file. When using the script tag, the author is able to force the type
of the referenced file using an attribute, but this isn't possible
for the import() function or import statement.

Add a new entry into our table that maps file extensions to MIME types
so that when a .mjs file is loaded from a file:// reference it is
identified as JavaScript.

Test: js/dom/modules/import-mjs-module.html

* platform/network/mac/WebCoreURLResponse.mm: Add .mjs to the existing dictionary.
(WebCore::createExtensionToMIMETypeMap):
* platform/network/ios/WebCoreURLResponseIOS.mm: Add code just for .mjs.
(WebCore::createExtensionToMIMETypeMap):

Source/WebInspectorUI:

Add a mapping from .mjs to application/javascript.

* UserInterface/Base/MIMETypeUtilities.js:
(WI.mimeTypeForFileExtension):

LayoutTests:

Test for both import() function and the import statement loading
from .mjs files.

* js/dom/modules/import-mjs-module-expected.txt: Added.
* js/dom/modules/import-mjs-module.html: Added.
* js/dom/modules/resources/module-simple-A.mjs: Added.
* js/dom/modules/resources/module-simple-B.mjs: Added.
* platform/win/TestExpectations: Skip this on Windows. Just wait for Windows
  to recognise the extension.

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

10 months agowebkitpy: Unify ios_version/watchos_version code
jbedard@apple.com [Thu, 29 Nov 2018 18:00:14 +0000 (18:00 +0000)]
webkitpy: Unify ios_version/watchos_version code
https://bugs.webkit.org/show_bug.cgi?id=192153
<rdar://problem/46343642>

Reviewed by Lucas Forschler.

Treating watchOS and iOS versions differently makes it harder to share code between the similar ports.

* Scripts/webkitpy/port/device_port.py:
(DevicePort):
(DevicePort.device_version): Added.
* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path): Use device_version() instead of ios_version().
(IOSPort.ios_version): Deleted.
* Scripts/webkitpy/port/ios_device.py:
(IOSDevicePort.device_version): Renamed from ios_version().
(IOSDevicePort.ios_version): Deleted.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.device_version): Renamed from ios_version().
(IOSSimulatorPort.default_child_processes.booted_ios_devices_filter): Use device_version() instead of ios_version().
(IOSSimulatorPort._create_devices): Ditto.
(IOSSimulatorPort.check_sys_deps): Ditto.
(IOSSimulatorPort.ios_version): Deleted.
* Scripts/webkitpy/port/watch.py:
(WatchPort.default_baseline_search_path): Use device_version() instead of watchos_version().
(WatchPort.watchos_version): Deleted.
* Scripts/webkitpy/port/watch_device.py:
(WatchDevicePort.device_version): Renamed from watchos_version().
(WatchDevicePort.watchos_version): Deleted.
* Scripts/webkitpy/port/watch_simulator.py:
(WatchSimulatorPort.device_version): Renamed from watchos_version().
(WatchSimulatorPort.default_child_processes.filter_booted_watchos_devices): Use device_version() instead of watchos_version().
(WatchSimulatorPort._create_devices): Ditto.
(WatchSimulatorPort.check_sys_deps): Ditto.
(WatchSimulatorPort.watchos_version): Deleted.

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

10 months agoWeb Inspector: Elements: selecting more than one DOM node causes the scope highlight...
mattbaker@apple.com [Thu, 29 Nov 2018 17:50:21 +0000 (17:50 +0000)]
Web Inspector: Elements: selecting more than one DOM node causes the scope highlight to contrast
https://bugs.webkit.org/show_bug.cgi?id=192118
<rdar://problem/46325664>

Reviewed by Devin Rousso.

Use an alpha blended border for the "selected" DOM scope highlight,
matching the "hovered" scope highlight.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li.selected + ol.children.expanded):

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

10 months agoGardening: skip test that newly times out on Armv7
guijemont@igalia.com [Thu, 29 Nov 2018 16:41:23 +0000 (16:41 +0000)]
Gardening: skip test that newly times out on Armv7

Unreviewed Test Gardening.

* js/slow-stress/script-tests/marsaglia.js: skip on arm/linux

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

10 months agoUnreviewed GTK+ gardening after r238665.
magomez@igalia.com [Thu, 29 Nov 2018 16:02:32 +0000 (16:02 +0000)]
Unreviewed GTK+ gardening after r238665.

* platform/gtk/TestExpectations:

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

10 months ago[LFC][BFC][Quirk] Width does not need stretching quirk.
zalan@apple.com [Thu, 29 Nov 2018 15:30:27 +0000 (15:30 +0000)]
[LFC][BFC][Quirk] Width does not need stretching quirk.
https://bugs.webkit.org/show_bug.cgi?id=192135

Reviewed by Antti Koivisto.

In BFC the block box's width (auto) always streches to the content width of the containing block.

* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::needsStretching):
(WebCore::Layout::BlockFormattingContext::Quirks::isStretchedToInitialContainingBlock): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedWidth): Deleted.

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

10 months ago[LFC][Quirk] Move quirk functions to dedicated classes.
zalan@apple.com [Thu, 29 Nov 2018 15:28:20 +0000 (15:28 +0000)]
[LFC][Quirk] Move quirk functions to dedicated classes.
https://bugs.webkit.org/show_bug.cgi?id=192133

Reviewed by Antti Koivisto.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::initialContainingBlock): Deleted.
(WebCore::Layout::isStretchedToInitialContainingBlock): Deleted.
(WebCore::Layout::stretchHeightToInitialContainingBlockQuirk): Deleted.
(WebCore::Layout::stretchWidthToInitialContainingBlock): Deleted.
* layout/blockformatting/BlockFormattingState.cpp:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
(WebCore::Layout::isQuirkContainer): Deleted.
(WebCore::Layout::hasMarginTopQuirkValue): Deleted.
(WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): Deleted.
(WebCore::Layout::isMarginTopCollapsedWithParent): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
* layout/inlineformatting/text/TextUtil.h:

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

10 months agoRemove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
commit-queue@webkit.org [Thu, 29 Nov 2018 12:34:26 +0000 (12:34 +0000)]
Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=192076

Patch by Rob Buis <rbuis@igalia.com> on 2018-11-29
Reviewed by Frédéric Wang.

Since we do an early return if the protocol is not http or ws, the if check
for ws protocol and else statement are not needed, so use an ASSERT instead.

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):

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

10 months agoAdd ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
commit-queue@webkit.org [Thu, 29 Nov 2018 11:44:50 +0000 (11:44 +0000)]
Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
https://bugs.webkit.org/show_bug.cgi?id=172914

Patch by Frederic Wang <fwang@igalia.com> on 2018-11-29
Reviewed by Simon Fraser.

This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and
the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is
unchanged. In the future, this rect will be used for hit testing of subframes during
asynchronous macOS scrolling (but 172917).

No new tests, behavior unchanged.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):

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

10 months agoImport fetch/api/cors tests
commit-queue@webkit.org [Thu, 29 Nov 2018 10:30:29 +0000 (10:30 +0000)]
Import fetch/api/cors tests
https://bugs.webkit.org/show_bug.cgi?id=192092

Patch by Rob Buis <rbuis@igalia.com> on 2018-11-29
Reviewed by Frédéric Wang.

Import to most recent checkout since some old
tests like cors-multiple-origins.js were incorrect.

* resources/import-expectations.json:
* web-platform-tests/fetch/api/cors/cors-expose-star-worker.html: Removed.
* web-platform-tests/fetch/api/cors/cors-expose-star.html: Removed.
* web-platform-tests/fetch/api/cors/cors-expose-star.sub.any-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-expose-star-expected.txt.
* web-platform-tests/fetch/api/cors/cors-expose-star.sub.any.html: Added.
* web-platform-tests/fetch/api/cors/cors-expose-star.sub.any.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-expose-star.js.
(sharedHeaders.string_appeared_here.promise_test):
(string_appeared_here.promise_test):
* web-platform-tests/fetch/api/cors/cors-expose-star.sub.any.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-expose-star-worker-expected.txt.
* web-platform-tests/fetch/api/cors/cors-expose-star.sub.any.worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-worker.html: Removed.
* web-platform-tests/fetch/api/cors/cors-filtering.html: Removed.
* web-platform-tests/fetch/api/cors/cors-filtering.sub.any-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-expected.txt.
* web-platform-tests/fetch/api/cors/cors-filtering.sub.any.html: Added.
* web-platform-tests/fetch/api/cors/cors-filtering.sub.any.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering.js.
(corsFilter):
(corsExposeFilter):
* web-platform-tests/fetch/api/cors/cors-filtering.sub.any.worker-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt.
* web-platform-tests/fetch/api/cors/cors-filtering.sub.any.worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt: Removed.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html: Removed.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.html: Removed.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.js: Removed.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.sub.any-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.sub.any.html: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.sub.any.js: Added.
(corsMultipleOrigins):
* web-platform-tests/fetch/api/cors/cors-multiple-origins.sub.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.sub.any.worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-not-cors-safelisted.any-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-not-cors-safelisted.any.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-not-cors-safelisted.any.js: Added.
(runTests):
* web-platform-tests/fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight.any.js:
(headerNames): Deleted.
(): Deleted.
(corsPreflight): Deleted.
* web-platform-tests/fetch/api/cors/resources/corspreflight.js: Copied from LayoutTests/imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight.any.js.
(headerNames):
(corsPreflight):
* web-platform-tests/fetch/api/cors/resources/not-cors-safelisted.json: Added.
* web-platform-tests/fetch/api/cors/resources/w3c-import.log: Added.
* web-platform-tests/fetch/api/cors/sandboxed-iframe-expected.txt: Added.
* web-platform-tests/fetch/api/cors/sandboxed-iframe.html: Added.
* web-platform-tests/fetch/api/cors/w3c-import.log:

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

10 months ago[GTK][WPE] Fix BubblewrapLauncher clang warnings
tpopela@redhat.com [Thu, 29 Nov 2018 10:19:56 +0000 (10:19 +0000)]
[GTK][WPE] Fix BubblewrapLauncher clang warnings
https://bugs.webkit.org/show_bug.cgi?id=192086

Reviewed by Michael Catanzaro.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindPathVar): Initialize the i variable to 0.
(WebKit::setupSeccomp): Initialize the optional datum_b member.

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

10 months ago[WebDriver] Fix clang warnings in Session.cpp
tpopela@redhat.com [Thu, 29 Nov 2018 09:14:12 +0000 (09:14 +0000)]
[WebDriver] Fix clang warnings in Session.cpp
https://bugs.webkit.org/show_bug.cgi?id=192077

Reviewed by Carlos Garcia Campos.

* Session.cpp:
(WebDriver::Session::dismissAndNotifyAlert):
(WebDriver::Session::acceptAndNotifyAlert):
(WebDriver::Session::reportUnexpectedAlertOpen):
(WebDriver::Session::getCurrentURL):
(WebDriver::Session::getTitle):
(WebDriver::Session::getWindowHandle):
(WebDriver::Session::getWindowHandles):
(WebDriver::Session::getToplevelBrowsingContextRect):
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::getElementRect):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::getElementProperty):
(WebDriver::Session::getElementCSSValue):
(WebDriver::Session::selectOptionElement):
(WebDriver::Session::elementClick):
(WebDriver::Session::elementClear):
(WebDriver::Session::handleScriptResult):
(WebDriver::Session::performMouseInteraction):
(WebDriver::Session::performKeyboardInteractions):
(WebDriver::Session::getAllCookies):
(WebDriver::Session::getNamedCookie):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
(WebDriver::Session::performActions):
(WebDriver::Session::releaseActions):
(WebDriver::Session::dismissAlert):
(WebDriver::Session::acceptAlert):
(WebDriver::Session::getAlertText):
(WebDriver::Session::sendAlertText):
(WebDriver::Session::takeScreenshot):
* WebDriverService.cpp:
(WebDriver::WebDriverService::deleteSession):

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

10 months ago[iOSMac] Dropping text selections from web content into editable elements crashes...
wenson_hsieh@apple.com [Thu, 29 Nov 2018 05:25:07 +0000 (05:25 +0000)]
[iOSMac] Dropping text selections from web content into editable elements crashes the web process
https://bugs.webkit.org/show_bug.cgi?id=192113
<rdar://problem/46323701>

Reviewed by Ryosuke Niwa.

Source/WebCore:

In iOSMac, registering invalid UTIs on NSItemProvider when starting a drag or handling a drop does not work.
Since iOS writes and reads only "Apple Web Archive pasteboard type" (a.k.a. `WebArchivePboardType`) during drag
and drop as well as copy and paste, we fail to read or write any web archive data, and subsequently fall back to
reading RTF or flat RTFD, both of which are not supported in iOSMac, since UIFoundation links against the
system's macOS WebKit stack.

To fix this, we add support for reading and writing com.apple.webarchive (`kUTTypeWebArchive`) on iOS, so that
WebKit-based iOSMac applications can understand web archive data from the host running macOS, and the host can
also understand web archive data written by the iOSMac app. Additionally, don't allow reading RTF and flat RTFD
as web content in iOSMac. (Note that writing RTF and flat RTFD is still safe, since it does not depend on
UIFoundation.framework but rather `WebCore::HTMLConverter`).

Test: DragAndDropTests.ModernWebArchiveType

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment):

Additionally make sure that we never call into UIFoundation's NSAttributedString to markup conversion codepath
by making `createFragment` an empty stub on iOSMac.

* platform/ios/PasteboardIOS.mm:
(WebCore::supportedImageTypes):
(WebCore::isTypeAllowedByReadingPolicy):
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::Pasteboard::supportedWebContentPasteboardTypes):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

Tools:

Add a test to verify that, when dropping an item with both "com.apple.webarchive" and "public.utf8-plain-text"
representations, the higher fidelity web archive data is used when handling the drop.

* TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:

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

10 months agoWeb Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
joepeck@webkit.org [Thu, 29 Nov 2018 04:39:45 +0000 (04:39 +0000)]
Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
https://bugs.webkit.org/show_bug.cgi?id=192016
<rdar://problem/46284417>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WI.loaded):
(WI.initializeBackendTarget):
(WI.contentLoaded):
(WI.whenTargetsAvailable):
Don't evaluate any InspectorFrontendAPI commands until the frontend
has initialized a main target and the user interface.

Source/WebKit:

Previously calling the Page's inspectorController.show()
would create a frontend connection on the WebProcess side.
However now the frontend connection is handed to the WebProcess
once the UIProcess creates it. So queue actions that take place
immediately after showing the inspector until we have a frontend
to send the actions to.

* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::setFrontendConnection):
(WebKit::WebInspector::closeFrontendConnection):
(WebKit::WebInspector::whenFrontendConnectionEstablished):
(WebKit::WebInspector::showConsole):
(WebKit::WebInspector::showResources):
(WebKit::WebInspector::showTimelines):
(WebKit::WebInspector::showMainResourceForFrame):
(WebKit::WebInspector::startPageProfiling):
(WebKit::WebInspector::stopPageProfiling):
(WebKit::WebInspector::startElementSelection):
(WebKit::WebInspector::stopElementSelection):

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

10 months agoConsult dummy storage for HTTPS Upgrade, Apply If Appropriate
commit-queue@webkit.org [Thu, 29 Nov 2018 04:14:02 +0000 (04:14 +0000)]
Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
https://bugs.webkit.org/show_bug.cgi?id=192094
<rdar://problem/45851103> HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate

Patch by Vivek Seth <v_seth@apple.com> on 2018-11-28
Reviewed by Chris Dumez.

For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded):
(WebKit::NetworkLoadChecker::checkRequest):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):

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

10 months agoREGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
simon.fraser@apple.com [Thu, 29 Nov 2018 03:54:32 +0000 (03:54 +0000)]
REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
https://bugs.webkit.org/show_bug.cgi?id=192127
rdar://problem/44194179

Reviewed by Tim Horton.

_restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
web process, and unconditionally called .value() even though it may not be engaged.

No repro steps known, so no testcase.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):

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

10 months agoUnreviewed, rolling out r238653 and r238656.
commit-queue@webkit.org [Thu, 29 Nov 2018 02:55:59 +0000 (02:55 +0000)]
Unreviewed, rolling out r238653 and r238656.
https://bugs.webkit.org/show_bug.cgi?id=192130

Breaks iOS build (Requested by smfr on #webkit).

Reverted changesets:

"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238653

"Attempt to fix the iOS build by only including RevealSPI.h
when it's needed."
https://trac.webkit.org/changeset/238656

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

10 months agoAttempt to fix the iOS build by only including RevealSPI.h when it's needed.
simon.fraser@apple.com [Thu, 29 Nov 2018 02:25:16 +0000 (02:25 +0000)]
Attempt to fix the iOS build by only including RevealSPI.h when it's needed.

* editing/cocoa/DictionaryLookup.mm:

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

10 months agoModernize BlobRegistry::writeBlobsToTemporaryFiles
achristensen@apple.com [Thu, 29 Nov 2018 02:19:54 +0000 (02:19 +0000)]
Modernize BlobRegistry::writeBlobsToTemporaryFiles
https://bugs.webkit.org/show_bug.cgi?id=192117

Reviewed by Dean Jackson.

Source/WebCore:

No change in behavior.  Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging
and manual completion handler management.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
* platform/network/BlobRegistryImpl.h:

Source/WebKit:

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
(WebKit::NetworkBlobRegistry::writeBlobToFilePath):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::writeBlobToFilePath):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::sendWithAsyncReply):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::writeBlobToFilePath):
(WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/FileAPI/BlobRegistryProxy.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
(WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:

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

10 months agoMove loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreat...
achristensen@apple.com [Thu, 29 Nov 2018 02:18:37 +0000 (02:18 +0000)]
Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters
https://bugs.webkit.org/show_bug.cgi?id=192122

Reviewed by Dean Jackson.

This is part of an effort to reduce global variables in the NetworkProcess.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
(WebKit::NetworkLoad::didReceiveResponse):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::loadThrottleLatency const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::loadThrottleLatency const):
* NetworkProcess/NetworkSessionCreationParameters.cpp: Added.
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::encode const): Deleted.
(WebKit::NetworkSessionCreationParameters::decode): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* Shared/WebsiteDataStoreParameters.cpp:
(WebKit::WebsiteDataStoreParameters::privateSessionParameters):
* Sources.txt:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* WebKit.xcodeproj/project.pbxproj:

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

10 months agoMove Lookup Code for better cross platform usage
megan_gardner@apple.com [Thu, 29 Nov 2018 01:41:15 +0000 (01:41 +0000)]
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732

Reviewed by Alex Christensen.

Source/WebCore:

Not currenlty testable

DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.

* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):

Source/WebCore/PAL:

* pal/spi/mac/LookupSPI.h:
* pal/spi/mac/RevealSPI.h:

Source/WebKit:

Lookup is being replaced by Reveal. This framework should work on all platforms.
The patch moves the code that we expect will be needed for all platforms to the more
general cocoa area. This patch changes no funcationality, and should not change
anything currently. This work will be build on later when Reveal is ready to support
multiple platforms.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation):
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView _lookupGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::dictionaryPopupInfoForRange):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
(WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
(WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
(WebKit::WebPage::performDictionaryLookupForRange): Deleted.

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

10 months agoSQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint...
chris.reid@sony.com [Thu, 29 Nov 2018 01:39:21 +0000 (01:39 +0000)]
SQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint: database table is locked" errors
https://bugs.webkit.org/show_bug.cgi?id=192111

Reviewed by Alex Christensen.

Ensure the journal_mode=WAL statement is finalized before wal_checkpoint is executed.

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):

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

10 months agoUpdating href on linearGradient and radialGradient doesn't update its rendering
commit-queue@webkit.org [Thu, 29 Nov 2018 01:29:54 +0000 (01:29 +0000)]
Updating href on linearGradient and radialGradient doesn't update its rendering
https://bugs.webkit.org/show_bug.cgi?id=191934

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-11-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

Mark the gradient renderer for repaint when the value of the 'href'
attribute changes.

Tests: fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html
       fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html
       svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html
       svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html

* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged):

LayoutTests:

* fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html: Added.
* fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html: Added.
* svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop-expected.html: Added.
* svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html: Added.
* svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop-expected.html: Added.
* svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html: Added.

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

10 months agoENABLE_SEPARATED_WX_HEAP needs to be defined in Platform.h.
mark.lam@apple.com [Thu, 29 Nov 2018 01:22:19 +0000 (01:22 +0000)]
ENABLE_SEPARATED_WX_HEAP needs to be defined in Platform.h.
https://bugs.webkit.org/show_bug.cgi?id=192110
<rdar://problem/46317746>

Reviewed by Saam Barati.

Source/JavaScriptCore:

* config.h:

Source/WTF:

Contrary my previous claim in r238564, ENABLE_SEPARATED_WX_HEAP needs to be
defined in Platform.h because it is also needed in WebCore for the CSS JIT.  Also
contrary to my previous claim, ENABLE(FAST_JIT_PERMISSIONS) is defined for WebCore
(and other projects) as well as JSC.  Hence, there's no reason why
ENABLE_SEPARATED_WX_HEAP cannot be defined in Platform.h.

* wtf/Platform.h:

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

10 months agoWeb Inspector: Styles: enable selection of multiple properties by default
nvasilyev@apple.com [Thu, 29 Nov 2018 01:11:10 +0000 (01:11 +0000)]
Web Inspector: Styles: enable selection of multiple properties by default
https://bugs.webkit.org/show_bug.cgi?id=192109
<rdar://problem/46323565>

Reviewed by Devin Rousso.

* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
Remove the checkbox.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property):
(.spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)):
(.spreadsheet-style-declaration-editor .property.selected):
(.spreadsheet-style-declaration-editor .property.selected:focus):
(.multiple-properties-selection .spreadsheet-style-declaration-editor .property): Deleted.
(.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)): Deleted.
(.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected): Deleted.
(.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus): Deleted.
Remove `.multiple-properties-selection` class.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField):
(WI.SpreadsheetTextField.prototype._handleFocus): Deleted.

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

10 months agoWeb Inspector: Audit: empty results folder is shown after clearing filters
drousso@apple.com [Thu, 29 Nov 2018 00:09:51 +0000 (00:09 +0000)]
Web Inspector: Audit: empty results folder is shown after clearing filters
https://bugs.webkit.org/show_bug.cgi?id=192106

Reviewed by Matt Baker.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Added.

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

10 months ago[ews-app] Fetch bugs from Bugzilla and submit to Buildbot
aakash_jain@apple.com [Wed, 28 Nov 2018 22:19:56 +0000 (22:19 +0000)]
[ews-app] Fetch bugs from Bugzilla and submit to Buildbot
https://bugs.webkit.org/show_bug.cgi?id=191947

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/fetcher.py: Added.

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

10 months ago[ Mojave WK1 ] Layout Test fast/images/animated-image-different-dest-size.html fast...
tsavell@apple.com [Wed, 28 Nov 2018 22:18:28 +0000 (22:18 +0000)]
[ Mojave WK1 ] Layout Test fast/images/animated-image-different-dest-size.html fast/images/animated-image-loop-count.html is failing
https://bugs.webkit.org/show_bug.cgi?id=190383

Unreviewed Test Gardening.

* platform/mac-wk1/TestExpectations:

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

10 months agoimported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html...
youenn@apple.com [Wed, 28 Nov 2018 22:12:32 +0000 (22:12 +0000)]
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html is flaky on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=192037

Reviewed by Eric Carlson.

The stats report JS map should be created when resolving the stats promise with WebCore RTCStatsReport.
But resolving the promise might fail in case of a page being suspended.
In that case, no JSRTCStatsReport is created and there is no backing map.
Update the code to reflect that.
Covered by existing test.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h:

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

10 months agoFix iOS API test after r238585
achristensen@apple.com [Wed, 28 Nov 2018 22:12:22 +0000 (22:12 +0000)]
Fix iOS API test after r238585
https://bugs.webkit.org/show_bug.cgi?id=192022

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):
On iOS, a safe browsing warning over a WKWebView with frame of {0, 0, 0, 0} has a size of {0, 0}, which is fine.
The test was added to catch a bug on Mac platforms, so testing it only on Mac will catch any regression.

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

10 months ago[ews-app] Configure python logging
aakash_jain@apple.com [Wed, 28 Nov 2018 22:11:37 +0000 (22:11 +0000)]
[ews-app] Configure python logging
https://bugs.webkit.org/show_bug.cgi?id=192005

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/__init__.py: Configured logging.

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

10 months agoUpdate generate-{derived,unified}-sources scripts to support generating .xcfilelist...
krollin@apple.com [Wed, 28 Nov 2018 22:09:52 +0000 (22:09 +0000)]
Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192031
<rdar://problem/46286816>

Reviewed by Alex Christensen.

The Generate Derived Sources and Generate Unified Sources build phases
in Xcode need to have their inputs and outputs specified. This
specification will come in the form of .xcfilelist files that will be
attached to these build phases. There is one .xcfilelist file that
lists the input file and one that lists the output files. As part of
this work, the various generate-{derived,unified}-sources scripts that
are executed in these Generate build phases are modified to help in
the creation of these .xcfilelist files. In particular, they can now
be invoked with command-line parameters. These parameters are then
used to alter the normal execution of these scripts, causing them to
produce the .xcfilelist files as opposed to actually generating the
files that are listed in those files.

Source/JavaScriptCore:

* Scripts/generate-derived-sources.sh:
* Scripts/generate-unified-sources.sh:

Source/WebCore:

No new tests -- no changed functionality.

* Scripts/generate-derived-sources.sh:
* Scripts/generate-unified-sources.sh:

Source/WebKit:

* Scripts/generate-derived-sources.sh:
* Scripts/generate-unified-sources.sh:

Tools:

* DumpRenderTree/Scripts/generate-derived-sources.sh:
* WebKitTestRunner/Scripts/generate-derived-sources.sh:

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

10 months agoUpdate generate-unified-source-bundles.rb to generate .xcfilelist files
krollin@apple.com [Wed, 28 Nov 2018 22:07:45 +0000 (22:07 +0000)]
Update generate-unified-source-bundles.rb to generate .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192029
<rdar://problem/46285918>

Reviewed by Alex Christensen.

Update generate-unified-source-bundles.rb to generate output for
.xcfilelist files. These files are used to indicate the sets of input
and output files to Run Script build phases in Xcode. By invoking
generate-unified-source-bundles.rb with -generate-xcfilelists, the
script generates these .xcfilelist files. These .xcfilelist files can
then be used to specify the inputs and outputs of the Generate Unified
Sources build phases.

* Scripts/generate-unified-source-bundles.rb:

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

10 months agoRevert print_all_generated_files work in r238008; tighten up target specifications
krollin@apple.com [Wed, 28 Nov 2018 22:07:20 +0000 (22:07 +0000)]
Revert print_all_generated_files work in r238008; tighten up target specifications
https://bugs.webkit.org/show_bug.cgi?id=192025
<rdar://problem/46284301>

Reviewed by Alex Christensen.

In r238008, I added a facility for DerivedSources.make makefiles to
print out the list of files that they generate. This output was used
in the generation of .xcfilelist files used to specify the output of
the associated Generate Derived Sources build phases in Xcode. This
approach worked, but it meant that people would need to follow a
specific convention to keep this mechanism working.

Instead of continuing this approach, I'm going to implement a new
facility based on the output of `make` when passed the -d flag (which
prints dependency information). This new mechanism is completely
automatic and doesn't need maintainers to follow a convention. To that
end, remove most of the work performed in r238008 that supports the
print_all_generated_files target.

At the same time, it's important for the sets of targets and their
dependencies to be complete and correct. Therefore, also include
changes to bring those up-to-date. As part of that, you'll see
prevalent use of a particular technique. Here's an example:

    BYTECODE_FILES = \
        Bytecodes.h \
        BytecodeIndices.h \
        BytecodeStructs.h \
        InitBytecodes.asm \
    #
    BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))

    all : $(BYTECODE_FILES)

    $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
        ...

These lines indicate a set of generated files (those specified in
BYTECODE_FILES). These files are generated by the BytecodeList.rb
tool. But, as opposed to the normal rule where a single foo.output is
generated by foo.input plus some additional dependencies, this rule
produces multiple output files from a tool whose connection to the
output files is not immediately clear. A special approach is needed
where a single rule produces multiple output files. The normal way to
implement this is to use an .INTERMEDIATE target. However, we used
this approach in the past and ran into a problem with it, addressing
it with an alternate approach in r210507. The above example shows this
approach. The .'s in the list of target files are replaced with %'s,
and the result is used as the left side of the dependency rule.

Source/JavaScriptCore:

* DerivedSources.make:

Source/WebCore:

No new tests -- no changed functionality.

* DerivedSources.make:

Source/WebKit:

* DerivedSources.make:

Tools:

* DumpRenderTree/DerivedSources.make:
* WebKitTestRunner/DerivedSources.make:

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

10 months ago[ews-app] Add support to get list of Bugzilla patches needing review
aakash_jain@apple.com [Wed, 28 Nov 2018 21:59:51 +0000 (21:59 +0000)]
[ews-app] Add support to get list of Bugzilla patches needing review
https://bugs.webkit.org/show_bug.cgi?id=191942

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/common/bugzilla.py:
(Bugzilla.get_list_of_patches_needing_reviews): Get list of patches needing review.
(BugzillaBeautifulSoup.fetch_attachment_ids_from_review_queue): Copied from Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
(BugzillaBeautifulSoup._load_query): Ditto.
(BugzillaBeautifulSoup._parse_attachment_ids_request_query): Ditto.

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

10 months ago[iOS] Page not defocused when Find-in-page becomes first responder
dbates@webkit.org [Wed, 28 Nov 2018 21:55:13 +0000 (21:55 +0000)]
[iOS] Page not defocused when Find-in-page becomes first responder
https://bugs.webkit.org/show_bug.cgi?id=192084
<rdar://problem/46146777>

Reviewed by Tim Horton.

Source/WebKit:

When -becomeFirstResponder and -resignFirstResponder is called the page should become focused
and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has
focus. This includes decisions about whether to allow an element to be focused. We need to
ensure that WebKit knows whether the web view is focused for it to make good decisions.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and
hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard
input.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view
becomes focused.
(-[WKContentView resignFirstResponderForWebView]): Update activity state when the view
becomes defocused.

Tools:

Add tests for both Mac and iOS to ensure that when finding a string on the page
that we do not start an input session if a match is found in an <input> and the
WKWebView is not the first responder.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewFindString.mm: Added.
(-[WKWebViewFindStringInputDelegate _webView:didStartInputSession:]):
(-[WKWebViewFindStringFindDelegate findString]):
(-[WKWebViewFindStringFindDelegate _webView:didCountMatches:forString:]):
(-[WKWebViewFindStringFindDelegate _webView:didFindMatches:forString:withMatchIndex:]):
(-[WKWebViewFindStringFindDelegate _webView:didFailToFindString:]):
(returnNo):
(returnYes):
(viewIsFirstResponder):
(TestWebKitAPI::TEST):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::PlatformWebView): Make the view the first responder before the
window key. This matches the ordering used in PlatformWebView::focus(). No behavior change.

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

10 months ago[ews-app] Add BeautifulSoup
aakash_jain@apple.com [Wed, 28 Nov 2018 21:49:07 +0000 (21:49 +0000)]
[ews-app] Add BeautifulSoup
https://bugs.webkit.org/show_bug.cgi?id=191994

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/thirdparty: Added.
* BuildSlaveSupport/ews-app/ews/thirdparty/BeautifulSoup.py: Added.
* BuildSlaveSupport/ews-app/ews/thirdparty/__init__.py: Added.

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

10 months agoRemove dead code from an earlier attempt at implementing safe browsing
achristensen@apple.com [Wed, 28 Nov 2018 21:14:43 +0000 (21:14 +0000)]
Remove dead code from an earlier attempt at implementing safe browsing
https://bugs.webkit.org/show_bug.cgi?id=192067

Reviewed by Chris Dumez.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): Deleted.
(WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadArchive):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:
* loader/ShouldSkipSafeBrowsingCheck.h: Removed.

Source/WebKit:

* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebCoreSupport/WebFrameLoaderClient.h:

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

10 months agoAdd SessionIDs wherever BlobURLs are used in SerializedScriptValue
achristensen@apple.com [Wed, 28 Nov 2018 21:11:21 +0000 (21:11 +0000)]
Add SessionIDs wherever BlobURLs are used in SerializedScriptValue
https://bugs.webkit.org/show_bug.cgi?id=192062

Reviewed by Dean Jackson.

Just adding infrastructure for fixing "the blob bug"

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
(WebCore::IDBDatabaseIdentifier::sessionID const):
(WebCore::IDBDatabaseIdentifier::encode const):
(WebCore::IDBDatabaseIdentifier::decode):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::setAsIsolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::sessionID const):
(WebCore::IDBValue::encode const):
(WebCore::IDBValue::decode):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::currentData):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::sessionID const):

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

10 months ago[ews-app] Add support to download Patch from Bugzilla
aakash_jain@apple.com [Wed, 28 Nov 2018 21:09:34 +0000 (21:09 +0000)]
[ews-app] Add support to download Patch from Bugzilla
https://bugs.webkit.org/show_bug.cgi?id=191943

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/common/bugzilla.py: Added.
(Bugzilla.retrieve_attachment): Retreives the attachment from Bugzilla and saves to disk.
(Bugzilla._fetch_attachment_json):
(Bugzilla.file_path_for_patch):
* BuildSlaveSupport/ews-app/ews/common/util.py: Added.
(fetch_data_from_url): Method to fetch data from given url.
* BuildSlaveSupport/ews-app/ews/config.py:

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

10 months agoMove logCookieInformation bool from NetworkProcess to NetworkSession
achristensen@apple.com [Wed, 28 Nov 2018 21:09:09 +0000 (21:09 +0000)]
Move logCookieInformation bool from NetworkProcess to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=192049

Reviewed by Chris Dumez.

Part of an effort to remove globals in the NetworkProcess.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::sendResultForCacheEntry):
(WebKit::NetworkResourceLoader::shouldLogCookieInformation):
(WebKit::NetworkResourceLoader::logCookieInformation const):
(WebKit::logBlockedCookieInformation):
(WebKit::logCookieInformationInternal):
(WebKit::NetworkResourceLoader::logCookieInformation):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::logCookieInformation const):
* NetworkProcess/NetworkSessionCreationParameters.h:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):

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

10 months ago[WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPa...
justin_fan@apple.com [Wed, 28 Nov 2018 20:53:17 +0000 (20:53 +0000)]
[WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
https://bugs.webkit.org/show_bug.cgi?id=191990

Reviewed by Dean Jackson.

Source/WebCore:

Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder.
Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing
a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass().

Test: webgpu/render-passes.html

* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
(WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success.
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder.
* Modules/webgpu/WebGPURenderPassDescriptor.h:
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now.
* Modules/webgpu/WebGPURenderPassEncoder.cpp: Added.
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::passEncoder const):
* Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder.
* Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer.
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::WebGPUTextureView):
* Modules/webgpu/WebGPUTextureView.h:
(WebCore::WebGPUTextureView::texture):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::platformCommandBuffer const):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Added.
* platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder.
* platform/graphics/gpu/GPUTexture.h:
(WebCore::GPUTexture::platformTexture const):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added.
(WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails.
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception.
(WebCore::GPURenderPassEncoder::platformPassEncoder const):

LayoutTests:

Add tests to ensure proper WebGPURenderPassEncoder creation. To be updated as WebGPURenderPassDescriptor is updated.

* webgpu/js/basic-webgpu-functions.js:
(render):
* webgpu/render-passes-expected.txt: Added.
* webgpu/render-passes.html: Added.

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

10 months ago[XHR] Document.lastModified doesn't work for non-rendered documents
commit-queue@webkit.org [Wed, 28 Nov 2018 20:28:07 +0000 (20:28 +0000)]
[XHR] Document.lastModified doesn't work for non-rendered documents
https://bugs.webkit.org/show_bug.cgi?id=179375

Patch by Rob Buis <rbuis@igalia.com> on 2018-11-28
Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/responsexml-document-properties-expected.txt:

Source/WebCore:

Add setOverrideLastModified to override last modified date for
standalone Documents.

Behavior matches Firefox and Chrome.

Test: web-platform-tests/xhr/responsexml-document-properties.htm

* dom/Document.cpp:
(WebCore::Document::overrideLastModified):
(WebCore::Document::lastModified const): no need to test m_frame since that's already done in loader().
(WebCore::Document::lastModified): Deleted.
* dom/Document.h:
* xml/XMLHttpRequest.cpp:

LayoutTests:

Unskip responsexml-document-properties.htm since the dynamic message is gone.

* TestExpectations:
* platform/wpe/TestExpectations:

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

10 months ago[ews-app] Add methods to update Patch fields
aakash_jain@apple.com [Wed, 28 Nov 2018 20:12:00 +0000 (20:12 +0000)]
[ews-app] Add methods to update Patch fields
https://bugs.webkit.org/show_bug.cgi?id=191931

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/models/patch.py:
(Patch.set_sent_to_buildbot):
(Patch.set_bug_id):
(Patch.set_obsolete):

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

10 months agoWeb Inspector: Remove unused DataGrid and TreeOutline code
mattbaker@apple.com [Wed, 28 Nov 2018 19:47:01 +0000 (19:47 +0000)]
Web Inspector: Remove unused DataGrid and TreeOutline code
https://bugs.webkit.org/show_bug.cgi?id=191622
<rdar://problem/46052014>

Reviewed by Devin Rousso.

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.insertChildElement):

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline):
(WI.DOMTreeOutline.prototype.update):

* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.removeChildrenRecursive): Deleted.

* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.removeChildren):
(WI.DataGridNode.prototype.removeChildrenRecursive): Deleted.

* UserInterface/Views/ErrorObjectView.css:
(.error-object:not(.expanded) .content):
(.error-object .content):
(.error-object:not(.expanded) .tree-outline): Deleted.
(.error-object .tree-outline): Deleted.

* UserInterface/Views/ErrorObjectView.js:
(WI.ErrorObjectView):
(WI.ErrorObjectView.prototype.get treeOutline): Deleted.
Use a simple container since TreeOutline features aren't used,
and remove unused property `treeOutline`.

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

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.removeChildren):
(WI.TreeElement.prototype.removeChildrenRecursive): Deleted.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.removeChildrenRecursive): Deleted.
(WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted.
Removed `element` parameter now that the only use case has been removed.

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

10 months agoUnreviewed, rolling out r238620.
ryanhaddad@apple.com [Wed, 28 Nov 2018 19:05:21 +0000 (19:05 +0000)]
Unreviewed, rolling out r238620.

Broke internal builds again.

Reverted changeset:

"Remove @no-unify of InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp"
https://bugs.webkit.org/show_bug.cgi?id=191853
https://trac.webkit.org/changeset/238620

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

10 months ago[iOS Simulator Release WK2] media/no-fullscreen-when-hidden.html is flaky
fred.wang@free.fr [Wed, 28 Nov 2018 18:56:15 +0000 (18:56 +0000)]
[iOS Simulator Release WK2] media/no-fullscreen-when-hidden.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=192088

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2018-11-28

* platform/ios-wk2/TestExpectations: Mark media/no-fullscreen-when-hidden.html as flaky.

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

10 months agoAllow WebKit clients to specify a minimum effective width for layout.
commit-queue@webkit.org [Wed, 28 Nov 2018 18:50:23 +0000 (18:50 +0000)]
Allow WebKit clients to specify a minimum effective width for layout.
https://bugs.webkit.org/show_bug.cgi?id=191499
<rdar://problem/45362678>

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2018-11-28
Reviewed by Wenson Hsieh.

Source/WebCore:

If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
width. For clients that wish to lay out the content with a different width value, we would need to add a way
to specify the effective width for layout.

Tests: fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html
       fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize): Add a new argument effectiveWidth.
(WebCore::ViewportConfiguration::nativeWebpageParameters): Make sure minimumScale for nativeWebpageParameters
    is small enough so that it won't clamp out the initial scale. If content is wider than the viewport, this
    ensures we can still zoom out the page.
(WebCore::ViewportConfiguration::updateConfiguration): update _minimumEffectiveDeviceWidth and apply that to
    the layout size scale computation.
(WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor): A helper method to return the effective
    layout scale factor which is also effected by _minimumEffectiveDeviceWidth.
(WebCore::ViewportConfiguration::updateMinimumLayoutSize): Update m_minimumLayoutSize based on effectiveLayoutSizeScaleFactor().
(WebCore::ViewportConfiguration::description const): Also dump m_minimumEffectiveDeviceWidth.
* page/ViewportConfiguration.h: Add a member variable m_minimumEffectiveDeviceWidth.

Source/WebKit:

If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
width. For clients that wish to lay out the content with a different width value, we would need to add a way
to specify the effective width for layout.

* UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth.
(-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method.
(-[WKWebView _setViewScale:]): Ditto.
(-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth.
(-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView.
* UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration
     to ignore the minimum effective width value.
* WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth.
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration.

Tools:

Allow UIScriptController to set WKWebView's minimum effective width with a new `setMinimumEffectiveWidth` method.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::setMinimumEffectiveWidth):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::setViewScale):
(WTR::UIScriptController::setMinimumEffectiveWidth):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setMinimumEffectiveWidth):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/UIScriptControllerCocoa.mm:
(WTR::UIScriptController::setMinimumEffectiveWidth):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues):

LayoutTests:

Add two new tests. The first test verifies if we ignore meta viewport, setting a different effective width value
will change the layout width of the page. The second test verifies if we don't ignore meta viewport, we will always
respect that (980pt) and setting a different effective width value won't change the layout width.

* fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport-expected.txt: Added.
* fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html: Added.
* fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport-expected.txt: Added.
* fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html: Added.
* resources/ui-helper.js:
(window.UIHelper.setMinimumEffectiveWidth): Add a helper method to set the minimum effective width from a test.
(window.UIHelper):

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

10 months agoMake generic EventHandler methods
stephan.szabo@sony.com [Wed, 28 Nov 2018 18:24:06 +0000 (18:24 +0000)]
Make generic EventHandler methods
https://bugs.webkit.org/show_bug.cgi?id=192032

Reviewed by Michael Catanzaro.

No new tests. No new behavior.

Move mostly generic for non-Apple platform implementations
of methods from EventHandlerGlib into EventHandler. Two
of these also had different Windows implementations, so
to limit behavior change from this, those are currently
overridden for Windows as well as Mac and IOS.

* page/EventHandler.cpp:
(WebCore::EventHandler::passMousePressEventToSubframe):
(WebCore::EventHandler::passMouseReleaseEventToSubframe):
(WebCore::EventHandler::widgetDidHandleWheelEvent):
(WebCore::EventHandler::tabsToAllFormControls const):
(WebCore::EventHandler::passWidgetMouseDownEventToWidget):
(WebCore::EventHandler::passMouseDownEventToWidget):
(WebCore::EventHandler::focusDocumentView):
(WebCore::EventHandler::eventActivatedView const):
(WebCore::EventHandler::passMouseMoveEventToSubframe):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::passMouseMoveEventToSubframe):
(WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
(WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
(WebCore::EventHandler::tabsToAllFormControls const): Deleted.
(WebCore::EventHandler::focusDocumentView): Deleted.
(WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::accessKeyModifiers): Deleted.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Deleted.
(WebCore::EventHandler::focusDocumentView): Deleted.
(WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::passMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::eventActivatedView const): Deleted.
(WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
(WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseMoveEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
(WebCore::EventHandler::accessKeyModifiers): Deleted.

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

10 months agoRemove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
Hironori.Fujii@sony.com [Wed, 28 Nov 2018 18:16:10 +0000 (18:16 +0000)]
Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
https://bugs.webkit.org/show_bug.cgi?id=191853

Reviewed by Michael Catanzaro.

In r235845, I excluded InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp from unify source builds in order to
work around a MSVC bug.

Then, I commited a different workaround for the MSVC bug in
r238386. Now, we can include InjectedBundleRangeHandle.cpp and
InjectedBundleNodeHandle.cpp in unified source builds. Revert
r235845.

* Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
and InjectedBundleNodeHandle.cpp
* WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
not to be compiled by XCode.

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

10 months ago[CMake] Automatically disable JIT and enable USE_SYSTEM_MALLOC on unfamiliar architec...
mcatanzaro@igalia.com [Wed, 28 Nov 2018 18:05:31 +0000 (18:05 +0000)]
[CMake] Automatically disable JIT and enable USE_SYSTEM_MALLOC on unfamiliar architectures
https://bugs.webkit.org/show_bug.cgi?id=186722

Reviewed by Žan Doberšek.

Time for part #2! This change was defeated for GTK and WPE by the code that makes the
options public. We have three options: (a) duplicate the architecture check currently in
WebKitFeatures.cmake in both OptionsGTK.cmake and OptionsWPE.cmake, (b) rely on the result
of that check in OptionsGTK.cmake and OptionsWPE.cmake by using ENABLE_JIT_DEFAULT and
USE_SYSTEM_MALLOC_DEFAULT, a fragile encapsulation violation, or (c) just make the options
private. They have been public up until now because they needed to be turned off on
unsupported architectures. But now they are off by default and enabled only for particular
whitelisted architectures, so they shouldn't be needed anymore.

Note we have to hide ENABLE_SAMPLING_PROFILER as well, since it needs to match the value of
ENABLE_JIT. Again, this is handled properly in WebKitFeatures.cmake, and defeated here in
OptionsGTK.cmake. (This is not a problem for WPE.)

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

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

10 months agoFix webkitbot hi command.
lforschler@apple.com [Wed, 28 Nov 2018 17:52:07 +0000 (17:52 +0000)]
Fix webkitbot hi command.
https://bugs.webkit.org/show_bug.cgi?id=192080

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/bot/irc_command.py:
(Hi.execute):

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

10 months agoWeb Inspector: REGRESSION(r238378): reloading WebInspector after a settings change...
commit-queue@webkit.org [Wed, 28 Nov 2018 17:51:49 +0000 (17:51 +0000)]
Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
https://bugs.webkit.org/show_bug.cgi?id=191971

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

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::reopen): Deleted.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in:
Move reopen out of the WebProcess...

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::reopen):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
And into the UIProcess where the order of messages won't
be as problematic.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::reopen):
Send a message to the WebInspectorProxy instead.

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

10 months agoVersioning.
kocsen_chung@apple.com [Wed, 28 Nov 2018 17:33:05 +0000 (17:33 +0000)]
Versioning.

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

10 months agoRemove another OS version check from NetworkDataTaskCocoa.mm
ap@apple.com [Wed, 28 Nov 2018 17:28:13 +0000 (17:28 +0000)]
Remove another OS version check from NetworkDataTaskCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=192046

Reviewed by Alex Christensen.

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):

Source/WTF:

* wtf/Platform.h:

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

10 months agoModernize version checks for same site cookie support
ap@apple.com [Wed, 28 Nov 2018 17:19:39 +0000 (17:19 +0000)]
Modernize version checks for same site cookie support
https://bugs.webkit.org/show_bug.cgi?id=192054

Reviewed by Tim Horton.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
Also removed runtime checks, which are no longer relevant.

Source/WTF:

* wtf/Platform.h:

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

10 months ago[LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched...
zalan@apple.com [Wed, 28 Nov 2018 17:17:28 +0000 (17:17 +0000)]
[LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB.
https://bugs.webkit.org/show_bug.cgi?id=192078

Reviewed by Antti Koivisto.

Source/WebCore:

This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining).
However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead.

* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::stretchHeightToInitialContainingBlock):

Tools:

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

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

10 months agoRemove Postprocess Headers dependencies
krollin@apple.com [Wed, 28 Nov 2018 16:50:40 +0000 (16:50 +0000)]
Remove Postprocess Headers dependencies
https://bugs.webkit.org/show_bug.cgi?id=192023
<rdar://problem/46283377>

Reviewed by Mark Lam.

JavaScriptCore's Xcode Postprocess Headers build phase used to have a
dependency on a specific handful of files. In r234227, the script used
in this phase (postprocess-headers.sh) was completely rewritten to
operate on *all* files in JSC's Public and Private headers directories
instead of just this handful. This rewrite makes the previous
dependency specification insufficient, leading to incorrect
incremental builds if the right files weren't touched. Address this by
removing the dependencies completely. This will cause
postprocess-headers.sh to always be executed, even when none of its
files are touch. Running this script all the time is OK, since it has
built-in protections against unnecessarily touching files that haven't
changed.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

10 months ago[LFC] Add support for quirk container's collapsing top margin in quirks mode.
zalan@apple.com [Wed, 28 Nov 2018 15:30:05 +0000 (15:30 +0000)]
[LFC] Add support for quirk container's collapsing top margin in quirks mode.
https://bugs.webkit.org/show_bug.cgi?id=192070

Reviewed by Antti Koivisto.

Source/WebCore:

In quirk mode when the top margin collapsing is computed for a quirk container (body, table cell) and the canditate margin value is
also a quirk value, we just ignore it.

* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isQuirkContainer):
(WebCore::Layout::hasMarginTopQuirkValue):
(WebCore::Layout::shouldIgnoreMarginTopInQuirkContext):
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isTableCell const):

Tools:

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

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

10 months agoIntersection Observer: rootMargin: '' gives weird results
ajuma@chromium.org [Wed, 28 Nov 2018 15:06:19 +0000 (15:06 +0000)]
Intersection Observer: rootMargin: '' gives weird results
https://bugs.webkit.org/show_bug.cgi?id=191975

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Add test coverage.

* web-platform-tests/intersection-observer/empty-root-margin-expected.txt: Added.
* web-platform-tests/intersection-observer/empty-root-margin.html: Added.

Source/WebCore:

When converting the rootMargin string into a LengthBox, explicitly construct a Length
of size 0px for each dimension, instead of using Length's default constructor. The
default constructor creates a Length with value Auto, which causes us to incorrectly
apply a non-zero rootMargin.

Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html

* page/IntersectionObserver.cpp:
(WebCore::parseRootMargin):

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

10 months ago[WebRTC][GStreamer] Make sure to have the default microphone on the top of the list
commit-queue@webkit.org [Wed, 28 Nov 2018 14:56:11 +0000 (14:56 +0000)]
[WebRTC][GStreamer] Make sure to have the default microphone on the top of the list
https://bugs.webkit.org/show_bug.cgi?id=192026

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-11-28
Reviewed by Philippe Normand.

Otherwise we might end up picking a useless one in some applications
(not sure what those application do though).

GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs

Source/WebCore:

* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::sortDevices):
(WebCore::GStreamerCaptureDeviceManager::addDevice):
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:

Tools:

* flatpak/org.webkit.CommonModules.yaml:
* gstreamer/jhbuild.modules:
* gstreamer/patches/gst-plugins-good-0014-pulse-Mark-default-devices-as-default.patch: Added.

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

10 months ago[GTK] Silence compilation warnings in glib unittests
tpopela@redhat.com [Wed, 28 Nov 2018 13:50:42 +0000 (13:50 +0000)]
[GTK] Silence compilation warnings in glib unittests
https://bugs.webkit.org/show_bug.cgi?id=192009

Reviewed by Michael Catanzaro.

Mark the destructor as virtual.

* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::~Test):

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

10 months ago[WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode
commit-queue@webkit.org [Wed, 28 Nov 2018 12:51:46 +0000 (12:51 +0000)]
[WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode
https://bugs.webkit.org/show_bug.cgi?id=192028

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-11-28
Reviewed by Philippe Normand.

* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::capabilities):

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

10 months ago[WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAud...
commit-queue@webkit.org [Wed, 28 Nov 2018 12:41:51 +0000 (12:41 +0000)]
[WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAudioSource
https://bugs.webkit.org/show_bug.cgi?id=192027

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-11-28
Reviewed by Xabier Rodriguez-Calvar.

Cleaning up a bit the code.

It is a minor refactoring, no new test required.

* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:

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

10 months ago[GStreamer][WebRTC] Do not run device monitor for device type we do not handle
commit-queue@webkit.org [Wed, 28 Nov 2018 12:40:08 +0000 (12:40 +0000)]
[GStreamer][WebRTC] Do not run device monitor for device type we do not handle
https://bugs.webkit.org/show_bug.cgi?id=191904

This is useless work and it throws warning about use GstDeviceMonitor without filters.

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-11-28
Reviewed by Philippe Normand.

* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):

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

10 months agoBlock more ports (427, 548, 6697)
rwlbuis@webkit.org [Wed, 28 Nov 2018 08:28:12 +0000 (08:28 +0000)]
Block more ports (427, 548, 6697)
https://bugs.webkit.org/show_bug.cgi?id=186092

Reviewed by Frédéric Wang.

Update request-bad-port.html to latest version.

* web-platform-tests/fetch/api/request/request-bad-port-expected.txt:
* web-platform-tests/fetch/api/request/request-bad-port.html:

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

10 months agoWeb Inspector: Elements tab should allow selecting/deleting multiple DOM nodes
mattbaker@apple.com [Wed, 28 Nov 2018 06:49:34 +0000 (06:49 +0000)]
Web Inspector: Elements tab should allow selecting/deleting multiple DOM nodes
https://bugs.webkit.org/show_bug.cgi?id=192059
<rdar://problem/46294827>

Reviewed by Devin Rousso.

Enable multiple DOM node selection in the DOMTreeContentView.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController):
(WI.SelectionController.prototype.get allowsEmptySelection):
(WI.SelectionController.prototype.set allowsEmptySelection):
Allow clients to control whether the last selected item can be deselected.
(WI.SelectionController.prototype.deselectItem):
(WI.SelectionController.prototype.didInsertItem):
Rewritten to prevent infinite loop.
(WI.SelectionController.prototype.didRemoveItem):
(WI.SelectionController.prototype._updateSelectedItems):
(WI.SelectionController.prototype._adjustIndexesAfter): Deleted.

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

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.updateSelectionArea):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.updateSelection):
Updating the selection area DOM element should not assume that only one
TreeElement is selected at a time.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.get allowsEmptySelection):
(WI.TreeOutline.prototype.set allowsEmptySelection):
(WI.TreeOutline.prototype.set selectedTreeElement):
(WI.TreeOutline.prototype.get selectedTreeElements):
(WI.TreeOutline.prototype._treeKeyDown):

* UserInterface/Views/TreeOutlineGroup.js:
(WI.TreeOutlineGroup):
(WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections):
Eliminate use of `TreeElement.prototype.deselect`.

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

10 months agoLog WebRTC stats in inspector console only when setting is verbose
youenn@apple.com [Wed, 28 Nov 2018 04:48:30 +0000 (04:48 +0000)]
Log WebRTC stats in inspector console only when setting is verbose
https://bugs.webkit.org/show_bug.cgi?id=192014

Reviewed by Eric Carlson.

Add a WebRTCStats channel that is used by default to output WebRTC stats in console.
When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel,
so that they appear as debug information in Web Inspector.

No change of JS behavior.
Covered by manually testing what is logged in inspector and console.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* platform/Logging.h:

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

10 months agoFix the mis-spelled "m_clienstWaitingForAsyncDecoding"
simon.fraser@apple.com [Wed, 28 Nov 2018 03:05:16 +0000 (03:05 +0000)]
Fix the mis-spelled "m_clienstWaitingForAsyncDecoding"
https://bugs.webkit.org/show_bug.cgi?id=192060

Reviewed by Wenson Hsieh.

Fix the mis-spelling of "m_clienstWaitingForAsyncDecoding".

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::createImage):
(WebCore::CachedImage::imageFrameAvailable):
* loader/cache/CachedImage.h:

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

10 months agoWeb Inspector: TreeOutline should re-use multiple-selection logic from Table
mattbaker@apple.com [Wed, 28 Nov 2018 02:55:42 +0000 (02:55 +0000)]
Web Inspector: TreeOutline should re-use multiple-selection logic from Table
https://bugs.webkit.org/show_bug.cgi?id=191483
<rdar://problem/45953305>

Reviewed by Devin Rousso.

Update TreeOutline to use SelectionController. Adopting SelectionController
in TreeOutline is not as straightforward as it was in Table. Selected items
are tracked by index, and TreeElement lacks an explicit index. As a consequence
TreeElement indexes are calcualted as needed and cached. The cache is cleared
whenever an element is added or removed.

* UserInterface/Controllers/SelectionController.js:
(WI.SelectionController.prototype.didInsertItem):
(WI.SelectionController.prototype.didRemoveItem):
(WI.SelectionController.prototype.handleKeyDown):
Drive-by syntax error fix.
(WI.SelectionController.prototype._adjustIndexesAfter):
(WI.SelectionController):

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.canSelectOnMouseDown):
(WI.DOMTreeElement.prototype.selectOnMouseDown): Deleted.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype._onmousedown):
Item selection is now handled by SelectionController.

* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.selectOnMouseDown): Deleted.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.canSelectOnMouseDown):
(WI.TreeElement.prototype._attach):
(WI.TreeElement.prototype.select):
(WI.TreeElement.prototype.deselect):
Route item selection through the parent TreeOutline, in order to go though
the TreeOutline's SelectionController.

(WI.TreeElement.treeElementMouseDown): Deleted.
Moved handler to TreeOutline, which owns the SelectionController that
needs to respond to mouse events.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline):
(WI.TreeOutline.prototype.get allowsMultipleSelection):
(WI.TreeOutline.prototype.set allowsMultipleSelection):
(WI.TreeOutline.prototype.get selectedTreeElement):
(WI.TreeOutline.prototype.set selectedTreeElement):
(WI.TreeOutline.prototype.insertChild):
(WI.TreeOutline.prototype.removeChildAtIndex):
(WI.TreeOutline.prototype._rememberTreeElement):
(WI.TreeOutline.prototype._forgetTreeElement):
(WI.TreeOutline.prototype._treeKeyDown):
(WI.TreeOutline.prototype.selectionControllerNumberOfItems):
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
(WI.TreeOutline.prototype.selectionControllerNextSelectableIndex):
(WI.TreeOutline.prototype.selectionControllerPreviousSelectableIndex):
(WI.TreeOutline.prototype.selectTreeElementInternal):
(WI.TreeOutline._generateStyleRulesIfNeeded._indexOfTreeElement.previousElement):
(WI.TreeOutline._generateStyleRulesIfNeeded):

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

10 months agoUnreviewed, test gardening
jiewen_tan@apple.com [Wed, 28 Nov 2018 02:16:25 +0000 (02:16 +0000)]
Unreviewed, test gardening

Add a time out parameter to the following test cases such that WebAuthN requests will timeout
themselves instead of letting the wpt wrapper or test runner kill them.

* http/wpt/webauthn/public-key-credential-create-success-hid.https.html:
* http/wpt/webauthn/public-key-credential-get-success-hid.https.html:
* platform/mac-wk2/TestExpectations:

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

10 months agoENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
mark.lam@apple.com [Wed, 28 Nov 2018 02:10:50 +0000 (02:10 +0000)]
ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
https://bugs.webkit.org/show_bug.cgi?id=192055
<rdar://problem/46288783>

Reviewed by Saam Barati.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests needed.  Removing an invalid configuration that is not used in 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@238597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

10 months agor238510 broke scopes of size zero
sbarati@apple.com [Wed, 28 Nov 2018 02:03:20 +0000 (02:03 +0000)]
r238510 broke scopes of size zero
https://bugs.webkit.org/show_bug.cgi?id=192033
<rdar://problem/46281734>

Reviewed by Keith Miller.

JSTests:

* stress/r238510-bad-loop.js: Added.
(foo):

Source/JavaScriptCore:

In r238510, I wrote the loop like this:
`for (ScopeOffset offset { 0 }; offset <= symbolTable->maxScopeOffset(); offset += 1)`

This breaks for scopes of size zero because maxScopeOffset() will be UINT_MAX.

This patch fixes this by writing the loop as:
`for (unsigned offset = 0; offset < symbolTable->scopeSize(); ++offset)`

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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