WebKit-https.git
11 months agoUnreviewed attempt to fix GTK build after r239104.
cdumez@apple.com [Wed, 12 Dec 2018 18:37:16 +0000 (18:37 +0000)]
Unreviewed attempt to fix GTK build after r239104.

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

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

11 months agoUnreviewed attempt to fix build with older SDKs after r239110.
cdumez@apple.com [Wed, 12 Dec 2018 18:23:50 +0000 (18:23 +0000)]
Unreviewed attempt to fix build with older SDKs after r239110.

* Platform/cocoa/WKCrashReporter.mm:

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

11 months agoUnreviewed, fix build with recent SDKs.
cdumez@apple.com [Wed, 12 Dec 2018 18:08:49 +0000 (18:08 +0000)]
Unreviewed, fix build with recent SDKs.

* Platform/cocoa/WKCrashReporter.mm:

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

11 months ago[iOS] A few API tests are failing after r239086
wenson_hsieh@apple.com [Wed, 12 Dec 2018 17:06:49 +0000 (17:06 +0000)]
[iOS] A few API tests are failing after r239086
https://bugs.webkit.org/show_bug.cgi?id=192608

Reviewed by Zalan Bujtas.

These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
the highest fidelity path using Vector::first().

While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.

* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readRespectingUTIFidelities):
(WebCore::Pasteboard::readFilePaths):

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

11 months ago[iOS] Zero memory containing the password for PDF documents when a WKPDFView is deall...
darin@apple.com [Wed, 12 Dec 2018 17:05:41 +0000 (17:05 +0000)]
[iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated
https://bugs.webkit.org/show_bug.cgi?id=192536
rdar://problem/41174451

Reviewed by Tim Horton.

* UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since
this class is not compiled on that platform at this time. Can always
add it back later.
(-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting.
(-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):
Initialize _passwordForPrinting; use a CString instead of retaining
an NSString since we can zero that out easily.
(-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting.

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

11 months agoUnreviewed, rolling out r239103.
commit-queue@webkit.org [Wed, 12 Dec 2018 16:28:51 +0000 (16:28 +0000)]
Unreviewed, rolling out r239103.
https://bugs.webkit.org/show_bug.cgi?id=192627

It broke the built because it depends on another patch that
didn't land yet (Requested by KaL on #webkit).

Reverted changeset:

"[WPE] Add API to notify about frame displayed view backend
callback"
https://bugs.webkit.org/show_bug.cgi?id=192224
https://trac.webkit.org/changeset/239103

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

11 months agoRestore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
cdumez@apple.com [Wed, 12 Dec 2018 16:01:00 +0000 (16:01 +0000)]
Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect()
https://bugs.webkit.org/show_bug.cgi?id=191982
<rdar://problem/46258054>

Reviewed by Alex Christensen.

Have the WebPageProxy remember the local paths it previously visited so that the
MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled.

Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect().

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequestWithNavigation):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadDataWithNavigation):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::backForwardGoToItem):
(WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess):
(WebKit::WebPageProxy::addPreviouslyVisitedPath):
(WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:

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

11 months ago[WPE] Add API to notify about frame displayed view backend callback
carlosgc@webkit.org [Wed, 12 Dec 2018 10:59:03 +0000 (10:59 +0000)]
[WPE] Add API to notify about frame displayed view backend callback
https://bugs.webkit.org/show_bug.cgi?id=192224

Reviewed by Michael Catanzaro.

Source/WebKit:

Add API to add a callback to the view to be called when the view backend notifies that a frame has been
displayed.

* UIProcess/API/glib/WebKitWebView.cpp:
(FrameDisplayedCallback::FrameDisplayedCallback):
(FrameDisplayedCallback::~FrameDisplayedCallback):
(webkit_web_view_add_frame_displayed_callback):
(webkit_web_view_remove_frame_displayed_callback):
* UIProcess/API/wpe/WebKitWebView.h:

Tools:

Add a test case to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewFrameDisplayed):
(beforeAll):

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

11 months agoUnreviewed. Fix WPE build after r239101.
carlosgc@webkit.org [Wed, 12 Dec 2018 09:54:30 +0000 (09:54 +0000)]
Unreviewed. Fix WPE build after r239101.

* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>

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

11 months ago[FreeType] Remove HarfBuzzFace
carlosgc@webkit.org [Wed, 12 Dec 2018 09:19:48 +0000 (09:19 +0000)]
[FreeType] Remove HarfBuzzFace
https://bugs.webkit.org/show_bug.cgi?id=192589

Reviewed by Michael Catanzaro.

Source/WebCore:

This was used to share the common implementation with the chromium port, but now that only freetype based ports
use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
since we are already caching glyphs in Font.

* platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
* platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
OpenType math.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::doubleToHarfBuzzPosition): Ditto.
(WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
(WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().

LayoutTests:

Rebaseline test that now matches the firefox output.

* platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:

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

11 months ago[FreeType] Add initial implementation of variation fonts
carlosgc@webkit.org [Wed, 12 Dec 2018 09:07:19 +0000 (09:07 +0000)]
[FreeType] Add initial implementation of variation fonts
https://bugs.webkit.org/show_bug.cgi?id=192151

Reviewed by Michael Catanzaro.

.:

Enable variation fonts in GTK+ port when required dependencies are available.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const):
* platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
pattern.
(WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
(WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::defaultVariationValues): Parse font variations table.
(WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
* platform/graphics/freetype/FontCacheFreeType.h: Added.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
(WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
(WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
FC_FONT_VARIATIONS value from the pattern.
(WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
pattern.
(WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
(WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
(WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:

Tools:

Add cairo patch to avoid crashes.

* gtk/jhbuild.modules:
* gtk/patches/cairo-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch: Added.

LayoutTests:

Unskip variation fonts tests that are now passing in GTK+ port.

* platform/gtk/TestExpectations:

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

11 months ago[BigInt] Simplify boolean context evaluation by leveraging JSString::offsetOfLength...
yusukesuzuki@slowstart.org [Wed, 12 Dec 2018 08:38:45 +0000 (08:38 +0000)]
[BigInt] Simplify boolean context evaluation by leveraging JSString::offsetOfLength() == JSBigInt::offsetOfLength()
https://bugs.webkit.org/show_bug.cgi?id=192615

Reviewed by Saam Barati.

JSString and JSBigInt have similar concept in terms of the implementation.
Both are immutable, JSCells, and have length information. m_length is located
just after JSCell header part, we can ensure `JSString::offsetOfLength() == JSBigInt::offsetOfLength()`,
and it allows us to optimize the boolean context evaluation.

This patch leverages the above information to reduce the code size for the boolean context evaluation.

* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::boolify):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
(JSC::AssemblyHelpers::branchIfValue):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::offsetOfLength): Deleted.
* runtime/JSBigInt.h:

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

11 months agoImplement feature flag for CSS Typed OM
justin_michaud@apple.com [Wed, 12 Dec 2018 05:54:17 +0000 (05:54 +0000)]
Implement feature flag for CSS Typed OM
https://bugs.webkit.org/show_bug.cgi?id=192610

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
* css/typedom/StylePropertyMapReadOnly.h:
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h:
* css/typedom/TypedOMCSSImageValue.idl:
* css/typedom/TypedOMCSSNumericValue.h:
* css/typedom/TypedOMCSSNumericValue.idl:
* css/typedom/TypedOMCSSStyleValue.h:
* css/typedom/TypedOMCSSStyleValue.idl:
* css/typedom/TypedOMCSSUnitValue.h:
* css/typedom/TypedOMCSSUnitValue.idl:
* css/typedom/TypedOMCSSUnparsedValue.h:
* css/typedom/TypedOMCSSUnparsedValue.idl:
* features.json:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
* html/canvas/CanvasDrawImage.idl:
* html/canvas/CanvasFillStrokeStyles.idl:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* html/canvas/CanvasRenderingContext2DBase.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
(WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
* page/WindowOrWorkerGlobalScope.idl:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

11 months ago[Win][WebKitLegacy][Clang] WebKit.h warning: 'IWebEditingDelegate2::shouldInsertNode...
Hironori.Fujii@sony.com [Wed, 12 Dec 2018 05:18:42 +0000 (05:18 +0000)]
[Win][WebKitLegacy][Clang] WebKit.h warning: 'IWebEditingDelegate2::shouldInsertNode' hides overloaded virtual function [-Woverloaded-virtual]
https://bugs.webkit.org/show_bug.cgi?id=192581

Reviewed by Alex Christensen.

Conventionally, WebKit COM interface adds a new interface with
same name methods with the old interface. For example, both
IWebEditingDelegate and IWebEditingDelegate2 interfaces has
shouldInsertNode method.

This is a part of public API, can't be renamed.

* PlatformWin.cmake: Added -Wno-overloaded-virtual compiler option
for WebKitLegacy

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

11 months agoconnectedCallback is invoked during the removal of the element inside another element...
rniwa@webkit.org [Wed, 12 Dec 2018 03:58:41 +0000 (03:58 +0000)]
connectedCallback is invoked during the removal of the element inside another element's connectedCallback
https://bugs.webkit.org/show_bug.cgi?id=183586
<rdar://problem/38403504>

Reviewed by Frédéric Wang.

Source/WebCore:

Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760

After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.

Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
    1. Let definition be element's custom element definition.
    2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
    3. If callback is null, then return
    4. If callbackName is "attributeChangedCallback", then:
        1. Let attributeName be the first element of args.
        2. If definition's observed attributes does not contain attributeName, then return.
    5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
       and arguments args.
    6. Enqueue an element on the appropriate element queue given element.

Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
(WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
* dom/CustomElementReactionQueue.h:

LayoutTests:

Added a W3C style testharness test.

* fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback-expected.txt: Added.
* fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html: Added.

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

11 months agoUnreviewed, fix bad check in API test added in r239080.
cdumez@apple.com [Wed, 12 Dec 2018 02:54:17 +0000 (02:54 +0000)]
Unreviewed, fix bad check in API test added in r239080.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

11 months agoSource/WebCore:
justin_fan@apple.com [Wed, 12 Dec 2018 01:40:06 +0000 (01:40 +0000)]
Source/WebCore:
[WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
https://bugs.webkit.org/show_bug.cgi?id=192516

Reviewed by Dean Jackson.

Test: webgpu/buffers.html

Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.

Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

* Modules/webgpu/WebGPUBuffer.cpp: Added.
(WebCore::WebGPUBuffer::create):
(WebCore::WebGPUBuffer::WebGPUBuffer):
* Modules/webgpu/WebGPUBuffer.h: Added.
(WebCore::WebGPUBuffer::mapping const):
(WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
(WebCore::WebGPUBuffer::destroy): Unimplemented stub.
* Modules/webgpu/WebGPUBuffer.idl: Added.
* Modules/webgpu/WebGPUBufferDescriptor.h: Added.
* Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const): Added.
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::platformBuffer const):
(WebCore::GPUBuffer::mapping const):
* platform/graphics/gpu/GPUBufferDescriptor.h: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createBuffer const): Added.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
(WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.

Small benign edits, most to make nullability more consistent in WebGPU classes:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::createCommandBuffer const):
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::device const):
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
(WebCore::WebGPUShaderModule::WebGPUShaderModule):
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::create):
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::create):
* Modules/webgpu/WebGPUTextureView.h:
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::create):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::create):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::setDevice):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):

LayoutTests:
[WebGPU] Implement WebGPUBuffer
https://bugs.webkit.org/show_bug.cgi?id=192516

Reviewed by Dean Jackson.

Basic test to create a WebGPUBuffer and ensure that its memory is valid.

* webgpu/buffers-expected.txt: Added.
* webgpu/buffers.html: Added.

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

11 months ago[Win][Clang] Fix compilation warnings of WTF
Hironori.Fujii@sony.com [Wed, 12 Dec 2018 01:34:05 +0000 (01:34 +0000)]
[Win][Clang] Fix compilation warnings of WTF
https://bugs.webkit.org/show_bug.cgi?id=192583

Reviewed by Alex Christensen.

clang-cl reports the following warnings.

> [92/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\StackBounds.cpp.obj
> ..\..\Source\WTF\wtf\StackBounds.cpp(163,48):  warning: missing field 'AllocationBase' initializer [-Wmissing-field-initializers]
>     MEMORY_BASIC_INFORMATION stackOrigin = { 0 };
>                                                ^
> 1 warning generated.
> [160/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\win\RunLoopWin.cpp.obj
> ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(34,54):  warning: ISO C++11 does not allow conversion from string literal to 'const LPWSTR' (aka 'wchar_t *const') [-Wwritable-strings]
> static const LPWSTR kRunLoopMessageWindowClassName = L"RunLoopMessageWindow";
>                                                      ^
> ..\..\Source\WTF\wtf\win\RunLoopWin.cpp(86,32):  warning: missing field 'lpfnWndProc' initializer [-Wmissing-field-initializers]
>     WNDCLASS windowClass = { 0 };
>                                ^
> 2 warnings generated.
> [175/206] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\DateMath.cpp.obj
> ..\..\Source\WTF\wtf\DateMath.cpp(125,20):  warning: unused function 'getLocalTime' [-Wunused-function]
> static inline void getLocalTime(const time_t* localTime, struct tm* localTM)
>                    ^
> 1 warning generated.

* wtf/DateMath.cpp:
(WTF::getLocalTime): Defined only if used.
* wtf/StackBounds.cpp:
(WTF::StackBounds::currentThreadStackBoundsInternal): Initialize stackOrigin with '{ }'.
* wtf/win/RunLoopWin.cpp: Change the type of kRunLoopMessageWindowClassName to LPCWSTR.
(WTF::RunLoop::registerRunLoopMessageWindowClass): Initialize windowClass with '{ }'.

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

11 months ago[Win][Clang] Fix warning -Wmissing-field-initializers
Hironori.Fujii@sony.com [Wed, 12 Dec 2018 01:15:55 +0000 (01:15 +0000)]
[Win][Clang] Fix warning -Wmissing-field-initializers
https://bugs.webkit.org/show_bug.cgi?id=192584

Reviewed by Yusuke Suzuki.

Initialize a struct with '{ }' instead of '= {0}'.

Source/WebCore:

No new tests, no behavior changes.

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::setFileDescriptorData):
(WebCore::setFileContentData):
(WebCore::setUCharData):
(WebCore::setUtf8Data):
(WebCore::setCFData):
* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor):
* platform/win/DefWndProcWindowClass.cpp:
(WebCore::registerClass):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageIconForCachedImageFilename):
* platform/win/PasteboardWin.cpp:
(WebCore::writeURL):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::writeRangeToDataObject):
(WebCore::Pasteboard::writePlainTextToDataObject):
(WebCore::writeFileToDataObject):
(WebCore::Pasteboard::writeMarkup):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::show):
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::WebCore::signedPublicKeyAndChallengeString):

Source/WebKit:

* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::showPopupMenu):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::initializeToolTipWindow):
(WebKit::WebView::setToolTip):

Source/WebKitLegacy/win:

* WebKitMessageLoop.cpp:
(WebKitMessageLoop::run):
* WebView.cpp:
(WebView::onMenuCommand):
(WebView::gesture):
(WebView::setShouldInvertColors):
(WebView::initializeToolTipWindow):
(WebView::setToolTip):
(WebView::fullScreenClientForceRepaint):

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest):
* DumpRenderTree/win/EventSender.cpp:
(makeMsg):
(replaySavedEvents):
(beginDragWithFilesCallback):
* DumpRenderTree/win/PixelDumpSupportWin.cpp:
(createBitmapContextFromWebView):
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(updateMenuItemForHistoryItem):
* MiniBrowser/win/WinMain.cpp:
(wWinMain):
* TestWebKitAPI/win/HostWindow.cpp:
(TestWebKitAPI::HostWindow::clientRect const):
(TestWebKitAPI::HostWindow::registerWindowClass):
* TestWebKitAPI/win/PlatformWebViewWin.cpp:
(TestWebKitAPI::PlatformWebView::registerWindowClass):
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::registerWindowClass):
(WTR::PlatformWebView::windowFrame):
(WTR::PlatformWebView::windowSnapshotImage):

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

11 months agoGlobally namespaced objects shouldn't use framework-prefixed names
jer.noble@apple.com [Wed, 12 Dec 2018 00:18:13 +0000 (00:18 +0000)]
Globally namespaced objects shouldn't use framework-prefixed names
https://bugs.webkit.org/show_bug.cgi?id=192600

Reviewed by Eric Carlson.

Rename CMSampleBufferIs... -> isCMSampleBuffer...

* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::isCMSampleBufferRandomAccess):
(WebCore::isCMSampleBufferNonDisplaying):
(WebCore::MediaSampleAVFObjC::flags const):
(WebCore::CMSampleBufferIsRandomAccess): Deleted.
(WebCore::CMSampleBufferIsNonDisplaying): Deleted.

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

11 months agoDon't attempt to compute animated values when there is no relevant animation
bfulgham@apple.com [Tue, 11 Dec 2018 22:34:40 +0000 (22:34 +0000)]
Don't attempt to compute animated values when there is no relevant animation
https://bugs.webkit.org/show_bug.cgi?id=192591
<rdar://problem/34336946>

Reviewed by Dean Jackson.

Source/WebCore:

Check if the property is supposed to be animated, or has animatable features, before
attempting to calculate the current animated value.

Test: svg/animations/avoid-calculating-for-non-animating-elements.html

* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):

LayoutTests:

* svg/animations/avoid-calculating-for-non-animating-elements-expected.txt: Added.
* svg/animations/avoid-calculating-for-non-animating-elements.html: Added.

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

11 months agoUnreviewed, fix typos in console log from r239087.
cdumez@apple.com [Tue, 11 Dec 2018 22:00:30 +0000 (22:00 +0000)]
Unreviewed, fix typos in console log from r239087.

Source/WebCore:

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

LayoutTests:

* http/tests/events/device-orientation-motion-non-secure-context.html:
* platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt:

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

11 months agoWebCore shouldn't have a Objective-C class named NSCursor
timothy_horton@apple.com [Tue, 11 Dec 2018 21:54:20 +0000 (21:54 +0000)]
WebCore shouldn't have a Objective-C class named NSCursor
https://bugs.webkit.org/show_bug.cgi?id=192602
<rdar://problem/46615532>

Reviewed by Wenson Hsieh.

Source/WebCore:

* platform/ios/wak/WAKAppKitStubs.h:
* platform/ios/wak/WAKAppKitStubs.m:
(+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
Get rid of the class.
Also remove a comment that seems to have detached from wherever it's supposed to be.

Source/WebKitLegacy/mac:

* WebView/WebFrameView.mm:
(-[WebFrameView keyDown:keyDown:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView keyDown:]):
(-[WebHTMLView performKeyEquivalent:]):
Only use NSCursor on macOS.

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

11 months agoRestrict DeviceMotion / DeviceOrientation APIs to secure contexts
cdumez@apple.com [Tue, 11 Dec 2018 21:49:51 +0000 (21:49 +0000)]
Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
https://bugs.webkit.org/show_bug.cgi?id=192595
<rdar://problem/46382603>

Reviewed by Dean Jackson.

Source/WebCore:

Tests: http/tests/events/device-orientation-motion-non-secure-context.html
       http/tests/events/device-orientation-motion-secure-context.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
* testing/Internals.cpp:
(WebCore::Internals::markContextAsInsecure):
(WebCore::Internals::postTask):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add layout test coverage. Note however that we currently do not have mock data providers
for these APIs.

* http/tests/events/device-orientation-motion-non-secure-context-expected.txt: Added.
* http/tests/events/device-orientation-motion-non-secure-context.html: Added.
* http/tests/events/device-orientation-motion-secure-context-expected.txt: Added.
* http/tests/events/device-orientation-motion-secure-context.html: Added.
* platform/ios/http/tests/events/device-orientation-motion-non-secure-context-expected.txt: Added.
* platform/ios/http/tests/events/device-orientation-motion-secure-context-expected.txt: Added.

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

11 months ago[iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
wenson_hsieh@apple.com [Tue, 11 Dec 2018 21:13:32 +0000 (21:13 +0000)]
[iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
https://bugs.webkit.org/show_bug.cgi?id=192598
Work towards <rdar://problem/35626913>

Reviewed by Tim Horton.

Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
a "preferred" file upload URL and type. See below for more details.

* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::pathForContentType const):

Add a helper method to find a file upload URL corresponding to a given type.

(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):

Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.

* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readRespectingUTIFidelities):

Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.

(WebCore::Pasteboard::readFilePaths):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_containsFileURLAndFileUploadContent]):
(-[NSItemProvider web_fileUploadContentTypes]):

Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).

(-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
(-[WebItemProviderPasteboard numberOfFiles]):
(-[NSItemProvider web_containsFileUploadContent]): Deleted.
(-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.

Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
data serialization for an `NSURL` as a file on the web).

Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
uploads, and return all of these file types that we've loaded.

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

11 months agoResource Load Statistics: Use common implementation within NetworkStorageSession
don.olmstead@sony.com [Tue, 11 Dec 2018 20:25:21 +0000 (20:25 +0000)]
Resource Load Statistics: Use common implementation within NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=192592

Reviewed by Alex Christensen.

There's nothing within the resource load statistics implementation contained
in NetworkStorageSessionCFNet that was CF specific. All of the resource load
statistics methods are moved from that file to the root NetworkStorageSession
implementation.

* platform/network/NetworkStorageSession.cpp:
(WebCore::getPartitioningDomain):
(WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::maxAgeCacheCap):
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
(WebCore::NetworkStorageSession::removePrevalentDomains):
(WebCore::NetworkStorageSession::hasStorageAccess const):
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
(WebCore::NetworkStorageSession::grantStorageAccess):
(WebCore::NetworkStorageSession::removeStorageAccessForFrame):
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
(WebCore::NetworkStorageSession::removeAllStorageAccess):
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::getPartitioningDomain): Deleted.
(WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
(WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
(WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
(WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
(WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
(WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
(WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.

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

11 months agoPSON logic gets confused by concurrent decidePolicyForNavigationAction requests
cdumez@apple.com [Tue, 11 Dec 2018 20:24:06 +0000 (20:24 +0000)]
PSON logic gets confused by concurrent decidePolicyForNavigationAction requests
https://bugs.webkit.org/show_bug.cgi?id=192482
<rdar://problem/46470145>

Reviewed by Antti Koivisto.

Source/WebKit:

It is possible to get 2 parallel decidePolicyForNavigationAction() requests from the
WebProcess when a new load is started before responding to the existing policy
decision. This would lead to several issues with regards to PSON:
- We would decide to swap for the first policy decision and tell the WebProcess to
  suspend. However, because the WebProcess issued a new decidePolicyForNavigationAction
  since for the same frame, the previous one is invalidated and the WebProcess would
  ignore our request to suspend.
- We would hit assertions later on because the navigation has been destroyed and yet
  we're getting a didStartProvisionalLoad for it.
- swapToWebProcess() was asynchronous so that it would wait for the destination
  SuspendedPage to finish suspending before asking it to unsuspend. This led to various
  problems because anything can happen in the UIProcess while we're waiting for the
  suspension (e.g. another load). Also, we may create the SuspendedPageProxy for
  the current page too late and start getting IPC from the previous process about
  the suspension load to about:blank.

To address these issues, the following design is now implemented:
- swapToWebProcess() is no longer asynchronous
- instead, WebProcessPool::processForNavigation() is now asynchronous. This is better
  because at this point we have not yet told the WebProcess about the policy decision.
  We already properly deal with the policy decision being made asynchronously. This
  also allows us to choose another process if the SuspendedPage we'd like to use
  failed to suspend.
- If the WebProcess receives a PolicyAction::Suspend but ignores it, have it send an
  IPC to the UIProcess so that the SuspendedPageProxy knows about it. We then destroy
  the SuspendedPageProxy and make sure it is not used.
- After the asynchronous process selection, if the navigation has been destroy, abort
  the process-swap to avoid hitting assertions later on due to doing a load for a
  destroyed navigation.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
Make sure m_whenReadyToConsume completion handler gets called if necessary if the
SuspendedPageProxy gets destroyed. We pass null so that the SuspendedPage is not
used.

(WebKit::SuspendedPageProxy::whenReadyToConsume):
Add whenReadyToConsume() utility method to get a completion handler called when
the SuspendedPageProxy is ready to be used. This basically means we have to wait
for the page to finish its about:blank suspension load. If the suspension fails
then we call the completion handler with null to indicate that the suspended
page is not usable.

(WebKit::SuspendedPageProxy::unsuspendAndConsume):
Rename unsuspend() to unsuspendAndConsume() and make it synchronous. This only gets
called after whenReadyToConsume()'s completion handler has been called and if we
do decide to use the SuspendedPageProxy. It tells the WebProcess to unsuspend and
removes the SuspendedPageProxy from the WebProcessPool.

(WebKit::SuspendedPageProxy::didFinishLoad):
rename m_finishedSuspendingHandler to m_whenReadyToConsume.

(WebKit::SuspendedPageProxy::didFailToSuspend):
Add new didFailToSuspend() that gets called when the WebProcess sends us an IPC telling
us it ignored our request to suspend. We then call m_whenReadyToConsume completion
handler with null and destroy the SuspendedPageProxy.

(WebKit::SuspendedPageProxy::didReceiveMessage):
* UIProcess/SuspendedPageProxy.h:

* UIProcess/WebNavigationState.h:
(WebKit::WebNavigationState::hasNavigation const):
Add utility function to query if a navigation is still valid.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::swapToWebProcess):
Update method so that it is no longer asynchronous. Some of its code was also moved to
continueNavigationInNewProcess() for clarity.

(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
Deal with WebProcessPool::processForNavigation() now being asynchronous.

(WebKit::WebPageProxy::continueNavigationInNewProcess):
Update code now that swapToWebProcess() is no longer asynchronous. Some of the swapToWebProcess()
code was also moved here for clarity.

(WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap):

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Add new DidFailToSuspendAfterProcessSwap IPC message.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* UIProcess/WebProcessPool.h:
Make asynchronous. If we decide to use a SuspendedPageProxy's process, then call
whenReadyToConsume() on it to wait for it to suspend. If the SuspendedPageProxy
fails to suspend use a new process instead.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didReceivePolicyDecision):
If we ignore the policy decision and the decision was "Suspend", send the DidFailToSuspendAfterProcessSwap
IPC to the UIProcess so that the SuspendedPageProxy knows about it.

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

11 months agoWeb Inspector: overlay bounds rulers don't match element when page is scrolled
drousso@apple.com [Tue, 11 Dec 2018 19:27:26 +0000 (19:27 +0000)]
Web Inspector: overlay bounds rulers don't match element when page is scrolled
https://bugs.webkit.org/show_bug.cgi?id=192577

Reviewed by Joseph Pecoraro.

When drawing the highlight for a node, the canvas is translated based on the scroll position
of the node. This translation was not applied to the bounds calculations, which meant that
the bounds always drew where the node would have been if it wasn't scrolled.

* inspector/InspectorOverlayPage.js:
(Bounds.prototype.get minX):
(Bounds.prototype.get minY):
(Bounds.prototype.get maxX):
(Bounds.prototype.get maxY):
(Bounds.prototype.offset): Added.
(drawNodeHighlight):
Drive-by: draw bounds for every node being highlighted instead of just the first one.
Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239079 268f45cc-cd09-0410-ab3c-d52691b4dbfc

11 months agoIntroduce makeBlockPtr for lambdas
aestes@apple.com [Tue, 11 Dec 2018 19:21:38 +0000 (19:21 +0000)]
Introduce makeBlockPtr for lambdas
https://bugs.webkit.org/show_bug.cgi?id=192594

Reviewed by Alex Christensen.

Source/WebCore:

Adopted makeBlockPtr.

* platform/cocoa/FileMonitorCocoa.mm:
(WebCore::FileMonitor::FileMonitor):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
(WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession addDelegateOperation:]):
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):

Source/WebCore/PAL:

Adopted makeBlockPtr.

* pal/Logging.cpp:
(PAL::registerNotifyCallback):

Source/WebKit:

Adopted makeBlockPtr.

* NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
(-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::read):
(WebKit::NetworkCache::IOChannel::write):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::clearDiskCache):
(WebKit::saveCookies):
* NetworkProcess/watchos/NetworkProximityAssertion.mm:
(WebKit::BluetoothProximityAssertion::suspend):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setInputDelegate:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView maybeInstallIconLoadingClient]):
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::requestNewPageWithOptions):
(WebKit::AutomationSessionClient::requestSwitchToPage):
(WebKit::AutomationSessionClient::requestHideWindowOfPage):
(WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
(WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
* UIProcess/Cocoa/IconLoadingDelegate.mm:
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
(WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
(WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::runJavaScriptAlert):
(WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
(WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
(WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
(WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
(WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
(WebKit::UIDelegate::UIClient::windowFrame):
(WebKit::UIDelegate::UIClient::toolbarsAreVisible):
(WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
(WebKit::UIDelegate::UIClient::runOpenPanel):
(WebKit::requestUserMediaAuthorizationForDevices):
(WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
(WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
(WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
(WebKit::UIDelegate::UIClient::requestPointerLock):
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning clickedOnLink:]):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
* UIProcess/WebAuthentication/Cocoa/HidConnection.mm:
(WebKit::HidConnection::send):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::getUserConsent const):
(WebKit::LocalConnection::getAttestation const):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
* UIProcess/mac/ServicesController.mm:
(WebKit::hasCompatibleServicesForItems):
(WebKit::ServicesController::refreshExistingServices):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(PageLoaderClient::didStartProvisionalLoadForFrame):

Source/WTF:

BlockPtr<...>::fromCallable is cumbersome because it requires repeating the callable's
signature as a class template argument. This patch introduces an overload of makeBlockPtr
that deduces the correct BlockPtr instantiation from a lambda's operator() signature.

* wtf/BlockPtr.h:
(WTF::makeBlockPtr):

Adopted makeBlockPtr.

* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
(WTF::WorkQueue::concurrentApply):

Tools:

Adopted makeBlockPtr and added API tests.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::callUIScriptCallback):
* TestWebKitAPI/Tests/WTF/BlockPtr.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/DownloadProgress.mm:
(-[DownloadProgressTestRunner init]):
(-[DownloadProgressTestRunner subscribeAndWaitForProgress]):

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

11 months agoREGRESSION (r238764-238783): TestWTF.WTF.StringOperators is failing
cdumez@apple.com [Tue, 11 Dec 2018 19:10:48 +0000 (19:10 +0000)]
REGRESSION (r238764-238783): TestWTF.WTF.StringOperators is failing
https://bugs.webkit.org/show_bug.cgi?id=192361
<rdar://problem/46524903>

Reviewed by Alex Christensen.

Compile StringOperators.cpp with -O1 optimization level instead of -Os. This
fixes the failures for me locally.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

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

11 months agoFix an internal build failure after r239014
achristensen@apple.com [Tue, 11 Dec 2018 18:45:27 +0000 (18:45 +0000)]
Fix an internal build failure after r239014
https://bugs.webkit.org/show_bug.cgi?id=192205

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontOfSize):
There's a system that doesn't have safe browsing or UIFontTextStyleLargeTitle.

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

11 months agoSimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from compl...
bburg@apple.com [Tue, 11 Dec 2018 17:39:16 +0000 (17:39 +0000)]
SimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from completion handler
https://bugs.webkit.org/show_bug.cgi?id=191155
<rdar://problem/45745569>

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
Add an ASSERT to guard against unexpected inputs where >1 VirtualKey changes per state.
webkitdriver needs to be updated to not produce such states in this scenario, but this will
avoid a runtime crash caused by trying to call a moved-out completion handler a second time.

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

11 months agoUnreviewed, WPE build fix after r239028
philn@webkit.org [Tue, 11 Dec 2018 15:14:51 +0000 (15:14 +0000)]
Unreviewed, WPE build fix after r239028

The FLATPAK_USER_DIR env var is not set early enough, leading to:

Traceback (most recent call last):
File "/home/phil/WebKit/Tools/Scripts/webkit-flatpak", line 28, in <module>
  sys.exit(WebkitFlatpak.load_from_args().run())
File "/home/phil/WebKit/Tools/flatpak/flatpakutils.py", line 761, in run
  if not self.clean_args():
File "/home/phil/WebKit/Tools/flatpak/flatpakutils.py", line 574, in clean_args
  _log.debug("Using flatpak user dir: %s" % os.environ["FLATPAK_USER_DIR"])
File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
  raise KeyError(key)
KeyError: 'FLATPAK_USER_DIR'

* flatpak/flatpakutils.py:
(WebkitFlatpak.clean_args):

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

11 months agoUnreviewed, rolling out r239071.
commit-queue@webkit.org [Tue, 11 Dec 2018 14:33:36 +0000 (14:33 +0000)]
Unreviewed, rolling out r239071.
https://bugs.webkit.org/show_bug.cgi?id=192588

Broke WPE build due to undefined references to toAPI() and
toImpl() inside the C API (Requested by magomez on #webkit).

Reverted changeset:

"[meta][WebKit] Remove using namespace WebCore and WebKit in
the global scope for unified source builds"
https://bugs.webkit.org/show_bug.cgi?id=192449
https://trac.webkit.org/changeset/239071

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

11 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Tue, 11 Dec 2018 06:55:31 +0000 (06:55 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449

Reviewed by Darin Adler.

* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginProcess.cpp:
* PluginProcess/WebProcessConnection.cpp:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
(WKErrorCopyCFError):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/ChildProcess.cpp:
* Shared/ContextMenuContextData.cpp:
* Shared/EditorState.cpp:
* Shared/Plugins/NPIdentifierData.cpp:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
* Shared/SessionState.cpp:
* Shared/SessionTracker.cpp:
* Shared/ShareableBitmap.cpp:
* Shared/ShareableResource.cpp:
* Shared/VisibleContentRectUpdateInfo.cpp:
* Shared/WebBackForwardListItem.cpp:
* Shared/WebContextMenuItemData.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebHitTestResultData.cpp:
* Shared/WebImage.cpp:
* Shared/WebMediaSessionMetadata.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMouseEvent.cpp:
* Shared/WebRenderObject.cpp:
* Shared/WebSQLiteDatabaseTracker.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
* Shared/ios/WebPlatformTouchPointIOS.cpp:
* SourcesCocoa.txt:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView dealloc]):
(-[WKContentView page]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _updateForScreen:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _createDrawingAreaProxy]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(hasAssistedNode):
(-[WKContentView setupInteraction]):
(-[WKContentView positionInformation]):
(-[WKContentView _webTouchEventsRecognized:]):
(inflateQuad):
(-[WKContentView _updateTapHighlight]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView inputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _currentPositionInformationIsValidForRequest:]):
(-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
(-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _stylusSingleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView selectForWebView:]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
(toGestureType):
(toUIWKGestureType):
(toSelectionTouch):
(toUIWKSelectionTouch):
(toGestureRecognizerState):
(toUIGestureRecognizerState):
(toUIWKSelectionFlags):
(toWKTextGranularity):
(toWKSelectionDirection):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView autocorrectionData]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView _updateAccessory]):
(-[WKContentView selectedTextRange]):
(-[WKContentView setMarkedText:selectedRange:]):
(coreWritingDirection):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView insertText:]):
(-[WKContentView textInputTraits]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
(-[WKContentView assistedNodeInformation]):
(-[WKContentView assistedNodeSelectOptions]):
(isAssistableInputType):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView selectWordForReplacement]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _startDrag:item:]):
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView _autofillContext]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKContentView _simulateLongPressActionAtLocation:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentationRectsForPreviewItemController:]):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController _completedExitFullScreen]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
(-[WKFullScreenWindowController _manager]):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):

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

11 months agoSVGViewSpec objects should mark relevant SVG elements
bfulgham@apple.com [Tue, 11 Dec 2018 06:50:33 +0000 (06:50 +0000)]
SVGViewSpec objects should mark relevant SVG elements
https://bugs.webkit.org/show_bug.cgi?id=192567
<rdar://problem/46491325>

Reviewed by Ryosuke Niwa.

Source/WebCore:

SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
recognize the relevant SVGElement as active as long as the SVGViewSpec is active.

Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
pointer to the SVGElement, so switched to a WeakPtr.

Test: svg/animations/view-dependency-crash.html

* Sources.txt: Add new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSSVGViewSpecCustom.cpp: Added.
(WebCore::JSSVGViewSpec::visitAdditionalChildren):
* svg/SVGElement.h:
* svg/SVGPathElement.h:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
* svg/SVGViewSpec.h:
* svg/SVGViewSpec.idl:
* svg/properties/SVGAttributeOwnerProxy.cpp: Added.
(WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
the underling SVGElement.
(WebCore::SVGAttributeOwnerProxy::element const): Ditto.
* svg/properties/SVGAttributeOwnerProxy.h:
(WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
(WebCore::SVGAttributeOwnerProxy::element const): Ditto.
* svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.

LayoutTests:

* svg/animations/view-dependency-crash-expected.txt: Added.
* svg/animations/view-dependency-crash.html: Added.

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

11 months ago<rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
benjamin@webkit.org [Tue, 11 Dec 2018 05:37:24 +0000 (05:37 +0000)]
<rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
https://bugs.webkit.org/show_bug.cgi?id=192439

Reviewed by Dean Jackson.

Source/WebCore:

This broken when WebKit switched to NSURLSession.
In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.

Test: http/tests/contentextensions/video-element-resource-type.html

* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):

LayoutTests:

* http/tests/contentextensions/video-element-resource-type-expected.txt: Added.
* http/tests/contentextensions/video-element-resource-type.html: Added.
* http/tests/contentextensions/video-element-resource-type.html.json: Added.

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

11 months agoMove ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
don.olmstead@sony.com [Tue, 11 Dec 2018 04:04:45 +0000 (04:04 +0000)]
Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=192573

Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Remove ENABLE_RESOURCE_LOAD_STATISTICS from Platform.h and instead rely
on it being set in FeatureDefines.xcconfig.

* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

11 months agoCS Painting API should support multiple worklets.
justin_michaud@apple.com [Tue, 11 Dec 2018 03:55:49 +0000 (03:55 +0000)]
CS Painting API should support multiple worklets.
https://bugs.webkit.org/show_bug.cgi?id=192335

Reviewed by Dean Jackson.

Source/WebCore:

Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
for paint would not trigger a repaint if there had not been a valid value set before.

Test: fast/css-custom-paint/multiple-worklets.html

* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::paintWorkletGlobalScope):
(WebCore::Document::setPaintWorkletGlobalScope):
* dom/Document.h:
(WebCore::Document::paintWorkletGlobalScope): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::changedCustomPaintWatchedProperty):
* worklets/Worklet.cpp:
(WebCore::Worklet::addModule):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::prepareForDestruction):

LayoutTests:

* fast/css-custom-paint/animate-repaint-expected.txt:
* fast/css-custom-paint/animate-repaint.html:
* fast/css-custom-paint/delay-expected.html: Added.
* fast/css-custom-paint/delay-repaint-expected.txt: Copied from LayoutTests/fast/css-custom-paint/animate-repaint-expected.txt.
* fast/css-custom-paint/delay-repaint.html: Copied from LayoutTests/fast/css-custom-paint/animate-repaint.html.
* fast/css-custom-paint/delay.html: Copied from LayoutTests/fast/css-custom-paint/animate-repaint.html.
* fast/css-custom-paint/multiple-worklets-expected.html: Added.
* fast/css-custom-paint/multiple-worklets.html: Added.

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

11 months agoWeb Inspector: REGRESSION (r238599): unable to select specific timeline
mattbaker@apple.com [Tue, 11 Dec 2018 03:50:25 +0000 (03:50 +0000)]
Web Inspector: REGRESSION (r238599): unable to select specific timeline
https://bugs.webkit.org/show_bug.cgi?id=192443
<rdar://problem/46608087>

Reviewed by Joseph Pecoraro.

When determining the trailing horizontal edge for TreeElement mouse
events, TreeOutline should not assume that its containing DOM element
is only as wide as its <ol> element.

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

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

11 months agoRemove derived classes of RealtimeMediaSourceCenter
youenn@apple.com [Tue, 11 Dec 2018 03:46:19 +0000 (03:46 +0000)]
Remove derived classes of RealtimeMediaSourceCenter
https://bugs.webkit.org/show_bug.cgi?id=192546

Reviewed by Eric Carlson.

Source/WebCore:

Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
Instead port specific implementation directly implement the needed default factory methods.

Renamed some methods for improved consistency.
Moved some static variables as RealtimeMediaSourceCenter members.

No change of behavior.

* WebCore.xcodeproj/project.pbxproj:
* page/DeprecatedGlobalSettings.cpp:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
(WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::setVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
(WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::~RealtimeVideoSource):
(WebCore::RealtimeVideoSource::prepareToProduceData):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton):
(WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton):
(WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
(WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:

Source/WebKit:

pdate code according WebCore changes.

* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
(WebKit::UserMediaCaptureManager::initialize):

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

11 months agoDataChannels created asynchronously never open and are unusable
youenn@apple.com [Tue, 11 Dec 2018 03:43:38 +0000 (03:43 +0000)]
DataChannels created asynchronously never open and are unusable
https://bugs.webkit.org/show_bug.cgi?id=192566

Reviewed by Eric Carlson.

Source/WebCore:

For every new data channel (remote or local), we should check the underlying backend state.
This allows firing events if needed.
We were not always doing that which was prohibiting sending some open
events for data channels created after the SCTP connection is set up.

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
(WebCore::LibWebRTCDataChannelHandler::channelEvent):
(WebCore::LibWebRTCDataChannelHandler::setClient):
(WebCore::LibWebRTCDataChannelHandler::OnStateChange):
(WebCore::LibWebRTCDataChannelHandler::checkState):
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:

LayoutTests:

* webrtc/datachannel/basic-expected.txt:
* webrtc/datachannel/basic.html:

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

11 months agoUse WeakPtr to refer to VTTCue in VTTCueBox
rniwa@webkit.org [Tue, 11 Dec 2018 03:05:28 +0000 (03:05 +0000)]
Use WeakPtr to refer to VTTCue in VTTCueBox
https://bugs.webkit.org/show_bug.cgi?id=192575

Reviewed by Eric Carlson.

Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
This is implemented by simply using WeakPtr.

No new tests since there shoul be no behaivoral change.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::VTTCueBox):
(WebCore::VTTCueBox::getCue const):
(WebCore::VTTCueBox::applyCSSProperties):
(WebCore::VTTCue::~VTTCue):
* html/track/VTTCue.h:
(WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):

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

11 months agoPropertyAttribute needs a CustomValue bit.
mark.lam@apple.com [Tue, 11 Dec 2018 02:42:27 +0000 (02:42 +0000)]
PropertyAttribute needs a CustomValue bit.
https://bugs.webkit.org/show_bug.cgi?id=191993
<rdar://problem/46264467>

Reviewed by Saam Barati.

JSTests:

* stress/regress-191993.js: Added.

Source/JavaScriptCore:

This is because GetByIdStatus needs to distinguish CustomValue properties from
other types, and its only means of doing so is via the property's attributes.
Previously, there's nothing in the property's attributes that can indicate that
the property is a CustomValue.

We fix this by doing the following:

1. Added a PropertyAttribute::CustomValue bit.
2. Added a PropertyAttribute::CustomAccessorOrValue convenience bit mask that is
   CustomAccessor | CustomValue.

3. Since CustomGetterSetter properties are only set via JSObject::putDirectCustomAccessor(),
   we added a check in JSObject::putDirectCustomAccessor() to see if the attributes
   bits include PropertyAttribute::CustomAccessor.  If not, then the property
   must be a CustomValue, and we'll add the PropertyAttribute::CustomValue bit
   to the attributes bits.

   This ensures that the property attributes is sufficient to tell us if the
   property contains a CustomGetterSetter.

4. Updated all checks for PropertyAttribute::CustomAccessor to check for
   PropertyAttribute::CustomAccessorOrValue instead if their intent is to check
   for the presence of a CustomGetterSetter as opposed to checking specifically
   for one that is used as a CustomAccessor.

   This includes all the Structure transition code that needs to capture the
   attributes change when a CustomValue has been added.

5. Filtered out the PropertyAttribute::CustomValue bit in PropertyDescriptor.
   The fact that we're using a CustomGetterSetter as a CustomValue should remain
   invisible to the descriptor.  This is because the descriptor should describe
   a CustomValue no differently from a plain value.

6. Added some asserts to ensure that property attributes are as expected, and to
   document some invariants.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::computeFor):
* bytecode/InByIdStatus.cpp:
(JSC::InByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
* bytecode/PropertyCondition.cpp:
(JSC::PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint const):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor):
* runtime/JSFunction.cpp:
(JSC::getCalculatedDisplayName):
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomAccessor):
(JSC::JSObject::putDirectNonIndexAccessor):
(JSC::JSObject::putDirectIndexSlowOrBeyondVectorLength):
* runtime/JSObject.h:
(JSC::JSObject::putDirectIndex):
(JSC::JSObject::fillCustomGetterPropertySlot):
(JSC::JSObject::putDirect):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setDescriptor):
(JSC::PropertyDescriptor::setCustomDescriptor):
(JSC::PropertyDescriptor::setAccessorDescriptor):
* runtime/PropertySlot.h:
(JSC::PropertySlot::setCustomGetterSetter):

Source/WebCore:

This patch revealed a bug in the CodeGenerator where a constructor property is
set with a ReadOnly attribute.  This conflicts with the WebIDL link (see clause
12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
that it should be [Writable].  The ReadOnly attribute is now removed.

On the WebCore side, this change is covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):

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

11 months ago[CMake] Add ENABLE_RESOURCE_LOAD_STATISTICS to WebKitFeatures.cmake
don.olmstead@sony.com [Tue, 11 Dec 2018 01:17:17 +0000 (01:17 +0000)]
[CMake] Add ENABLE_RESOURCE_LOAD_STATISTICS to WebKitFeatures.cmake
https://bugs.webkit.org/show_bug.cgi?id=192574

Reviewed by Michael Catanzaro.

.:

* Source/cmake/WebKitFeatures.cmake:

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

11 months agoAdd test262-results directory to .gitignore.
ross.kirsling@sony.com [Tue, 11 Dec 2018 00:35:51 +0000 (00:35 +0000)]
Add test262-results directory to .gitignore.
https://bugs.webkit.org/show_bug.cgi?id=192547

Reviewed by Dean Jackson.

* .gitignore:

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

11 months agoAnimated scrolling on Google Maps scrolls the page in addition to moving the map
timothy_horton@apple.com [Tue, 11 Dec 2018 00:32:38 +0000 (00:32 +0000)]
Animated scrolling on Google Maps scrolls the page in addition to moving the map
https://bugs.webkit.org/show_bug.cgi?id=192521
<rdar://problem/46382007>

Reviewed by Sam Weinig.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollViewAnimator rubberbandableDirections]):
Only do keyboard-based rubber-banding in directions that we can actually
scroll, not directions we can only finger-rubber-band in. This effectively
means keyboard scrolling will ignore "alwaysBounce{Vertical, Horizontal}".

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

11 months agoSync FeatureList.pm
don.olmstead@sony.com [Tue, 11 Dec 2018 00:08:09 +0000 (00:08 +0000)]
Sync FeatureList.pm
https://bugs.webkit.org/show_bug.cgi?id=192565

Reviewed by Michael Catanzaro.

* Scripts/webkitperl/FeatureList.pm:

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

11 months agoRename "forced style recalc" to "full style rebuild"
antti@apple.com [Mon, 10 Dec 2018 23:56:31 +0000 (23:56 +0000)]
Rename "forced style recalc" to "full style rebuild"
https://bugs.webkit.org/show_bug.cgi?id=192572

Reviewed by Zalan Bujtas.

Source/WebCore:

The old name is confusing.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::hasValidStyleForProperty):
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRebuild):
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::unscheduleStyleRecalc):
(WebCore::Document::hasPendingStyleRebuild const):
(WebCore::Document::resolveStyle):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
(WebCore::Document::setDesignMode):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::setAnimatingFullScreen):
(WebCore::Document::setFullscreenControlsHidden):
(WebCore::Document::scheduleForcedStyleRecalc): Deleted.
(WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::needsStyleInvalidation const):
* page/Page.cpp:
(WebCore::Page::updateStyleAfterChangeInEnvironment):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView setNeedsToApplyStyles:]):

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

11 months agoUnreviewed, rolling out r239023.
commit-queue@webkit.org [Mon, 10 Dec 2018 23:36:36 +0000 (23:36 +0000)]
Unreviewed, rolling out r239023.
https://bugs.webkit.org/show_bug.cgi?id=192571

Speculative rollout due to broken perf test (Requested by
deanj on #webkit).

Reverted changeset:

"Enable HTTP and HTTPS proxies on iOS and make it a property
of the NSURLSession"
https://bugs.webkit.org/show_bug.cgi?id=192374
https://trac.webkit.org/changeset/239023

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

11 months agoLinkBuffer::copyCompactAndLinkCode() needs to be aware of ENABLE(SEPARATED_WX_HEAP).
mark.lam@apple.com [Mon, 10 Dec 2018 23:14:31 +0000 (23:14 +0000)]
LinkBuffer::copyCompactAndLinkCode() needs to be aware of ENABLE(SEPARATED_WX_HEAP).
https://bugs.webkit.org/show_bug.cgi?id=192569
<rdar://problem/45615617>

Reviewed by Saam Barati.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):

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

11 months agoInclude CoreGraphics.h from WebCorePrefix.h
ap@apple.com [Mon, 10 Dec 2018 23:05:57 +0000 (23:05 +0000)]
Include CoreGraphics.h from WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=192557

Reviewed by Tim Horton.

The theory is that this will improve build time. Let's try and see what bots say.

* WebCorePrefix.h:

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

11 months ago[iOS] Unable to upload data that conforms to "public.item" but not "public.content"
wenson_hsieh@apple.com [Mon, 10 Dec 2018 22:18:10 +0000 (22:18 +0000)]
[iOS] Unable to upload data that conforms to "public.item" but not "public.content"
https://bugs.webkit.org/show_bug.cgi?id=192555
<rdar://problem/35204990>

Reviewed by Tim Horton.

Source/WebCore:

Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only
supports data that conforms to "public.content", but there exist several types of files that conform to
"public.item" but not "public.content". See below for more detail.

Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput

* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::supportedFileUploadPasteboardTypes):

Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder"
conforms to "public.item".

* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_containsFileURLAndFileUploadContent]):

Pull out the "contains content that is supported for file uploads" part of this helper method into a separate
method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"-
conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file).
Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when
dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput
for an example of this corner case).

(-[NSItemProvider web_containsFileUploadContent]):
(-[WebItemProviderPasteboard numberOfFiles]):

Refactor this to use `-web_containsFileUploadContent`.

Tools:

Add a test to verify that `.p12` files may be uploaded as files via drag and drop. "com.rsa.pkcs-12" is an
example of a data type that conforms to "public.item", but not "public.content"; before this patch, we would
only support uploading "public.content", so files such as these would not be accepted when dropping into file
inputs, or be exposed as files on DataTransfer.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):

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

11 months agoUnreviewed, fix the iOS build after r239039.
wenson_hsieh@apple.com [Mon, 10 Dec 2018 22:10:48 +0000 (22:10 +0000)]
Unreviewed, fix the iOS build after r239039.
https://bugs.webkit.org/show_bug.cgi?id=192568

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

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

11 months agoWeb Inspector: Move TreeOutlineGroup coordination out of TreeElement
mattbaker@apple.com [Mon, 10 Dec 2018 22:03:13 +0000 (22:03 +0000)]
Web Inspector: Move TreeOutlineGroup coordination out of TreeElement
https://bugs.webkit.org/show_bug.cgi?id=192487
<rdar://problem/46543431>

Reviewed by Devin Rousso.

* UserInterface/Views/TreeElement.js:
(WI.TreeElement.prototype.select):
(WI.TreeElement.prototype.deselect):

* UserInterface/Views/TreeOutlineGroup.js:
(WI.TreeOutlineGroup):
(WI.TreeOutlineGroup.prototype.itemAdded):
(WI.TreeOutlineGroup.prototype.itemRemoved):
(WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections):
(WI.TreeOutlineGroup.prototype._treeOutlineSelectionDidChange):
(WI.TreeOutlineGroup.groupForTreeOutline): Deleted.
(WI.TreeOutlineGroup.prototype.didSelectTreeElement): Deleted.
make the group responsible for listening to selection changes from the
TreeOutlines it manages, and synchronizing the selection between them.

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

11 months agoInjected bundle for WebKitTestRunner leaks WKTypeRef objects
ddkilzer@apple.com [Mon, 10 Dec 2018 21:55:56 +0000 (21:55 +0000)]
Injected bundle for WebKitTestRunner leaks WKTypeRef objects
<https://webkit.org/b/192481>
<rdar://problem/46539059>

Follow-up to address Darin's feedback.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::shouldDumpPixels const):
(WTR::TestRunner::whatToDump const):
(WTR::TestRunner::shouldWaitUntilDone const):
(WTR::TestRunner::shouldDumpFrameLoadCallbacks):
(WTR::TestRunner::didReceiveServerRedirectForProvisionalNavigation const):
(WTR::TestRunner::secureEventInputIsEnabled const):
(WTR::TestRunner::isStatisticsPrevalentResource):
(WTR::TestRunner::isStatisticsVeryPrevalentResource):
(WTR::TestRunner::isStatisticsRegisteredAsSubresourceUnder):
(WTR::TestRunner::isStatisticsRegisteredAsSubFrameUnder):
(WTR::TestRunner::isStatisticsRegisteredAsRedirectingTo):
(WTR::TestRunner::isStatisticsHasHadUserInteraction):
(WTR::TestRunner::isStatisticsGrandfathered):
(WTR::TestRunner::hasDOMCache):
(WTR::TestRunner::keyExistsInKeychain):

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

11 months agoFix WatchOS build.
achristensen@apple.com [Mon, 10 Dec 2018 21:50:11 +0000 (21:50 +0000)]
Fix WatchOS build.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionNameForFocusedFormControlView:]):

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

11 months agowebkitpy: Ref tests don't respect platform specific expectations
jbedard@apple.com [Mon, 10 Dec 2018 21:48:13 +0000 (21:48 +0000)]
webkitpy: Ref tests don't respect platform specific expectations
https://bugs.webkit.org/show_bug.cgi?id=192515
<rdar://problem/46564839>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/port/base.py:
(Port._expected_baselines_for_suffixes): Accept multiple suffixes so ref tests can use this function.
(Port.expected_baselines): Move implementation to _expected_baselines_for_suffixes.
(Port.expected_filename): Remove irrelevant FIXME, code clean-up.
(Port.reference_files): Instead of just searching a single directory, use _expected_baselines_for_suffixes to
search all platform expectations as well.
* Scripts/webkitpy/port/base_unittest.py:
(test_ref_tests_platform_directory):

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

11 months agoUnreviewed, rolling out r239029.
jlewis3@apple.com [Mon, 10 Dec 2018 21:30:42 +0000 (21:30 +0000)]
Unreviewed, rolling out r239029.

This patch caused internal build failures.

Reverted changeset:

"[meta][WebKit] Remove using namespace WebCore and WebKit in
the global scope for unified source builds"
https://bugs.webkit.org/show_bug.cgi?id=192449
https://trac.webkit.org/changeset/239029

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

11 months agoAdd SPI to allow the client to set the user-agent at main frame level, from the UIProcess
cdumez@apple.com [Mon, 10 Dec 2018 21:26:39 +0000 (21:26 +0000)]
Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192509
<rdar://problem/46500832>

Reviewed by Alex Christensen.

Source/WebCore:

* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomUserAgent):
(WebCore::DocumentLoader::customUserAgent const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgent const):

Source/WebKit:

Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing
it at resource-level from the injected bundle.

The custom user-agent string can now be set on _WKWebsitePolicies during the
decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its
future subresource loads.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setCustomUserAgent:]):
(-[_WKWebsitePolicies customUserAgent]):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[DataMappingSchemeHandler addMappingFromURLString:toData:]):
(-[DataMappingSchemeHandler webView:startURLSchemeTask:]):
(-[DataMappingSchemeHandler webView:stopURLSchemeTask:]):
(-[CustomUserAgentDelegate _webView:decidePolicyForNavigationAction:userInfo:decisionHandler:]):
(-[CustomUserAgentDelegate webView:didFinishNavigation:]):

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

11 months ago[BigInt] Add ValueMul into DFG
ticaiolima@gmail.com [Mon, 10 Dec 2018 21:11:43 +0000 (21:11 +0000)]
[BigInt] Add ValueMul into DFG
https://bugs.webkit.org/show_bug.cgi?id=186175

Reviewed by Yusuke Suzuki.

JSTests:

* stress/big-int-mul-jit-osr.js: Added.
* stress/big-int-mul-jit-untyped.js: Added.
* stress/value-mul-fixup-int32-big-int.js: Added.

PerformanceTests:

* BigIntBench/big-int-simple-mul.js: Added.
* BigIntBench/value-mul-type-propagation.js: Added.

Source/JavaScriptCore:

This patch is adding a new DFG node called ValueMul. This node is
responsible to handle multiplication operations that can result into
non-number values. We emit such node during DFGByteCodeParser when the
operands are not numbers. During FixupPhase, we change this
operation to ArithMul if we can speculate Number/Boolean operands.

The BigInt specialization shows a small progression:

                        noSpec                changes

big-int-simple-mul  18.8090+-1.0435  ^  17.4305+-0.2673  ^ definitely 1.0791x faster

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupMultiplication):
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::arithNodeFlags):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileValueMul):
(JSC::DFG::SpeculativeJIT::compileArithMul):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileValueMul):
(JSC::FTL::DFG::LowerDFGToB3::compileArithMul):

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

11 months agoSafe browsing warning should layout buttons vertically in narrow WKWebViews
achristensen@apple.com [Mon, 10 Dec 2018 20:56:52 +0000 (20:56 +0000)]
Safe browsing warning should layout buttons vertically in narrow WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=192535
<rdar://problem/46308364>

Reviewed by Tim Horton.

They're usually next to each other, but in narrow WKWebViews they currently get clipped.
In order to make it more likely that both buttons are completely visible, put one above
the other if the WKWebView is too narrow to completely show both.  This also helps with
languages where the translations of "Go Back" or "Show Details" are rendered wider than English.

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(buttonWidth):
(-[WKSafeBrowsingWarning addContent]):

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

11 months ago[GLib] FileSystem::moveFile() should fall back to copying
aperez@igalia.com [Mon, 10 Dec 2018 20:46:29 +0000 (20:46 +0000)]
[GLib] FileSystem::moveFile() should fall back to copying
https://bugs.webkit.org/show_bug.cgi?id=192562

Reviewed by Michael Catanzaro.

No new tests needed.

* platform/glib/FileSystemGlib.cpp:
(WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which
provides a fall-back which does copy+delete when a direct move or rename cannot be done.

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

11 months agoAllow control over child order when adding nodes to the scrolling tree
simon.fraser@apple.com [Mon, 10 Dec 2018 20:43:40 +0000 (20:43 +0000)]
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
<rdar://problem/46542237>

Re-land r239010 after over-zealous rollout.

Source/WebCore:

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::attachToStateTree):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::attachToStateTree):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::indexOfChild const):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingStateTree.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode):

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

11 months agoDocument should throttle style recalc even when m_pendingStyleRecalcShouldForce is...
antti@apple.com [Mon, 10 Dec 2018 20:42:53 +0000 (20:42 +0000)]
Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true.
https://bugs.webkit.org/show_bug.cgi?id=191695

Reviewed by Zalan Bujtas.

* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):

Don't test for m_pendingStyleRecalcShouldForce.

(WebCore::Document::hasPendingStyleRecalc const):
(WebCore::Document::hasPendingForcedStyleRecalc const):

Don't base the pending status of these function on whether the timer is running.
Instead check if the style is invalid.

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

11 months agoXMLHttpRequest removes spaces from content-types before processing
commit-queue@webkit.org [Mon, 10 Dec 2018 20:31:18 +0000 (20:31 +0000)]
XMLHttpRequest removes spaces from content-types before processing
https://bugs.webkit.org/show_bug.cgi?id=8644

Patch by Rob Buis <rbuis@igalia.com> on 2018-12-10
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Update improved test expectations.

* web-platform-tests/mimesniff/mime-types/parsing.any-expected.txt:
* web-platform-tests/mimesniff/mime-types/parsing.any.worker-expected.txt:

Source/WebCore:

Stop trimming white space characters from the middle of
type/subtype value. Also make sure whitespace being parsed
adheres to OWS definition from RFC 7230 Section 3.2.3
(referenced by RFC 7231), i.e. space or HT.

Based on http://crrev.com/416586.

Behavior matches Firefox and Chrome.

Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
       web-platform-tests/mimesniff/mime-types/parsing.any.html
       web-platform-tests/mimesniff/mime-types/parsing.any.worker.html

* platform/network/HTTPParsers.cpp:
(WebCore::extractMIMETypeFromMediaType):

LayoutTests:

Update improved test expectation and remove comment.

* http/tests/xmlhttprequest/supported-xml-content-types-expected.txt:
* http/tests/xmlhttprequest/supported-xml-content-types.html:

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

11 months ago[iOS] Caret is obscured by finger when dragging over an editable element
wenson_hsieh@apple.com [Mon, 10 Dec 2018 20:27:59 +0000 (20:27 +0000)]
[iOS] Caret is obscured by finger when dragging over an editable element
https://bugs.webkit.org/show_bug.cgi?id=192499
<rdar://problem/46570101>

Reviewed by Tim Horton.

Source/WebCore:

* page/DragActions.h:

Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes
use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for
DragHandlingMethod so that it may be encoded over IPC.

* page/DragController.cpp:
(WebCore::dragIsHandledByDocument):

Simplify this helper function.

(WebCore::DragController::tryDocumentDrag):
* page/DragController.h:

Expose the current DragHandlingMethod via a const getter method.

(WebCore::DragController::dragHandlingMethod const):

Source/WebKit:

Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area.
When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop
caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes
are covered by adding to existing API tests.

* Scripts/webkit/messages.py:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and
returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based
compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can
be easily removed once Safari adopts this new version.

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

Add plumbing to send the latest drag handling method from WebPage to WebPageProxy.

(WebKit::WebPageProxy::resetCurrentDragInformation):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::currentDragHandlingMethod const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:sessionDidUpdate:]):

Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the
`precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or
"editing plain text".

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/WebPage.h:

Tools:

Augment some existing API tests to check that the `precise` flag is either on or off on `UIDropProposal`.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator lastKnownDropProposal]):

Rename `currentDropProposal` to `lastKnownDropProposal`, and expose it as a readonly property.

(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
(-[DragAndDropSimulator _advanceProgress]):
(-[DragAndDropSimulator setShowCustomActionSheetBlock:]):
(-[DragAndDropSimulator showCustomActionSheetBlock]):
(-[DragAndDropSimulator setConvertItemProvidersBlock:]):
(-[DragAndDropSimulator convertItemProvidersBlock]):
(-[DragAndDropSimulator setOverridePerformDropBlock:]):
(-[DragAndDropSimulator overridePerformDropBlock]):
(-[DragAndDropSimulator setOverrideDragUpdateBlock:]):
(-[DragAndDropSimulator overrideDragUpdateBlock]):
(-[DragAndDropSimulator setDropCompletionBlock:]):
(-[DragAndDropSimulator dropCompletionBlock]):

Refactor these properties to return and take normal Objective-C blocks, rather than `BlockPtr`s. However, use
`BlockPtr` instance variables to manage the lifetimes of these blocks.

(-[DragAndDropSimulator _webView:willUpdateDropProposalToProposal:forSession:]):
(-[DragAndDropSimulator _webView:willUpdateDataInteractionOperationToOperation:forSession:]): Deleted.

Update this to use the new WebKit delegate hook for overriding the drop proposal.

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

11 months agoMake mock capture happen in the process used for real capture
youenn@apple.com [Mon, 10 Dec 2018 19:53:43 +0000 (19:53 +0000)]
Make mock capture happen in the process used for real capture
https://bugs.webkit.org/show_bug.cgi?id=192544

Reviewed by Eric Carlson.

Source/WebCore:

MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on.
Add booleans to choose which source (audio, video, display) will actually be toggled on.

Covered by existing tests.

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
* platform/mock/MockRealtimeMediaSourceCenter.h:
(WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled):
(WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled):
(WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled):

Source/WebKit:

Make mock capture happen in the right process by only overriding
factories by mock factories for source types that UserMediaCaptureManager will not override.
That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture.

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::initialize):

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

11 months agoUse text/javascript as recommended by the HTML specification
dino@apple.com [Mon, 10 Dec 2018 19:45:45 +0000 (19:45 +0000)]
Use text/javascript as recommended by the HTML specification
https://bugs.webkit.org/show_bug.cgi?id=192525
<rdar://problem/46569636>

Reviewed by Jon Lee.

The HTML specification says we should use text/javascript for
JavaScript files:
https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type

Source/WebCore:

* loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript.
(WebCore::CachedScript::CachedScript):
* platform/network/ios/WebCoreURLResponseIOS.mm: Ditto.
(WebCore::createExtensionToMIMETypeMap):
* platform/network/mac/WebCoreURLResponse.mm: Ditto.
(WebCore::createExtensionToMIMETypeMap):

Source/WebInspectorUI:

* UserInterface/Base/MIMETypeUtilities.js:
(WI.mimeTypeForFileExtension):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype._attemptToDetermineMIMEType):

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

11 months ago[iOS] Make WebGPU work with remote layer hosting
dino@apple.com [Mon, 10 Dec 2018 19:37:49 +0000 (19:37 +0000)]
[iOS] Make WebGPU work with remote layer hosting
https://bugs.webkit.org/show_bug.cgi?id=192508
<rdar://problem/46560649>

Reviewed by Tim Horton.

WebGPU wasn't working on iOS because we were not correctly
identifying the CALayers for remote hosting. Fix this by
adding a new CALayer type, WebGPULayer. This will also
eventually hold the code to render WebGPU into a canvas.

Covered by the existing reference tests (on device).

* SourcesCocoa.txt: Add new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
class for remote hosting.
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):

* platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
from CAMetalLayer.
* platform/graphics/cocoa/WebGPULayer.mm: Added.
(-[WebGPULayer init]):
(-[WebGPULayer copyImageSnapshotWithColorSpace:]):

* platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
than CALayer.

* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
the WebGPULayer has a reference back to this object, which it
will use in the future.
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):

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

11 months agoMove ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
ap@apple.com [Mon, 10 Dec 2018 18:06:37 +0000 (18:06 +0000)]
Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h
https://bugs.webkit.org/show_bug.cgi?id=192428

Reviewed by Tim Horton.

Source/WebKit:

* config.h:

Source/WTF:

* wtf/Platform.h:

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

11 months agoMove more macros out of WebKit's config.h
ap@apple.com [Mon, 10 Dec 2018 17:55:34 +0000 (17:55 +0000)]
Move more macros out of WebKit's config.h
https://bugs.webkit.org/show_bug.cgi?id=192430

Reviewed by Tim Horton.

Source/WebKit:

* config.h:

Source/WTF:

* wtf/Platform.h:

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

11 months ago[macOS] MSHCreateMIGServerSource invocation does not handle send/receive rights correctly
cdumez@apple.com [Mon, 10 Dec 2018 17:51:08 +0000 (17:51 +0000)]
[macOS] MSHCreateMIGServerSource invocation does not handle send/receive rights correctly
https://bugs.webkit.org/show_bug.cgi?id=192533
rdar://problem/45732710

Patch by Darin Adler <darin@apple.com> on 2018-12-10
Reviewed by Anders Carlsson.

Source/WebCore/PAL:

* pal/spi/mac/HIServicesSPI.h: Added kMSHDoNotCreateSendRightOption.

Source/WebKitLegacy/mac:

* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): Pass kMSHDoNotCreateSendRightOption.

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

11 months ago[macOS] Use mach_port_mod_refs instead of mach_port_destroy
cdumez@apple.com [Mon, 10 Dec 2018 17:50:38 +0000 (17:50 +0000)]
[macOS] Use mach_port_mod_refs instead of mach_port_destroy
https://bugs.webkit.org/show_bug.cgi?id=192532
rdar://problem/45731047

Patch by Darin Adler <darin@apple.com> on 2018-12-10
Reviewed by Chris Dumez.

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::hostForPlugin): Use mach_port_mod_refs.
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): Ditto.

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

11 months agoUnreviewed, rolling out r238965.
tsavell@apple.com [Mon, 10 Dec 2018 17:17:26 +0000 (17:17 +0000)]
Unreviewed, rolling out r238965.

Caused internal iOS build failures

Reverted changeset:

"[iOS] Make WebGPU work with remote layer hosting"
https://bugs.webkit.org/show_bug.cgi?id=192508
https://trac.webkit.org/changeset/238965

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

11 months agoMockLibWebRTCPeerConnectionFactory should isolate copy its test case
youenn@apple.com [Mon, 10 Dec 2018 16:30:53 +0000 (16:30 +0000)]
MockLibWebRTCPeerConnectionFactory should isolate copy its test case
https://bugs.webkit.org/show_bug.cgi?id=192545

Reviewed by Eric Carlson.

Isolate copy the test case member so that it can be destroyed on another thread.
Covered by existing test that should no longer crash.

* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::useMockRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockLibWebRTCPeerConnectionFactory::create):

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

11 months ago[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for...
cfleizach@apple.com [Mon, 10 Dec 2018 16:07:28 +0000 (16:07 +0000)]
[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds
https://bugs.webkit.org/show_bug.cgi?id=192449

Reviewed by Darin Adler.

* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
* NetworkProcess/ios/NetworkProcessIOS.mm:
* NetworkProcess/mac/NetworkProcessMac.mm:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
* Platform/spi/ios/AccessibilitySupportSPI.h:
* PlatformMac.cmake:
* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginProcess.cpp:
* PluginProcess/WebProcessConnection.cpp:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
(WKErrorCopyCFError):
* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateCGImage):
(WKImageCreateFromCGImage):
* Shared/ChildProcess.cpp:
* Shared/ContextMenuContextData.cpp:
* Shared/EditorState.cpp:
* Shared/Plugins/NPIdentifierData.cpp:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
* Shared/SessionState.cpp:
* Shared/SessionTracker.cpp:
* Shared/ShareableBitmap.cpp:
* Shared/ShareableResource.cpp:
* Shared/VisibleContentRectUpdateInfo.cpp:
* Shared/WebBackForwardListItem.cpp:
* Shared/WebContextMenuItemData.cpp:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebHitTestResultData.cpp:
* Shared/WebImage.cpp:
* Shared/WebMediaSessionMetadata.cpp:
* Shared/WebMemorySampler.cpp:
* Shared/WebMouseEvent.cpp:
* Shared/WebRenderObject.cpp:
* Shared/WebSQLiteDatabaseTracker.cpp:
* Shared/WebWheelEvent.cpp:
* Shared/cf/ArgumentCodersCF.cpp:
* Shared/ios/WebPlatformTouchPointIOS.cpp:
* SourcesCocoa.txt:
* UIProcess/API/APIContentRuleListStore.cpp:
* UIProcess/API/APIHitTestResult.cpp:
* UIProcess/API/APINavigation.cpp:
* UIProcess/API/APIOpenPanelParameters.cpp:
* UIProcess/API/APIPageConfiguration.cpp:
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadURLWithShouldOpenExternalURLsPolicy):
(WKPageLoadURLWithUserData):
(WKPageLoadURLRequestWithUserData):
(WKPageSetPaginationMode):
(WKPageGetPaginationMode):
(WKPageSetPageLoaderClient):
(WKPageSetPagePolicyClient):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
* UIProcess/WebStorage/LocalStorageDatabase.cpp:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
(-[WKContentView initWithFrame:processPool:configuration:webView:]):
(-[WKContentView dealloc]):
(-[WKContentView page]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _updateForScreen:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _createDrawingAreaProxy]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView _wk_pageCountForPrintFormatter:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
(hasAssistedNode):
(-[WKContentView setupInteraction]):
(-[WKContentView positionInformation]):
(-[WKContentView _webTouchEventsRecognized:]):
(inflateQuad):
(-[WKContentView _updateTapHighlight]):
(-[WKContentView _showTapHighlight]):
(-[WKContentView _requiresKeyboardWhenFirstResponder]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView inputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView currentPositionInformation]):
(-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
(-[WKContentView _currentPositionInformationIsValidForRequest:]):
(-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
(-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRectsForSelectionRects:]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _stylusSingleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _positionInformationDidChange:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView supportedPasteboardTypesForCurrentSelection]):
(-[WKContentView _lookupForWebView:]):
(-[WKContentView _shareForWebView:]):
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView selectForWebView:]):
(-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
(-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
(toGestureType):
(toUIWKGestureType):
(toSelectionTouch):
(toUIWKSelectionTouch):
(toGestureRecognizerState):
(toUIGestureRecognizerState):
(toUIWKSelectionFlags):
(toWKTextGranularity):
(toWKSelectionDirection):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
(-[WKContentView autocorrectionData]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView _updateAccessory]):
(-[WKContentView selectedTextRange]):
(-[WKContentView setMarkedText:selectedRange:]):
(coreWritingDirection):
(-[WKContentView closestPositionToPoint:]):
(-[WKContentView insertText:]):
(-[WKContentView textInputTraits]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
(-[WKContentView isScrollableForKeyboardScrollViewAnimator:]):
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]):
(-[WKContentView assistedNodeInformation]):
(-[WKContentView assistedNodeSelectOptions]):
(isAssistableInputType):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView updateCurrentAssistedNodeInformation:]):
(-[WKContentView presentViewControllerForCurrentAssistedNode]):
(-[WKContentView actionNameForFocusedFormControlView:]):
(-[WKContentView selectWordForReplacement]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _beginSuppressingSelectionAssistantForReason:]):
(-[WKContentView _stopSuppressingSelectionAssistantForReason:]):
(-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
(-[WKContentView _showRunOpenPanel:resultListener:]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _startDrag:item:]):
(-[WKContentView _didHandleAdditionalDragItemsRequest:]):
(-[WKContentView _didHandleStartDataInteractionRequest:]):
(dropOperationForWebCoreDragOperation):
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
(-[WKContentView _didConcludeEditDataInteraction:]):
(-[WKContentView _didPerformDragOperation:]):
(-[WKContentView _prepareToDragPromisedAttachment:]):
(-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
(-[WKContentView _autofillContext]):
(-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView dragInteraction:itemsForBeginningSession:]):
(-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
(-[WKContentView dragInteraction:session:didEndWithOperation:]):
(-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:sessionDidEnd:]):
(-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
(-[WKContentView shouldDisplayInputContextViewForListViewController:]):
(-[WKContentView numericInputModeForListViewController:]):
(-[WKContentView textContentTypeForListViewController:]):
(-[WKContentView allowsDictationInputForListViewController:]):
(-[WKContentView _simulateLongPressActionAtLocation:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _presentationRectsForPreviewItemController:]):
* UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
(WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
(WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
(-[WKFullScreenViewController videoControlsManagerDidChange]):
(-[WKFullScreenViewController _manager]):
(-[WKFullScreenViewController _togglePiPAction:]):
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
(-[WKFullScreenWindowController isFullScreen]):
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
(-[WKFullScreenWindowController _completedExitFullScreen]):
(-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
(-[WKFullScreenWindowController _manager]):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate initWithLayerID:layerTreeHost:]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):

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

11 months ago[WPE][GTK] run-minibrowser improperly creates webkit-flatpak environment
mcatanzaro@igalia.com [Mon, 10 Dec 2018 14:58:31 +0000 (14:58 +0000)]
[WPE][GTK] run-minibrowser improperly creates webkit-flatpak environment
https://bugs.webkit.org/show_bug.cgi?id=190241

Reviewed by Carlos Garcia Campos.

run-minibrowser calls into webkit-flatpak to check if a flatpak environment is available.
Currently this actually creates the directories needed for the flatpak environment. Fix it.

* flatpak/flatpakutils.py:
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run):

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

11 months ago[GTK] Don't use the slice allocator
mcatanzaro@igalia.com [Mon, 10 Dec 2018 14:56:16 +0000 (14:56 +0000)]
[GTK] Don't use the slice allocator
https://bugs.webkit.org/show_bug.cgi?id=192360

Reviewed by Carlos Garcia Campos.

* MiniBrowser/gtk/main.c:
(aboutDataRequestFree):
(aboutDataRequestNew):

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

11 months agoWKWebView should support custom tintColor
timothy_horton@apple.com [Mon, 10 Dec 2018 09:05:01 +0000 (09:05 +0000)]
WKWebView should support custom tintColor
https://bugs.webkit.org/show_bug.cgi?id=192518
<rdar://problem/37243261>

Reviewed by Wenson Hsieh.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertionPointColor]):
(-[WKContentView selectionBarColor]):
(-[WKContentView selectionHighlightColor]):
Grab insertion point and selection colors from UITextInputTraits.

(-[WKContentView _updateInteractionTintColor]):
Determine our effective tint color:
    - transparent if interaction is disabled
    - a CSS-derived color if caret-color style is applied
    - the _inheritedInteractionTintColor, which climbs up to the tintColor API
Apply it to our UITextInputTraits.

(-[WKContentView tintColorDidChange]):
(-[WKContentView textInputTraits]):
Call _updateInteractionTintColor whenever we create a new UITextInputTraits
or when the tint color changes.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SystemColors.mm:
(TestWebKitAPI::TEST):
Add a test that tintColor affects UITextInputTraits' interaction colors.

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

11 months ago[iOS] DragAndDropTests.RespectsExternalSourceFidelityRankings is flaky
wenson_hsieh@apple.com [Mon, 10 Dec 2018 07:54:16 +0000 (07:54 +0000)]
[iOS] DragAndDropTests.RespectsExternalSourceFidelityRankings is flaky
https://bugs.webkit.org/show_bug.cgi?id=192524

Reviewed by Ryosuke Niwa.

This test started failing on certain builds of iOS where UIKit now attempts to reveal the selection by scrolling
(see <rdar://problem/28300343>). This API test simulates two drops from external sources, both from the point
(300, 400) to (100, 300) in window coordinates. On these aforementioned builds of iOS, what happens is that the
first drop inserts text that overflows the editable region by an enormous amount, which creates an extremely
wide selection rect and increases the width of the document; revealing this selection causes the web view to
scroll horizontally, such that the second attempt to simulate a drag from (300, 400) to (100, 300) fails, since
these window coordinates no longer correspond to the drop destination element in the document.

To fix this test, we simply mark the drop destination as `overflow: hidden` to ensure that we don't try and
scroll horizontally after the first drop.

* TestWebKitAPI/Tests/WebKitCocoa/autofocus-contenteditable.html:

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

11 months agoMove capture manager from RealtimeMediaSourceCenter to capture factory
youenn@apple.com [Mon, 10 Dec 2018 05:30:23 +0000 (05:30 +0000)]
Move capture manager from RealtimeMediaSourceCenter to capture factory
https://bugs.webkit.org/show_bug.cgi?id=192542

Reviewed by Eric Carlson.

Source/WebCore:

We should be able to run mock captures in wither UIProcess or WebProcess.
Currently, mock capture is only done in WebProcess.
This patch is a first step towards that goal.

It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods.
Further refactoring will remove the need to subclass RealtimeMediaSourceCenter.
Instead, remaining virtual methods will become non virtual and their
implementation will become port specific.

Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter.

No visible change of behavior.
Covered by existing tests.

* platform/mediastream/CaptureDeviceManager.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton):
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
(WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoFactory):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
(WebCore::MockRealtimeMediaSourceCenter::audioCaptureDeviceManager):
(WebCore::MockRealtimeMediaSourceCenter::videoCaptureDeviceManager):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureDeviceManager):
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

Make sure to unregister for video capture as done for other capture types.
Implement manager which should be doing nothing as the manager is used for enumeration of devices
which should only happen in UIProcess.

Given that mock capture is interfering with UserMediaCaptureManager,
switching on/off mock capture will require creating a new process.
This shortcoming should be fixed once mock capture will be fully happening in
the same process as regular capture.

* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::~UserMediaCaptureManager):
* WebProcess/cocoa/UserMediaCaptureManager.h:

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

11 months agoEnable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
sbarati@apple.com [Mon, 10 Dec 2018 01:56:16 +0000 (01:56 +0000)]
Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession
https://bugs.webkit.org/show_bug.cgi?id=192374
<rdar://problem/46506286>

Reviewed by Alex Christensen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
Remove the now-unused SPI declaration.

Source/WebKit:

This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well.
To enable on iOS, you can do something like:
$ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080"
$ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080"

This patch also changes the Proxy to be enabled on a per NSURLSession
basis instead of a per process basis.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::privateSessionParameters):
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::proxyDictionary):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::overrideSystemProxies): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _initWithConfiguration:]):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
(-[_WKWebsiteDataStoreConfiguration httpProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]):
(-[_WKWebsiteDataStoreConfiguration httpsProxy]):
(-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::copy):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
(WebKit::WebsiteDataStoreConfiguration::httpProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPProxy):
(WebKit::WebsiteDataStoreConfiguration::httpsProxy const):
(WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy):

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

11 months agoBuild failure due to missing include of APIWebsiteDataStore.h
aperez@igalia.com [Sun, 9 Dec 2018 20:17:18 +0000 (20:17 +0000)]
Build failure due to missing include of APIWebsiteDataStore.h
https://bugs.webkit.org/show_bug.cgi?id=192541

Reviewed by Youenn Fablet.

* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing
include of APIWebsiteDataStore.h

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

11 months agoUnreviewed, fix build failure on GCC 8.2, part 2
yusukesuzuki@slowstart.org [Sun, 9 Dec 2018 16:43:02 +0000 (16:43 +0000)]
Unreviewed, fix build failure on GCC 8.2, part 2

Add RefCountedArray::assign, and use it instead of operator= internally.
We should have operator=(const RefCountedArray&) since it will be automatically generated
if we do not have correct implementation here.

* wtf/RefCountedArray.h:
(WTF::RefCountedArray::operator=):
(WTF::RefCountedArray::assign):

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

11 months agoUnreviewed, fix build failure on GCC 8.2
yusukesuzuki@slowstart.org [Sun, 9 Dec 2018 16:09:07 +0000 (16:09 +0000)]
Unreviewed, fix build failure on GCC 8.2

We remove operator=<PtrTraits> call since it is not necessary.
This is a workaround. It seems that GCC 8.2 fails to parse this specialization.

* wtf/RefCountedArray.h:

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

11 months ago[iOS device] Crash when attempting to call -[_WKAttachment info] for an editable...
wenson_hsieh@apple.com [Sun, 9 Dec 2018 09:05:45 +0000 (09:05 +0000)]
[iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image
https://bugs.webkit.org/show_bug.cgi?id=192538

Reviewed by Tim Horton.

Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a
`RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the
iOS simulator; instead, I manually verified using MobileAttachments.app.

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView renderedDrawing]):

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

11 months agoUnreviewed, rolling out r239010.
commit-queue@webkit.org [Sun, 9 Dec 2018 08:00:32 +0000 (08:00 +0000)]
Unreviewed, rolling out r239010.
https://bugs.webkit.org/show_bug.cgi?id=192537

Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
scrolling-layers-state.html again (Requested by ap on
#webkit).

Reverted changeset:

"Allow control over child order when adding nodes to the
scrolling tree"
https://bugs.webkit.org/show_bug.cgi?id=176914
https://trac.webkit.org/changeset/239010

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

11 months agoFix stray-semicolon warning seen with a new version of clang in Xcode
darin@apple.com [Sun, 9 Dec 2018 07:09:09 +0000 (07:09 +0000)]
Fix stray-semicolon warning seen with a new version of clang in Xcode
https://bugs.webkit.org/show_bug.cgi?id=192534

Reviewed by Alexey Proskuryakov.

* wtf/Lock.h: Removed an unneeded semicolon.

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

11 months ago[MediaStream] Scaled video frames should be resized in letterbox mode
eric.carlson@apple.com [Sun, 9 Dec 2018 05:36:43 +0000 (05:36 +0000)]
[MediaStream] Scaled video frames should be resized in letterbox mode
https://bugs.webkit.org/show_bug.cgi?id=192528
<rdar://problem/46576638>

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/mediastream/resize-letterbox.html

* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT): Use letterbox resize mode, not trim.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::captureSize const): "Capture" at the preset size, not
necessarily at the requested size to be more like a physical camera.
(WebCore::MockRealtimeVideoSource::settingsDidChange):
(WebCore::MockRealtimeVideoSource::drawAnimation):
(WebCore::MockRealtimeVideoSource::drawBoxes):
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::generateFrame):
(WebCore::MockRealtimeVideoSource::imageBuffer const):
* platform/mock/MockRealtimeVideoSource.h:

LayoutTests:

* fast/mediastream/resize-letterbox-expected.txt: Added.
* fast/mediastream/resize-letterbox.html: Added.

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

11 months agoDon't programmatically capitalize safe browsing warning buttons
achristensen@apple.com [Sun, 9 Dec 2018 04:11:48 +0000 (04:11 +0000)]
Don't programmatically capitalize safe browsing warning buttons
https://bugs.webkit.org/show_bug.cgi?id=192531
<rdar://problem/46417791>

Reviewed by Darin Adler.

Source/WebCore:

This doesn't work so well in other languages.
Capitalize the source strings in English instead.

* en.lproj/Localizable.strings:

Source/WebKit:

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(makeButton):

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

11 months agoSafe browsing warning should respect text size from settings
achristensen@apple.com [Sun, 9 Dec 2018 01:55:52 +0000 (01:55 +0000)]
Safe browsing warning should respect text size from settings
https://bugs.webkit.org/show_bug.cgi?id=192205

Reviewed by Tim Horton.

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(fontWithSize):
(makeButton):
(-[WKSafeBrowsingWarning addContent]):
(-[WKSafeBrowsingWarning showDetailsClicked]):

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

11 months agoReduce size of PropertySlot and PutPropertySlot.
mark.lam@apple.com [Sat, 8 Dec 2018 23:53:29 +0000 (23:53 +0000)]
Reduce size of PropertySlot and PutPropertySlot.
https://bugs.webkit.org/show_bug.cgi?id=192526

Reviewed by Keith Miller.

With some minor adjustments, we can reduce the size of PropertySlot from 80 bytes
(19 padding bytes) to 64 bytes (3 padding bytes), and PutPropertySlot from 40
bytes (4 padding bytes) to 32 bytes (0 padding bytes but with 6 unused bits).
These measurements are for a 64-bit build.

* runtime/PropertySlot.h:
* runtime/PutPropertySlot.h:
(JSC::PutPropertySlot::PutPropertySlot):

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

11 months ago[WTF] Debug build fails due conflicting abort() method
aperez@igalia.com [Sat, 8 Dec 2018 22:10:37 +0000 (22:10 +0000)]
[WTF] Debug build fails due conflicting abort() method
https://bugs.webkit.org/show_bug.cgi?id=192491

Reviewed by Michael Catanzaro.

* wtf/Assertions.h: Use namespaced std::abort() insted of plain abort() to avoid clashes
inside classes which have an ::abort() method, but only when __cplusplus is defined to
allow inclusion of the header in plain C sources.

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

11 months agoFix lldb_webkit.py following r238771
dbates@webkit.org [Sat, 8 Dec 2018 21:53:28 +0000 (21:53 +0000)]
Fix lldb_webkit.py following r238771
(https://bugs.webkit.org/show_bug.cgi?id=190234)

Substitute WTFURLProvider for WebCoreURLProvider in one call site that was inadvertently
missed in r238771.

* lldb/lldb_webkit.py:
(WebCoreDocumentProvider.url):

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

11 months agoAllow control over child order when adding nodes to the scrolling tree
simon.fraser@apple.com [Sat, 8 Dec 2018 21:08:17 +0000 (21:08 +0000)]
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
<rdar://problem/46542237>

Source/WebCore:

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

Based on an earlier patch by Simon Fraser.

Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
but with no control over sibling order. To allow for correct hit-testing overflow and
frame scrolling nodes, we have to build the scrolling tree in z-order.

This patch adds a 'childIndex' parameter to attachNode() which gives control over
sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
for childIndex so the current behavior (appending new nodes at the end of child list) is
preserved.

One test marked as flakey, since scrolling tree order is currently dependent on HashSet
traversal order.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::attachToStateTree):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::attachToStateTree):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::indexOfChild const):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingStateTree.h:

Source/WebKit:

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

Based on an earlier patch by Simon Fraser.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingCoordinatorTransaction::decode):

LayoutTests:

Reviewed by Simon Fraser.

* platform/mac-wk2/TestExpectations: Mark fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html
as flakey, which it will be until we attach in z-order.

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

11 months agoRecord right offset with aligned wide instructions
dinfuehr@igalia.com [Sat, 8 Dec 2018 14:57:51 +0000 (14:57 +0000)]
Record right offset with aligned wide instructions
https://bugs.webkit.org/show_bug.cgi?id=192006

Reviewed by Yusuke Suzuki.

Aligning bytecode instructions inserts nops into the instruction stream.
Emitting an instruction did not record the actual start of the instruction with
aligned instructions, but the nop just before the actual instruction. This was
problematic with the StaticPropertyAnalyzer that used the wrong instruction offset.

* bytecode/InstructionStream.h:
(JSC::InstructionStream::MutableRef::clone):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::alignWideOpcode):
(JSC::BytecodeGenerator::emitCreateThis):
(JSC::BytecodeGenerator::emitNewObject):
* generator/Opcode.rb:

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

11 months ago[ews-build] check-patch-relevance failure should not mark the overall build as failure
aakash_jain@apple.com [Sat, 8 Dec 2018 13:02:47 +0000 (13:02 +0000)]
[ews-build] check-patch-relevance failure should not mark the overall build as failure
https://bugs.webkit.org/show_bug.cgi?id=192510

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/steps.py:
(CheckPatchRelevance.start):

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

11 months agoRemove unused API in NetworkProcess
commit-queue@webkit.org [Sat, 8 Dec 2018 07:35:47 +0000 (07:35 +0000)]
Remove unused API in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=192415

Patch by Rob Buis <rbuis@igalia.com> on 2018-12-07
Reviewed by Alex Christensen.

This patch removed some unused API and headers in NetworkProcess.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::startPreflight):
* NetworkProcess/NetworkCORSPreflightChecker.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkContentRuleListManager.h:
* NetworkProcess/NetworkDataTask.cpp:
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
* NetworkProcess/NetworkLoad.cpp:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadChecker.cpp:
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveBuffer):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkSession.cpp:
* NetworkProcess/NetworkSession.h:
* NetworkProcess/NetworkSocketStream.cpp:
* NetworkProcess/NetworkSocketStream.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
* NetworkProcess/PingLoad.h:
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::PreconnectTask):
(WebKit::PreconnectTask::frameID const): Deleted.
(WebKit::PreconnectTask::pageID const): Deleted.
* NetworkProcess/PreconnectTask.h:

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

11 months ago[MediaStream] 'devicechange' event should not fire in frames that can't access captur...
eric.carlson@apple.com [Sat, 8 Dec 2018 03:11:36 +0000 (03:11 +0000)]
[MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
https://bugs.webkit.org/show_bug.cgi?id=192511
<rdar://problem/46562063>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: http/tests/media/media-stream/device-change-event-in-iframe.html

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::addEventListener): Don't fire the event unless the document can
access a camera or microphone.

Source/WebKit:

* UIProcess/UserMediaPermissionCheckProxy.cpp:
(WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
(WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
* UIProcess/UserMediaPermissionCheckProxy.h:
(WebKit::UserMediaPermissionCheckProxy::create):
(WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::generateRequestID): New.
(WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
the page does not have a granted request and does not have persistent access.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

LayoutTests:

* fast/mediastream/device-change-event.html: Fix bogus title.
* http/tests/media/media-stream/device-change-event-in-iframe-expected.txt: Added.
* http/tests/media/media-stream/device-change-event-in-iframe.html: Added.
* http/tests/media/media-stream/resources/device-change-iframe.html: Added.

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