Web Inspector: allow import() inside the inspector
[WebKit-https.git] / Source / WebCore / ChangeLog
index 0fb27c2..94395e1 100644 (file)
@@ -1,3 +1,489 @@
+2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Web Inspector: allow import() inside the inspector
+        https://bugs.webkit.org/show_bug.cgi?id=167457
+
+        Reviewed by Ryosuke Niwa.
+
+        When evaluating `import("...")`, we need the caller's context to resolve
+        the module specifier correctly. For example, if `import("./cocoa.js")` is
+        evaluated in the script "drinks/hot.js", this module name is resolved to
+        "drinks/cocoa.js". If the same import operator is evaluated in the script
+        "menu/all.js", the module specifier becomes "menu/cocoa.js".
+
+        Previously we reject the import operator if the caller does not have such
+        a context. These context is SourceOrigin and its ScriptFetcher. While they
+        are offered in the script tag and other code evaluations, the inspector
+        console does not offer that. These class are offered in the WebCore side
+        and we should not touch these classes in the JSC's inspector code.
+
+        Now we relax the above restriction. If the above caller information is not
+        offered, we fallback to the default one. In the web page, we use the page's
+        URL as the caller's source origin. This allows us to evaluate the import
+        operator in the inspector console.
+
+        And as of r167698, the console recognizes `await import("...")` form. We use
+        this to test this `import()` in the console functionality.
+
+        Test: inspector/controller/runtime-controller-import.html
+
+        * bindings/js/ScriptModuleLoader.cpp:
+        (WebCore::ScriptModuleLoader::importModule):
+
+2017-02-16  Miguel Gomez  <magomez@igalia.com>
+
+        [GTK] scroll with transparent background not repainted after scrollY >= 32768
+        https://bugs.webkit.org/show_bug.cgi?id=154283
+
+        Reviewed by Carlos Garcia Campos.
+
+        Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
+        not able to draw anything when using transformation matrices with values bigger than 32768. When
+        drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
+        draw anything in, which causes the reported transparent backgrounds.
+
+        The patch modifies the transformation matrices both from the current context and the pattern we
+        are painting, to avoid them to hold values that cannot stored in 16 bits.
+
+        There's still the possibility that this happens, but it would require using a pattern with a size
+        bigger than 32768.
+
+        Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
+
+        Test: fast/backgrounds/background-repeat-long-scroll.html
+
+        * platform/graphics/cairo/CairoUtilities.cpp:
+        (WebCore::drawPatternToCairoContext):
+
+2017-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Images are never read from the clipboard
+        https://bugs.webkit.org/show_bug.cgi?id=168419
+
+        Reviewed by Sergio Villar Senin.
+
+        We write images in the clipboard, but we don't read them.
+
+        Fixes: editing/pasteboard/paste-image-using-image-data.html
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::createFragmentForImageAndURL): Moved from EditorMac.mm since it's cross-platform code.
+        * editing/Editor.h:
+        * editing/gtk/EditorGtk.cpp:
+        (WebCore::createFragmentFromPasteboardData): Check if there's an image in the selection, and use
+        Editor::createFragmentForImageAndURL in that case.
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::createFragmentForImageAndURL): Deleted.
+        * platform/gtk/PasteboardHelper.cpp:
+        (WebCore::PasteboardHelper::getClipboardContents): Check also if there's an image in the clipboard.
+
+2017-02-15  Jer Noble  <jer.noble@apple.com>
+
+        REGRESSION (r212311): NULL-dereference in HTMLMediaElement::prepareToPlay()
+        https://bugs.webkit.org/show_bug.cgi?id=168404
+        <rdar://problem/30547188>
+
+        Reviewed by Brian Weinstein.
+
+        Prior to r212311, m_player was always guaranteed to be initialized when calling
+        prepareToPlay(). r212311 began calling prepareToPlay() on a subsequent run-loop iteration
+        after creating m_player. So now check whether m_player is NULL before calling methods on it.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::prepareToPlay):
+
+2017-02-15  Eric Carlson  <eric.carlson@apple.com>
+
+        [MediaStream] delete CaptureDeviceInfo struct
+        https://bugs.webkit.org/show_bug.cgi?id=168395
+
+        The CaptureDeviceInfo struct and CaptureDevice class were almost identical, so
+        add an "enabled" field to the later, delete the former, and switch all uses of
+        CaptureDeviceInfo to CaptureDevice.
+
+        Do some minor drive-by cleanup of AVCaptureDeviceManager::refreshCaptureDevices
+        and CaptureDeviceManager::captureDeviceFromDeviceID.
+        
+        Reviewed by Sam Weinig.
+
+        No new tests, no behavior change.
+
+        * Modules/mediastream/MediaDevicesRequest.cpp:
+        (WebCore::MediaDevicesRequest::start): SourceKind -> DeviceType
+        * platform/mediastream/CaptureDevice.h:
+        (WebCore::CaptureDevice::CaptureDevice):
+        (WebCore::CaptureDevice::type): Renamed from kind.
+        (WebCore::CaptureDevice::setType):
+        (WebCore::CaptureDevice::enabled): Added.
+        (WebCore::CaptureDevice::setEnabled):
+        (WebCore::CaptureDevice::kind): Deleted.
+        (WebCore::CaptureDevice::setKind): Deleted.
+
+        * platform/mediastream/CaptureDeviceManager.cpp:
+        (CaptureDeviceManager::getSourcesInfo):
+        (CaptureDeviceManager::captureDeviceFromDeviceID): Don't call sourceWithUID.
+        (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
+        (CaptureDeviceManager::sourceWithUID):
+        * platform/mediastream/CaptureDeviceManager.h:
+        (WebCore::CaptureDeviceManager::refreshCaptureDevices):
+        (WebCore::CaptureDeviceManager::refreshCaptureDeviceList): Deleted.
+
+        * platform/mediastream/mac/AVCaptureDeviceManager.h:
+        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
+        (WebCore::AVCaptureDeviceManager::captureDevices):
+        (WebCore::deviceIsAvailable):
+        (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
+        (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
+        (WebCore::AVCaptureDeviceManager::deviceConnected):
+        (WebCore::AVCaptureDeviceManager::deviceDisconnected):
+        (WebCore::AVCaptureDeviceManager::captureDeviceList): Deleted.
+        (WebCore::shouldConsiderDeviceInDeviceList): Deleted.
+        (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Deleted.
+        * platform/mock/MockRealtimeMediaSource.cpp:
+        (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
+        (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
+
+2017-02-15  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Remove custom conversion from FontFace code by using a Variant
+        https://bugs.webkit.org/show_bug.cgi?id=168384
+
+        Reviewed by Alex Christensen.
+
+        Match the font face spec and use a union rather than any in the FontFace constructor.
+
+        Test: Added additional cases to fast/text/font-face-javascript.html.
+
+        * css/FontFace.cpp:
+        (WebCore::FontFace::create):
+        * css/FontFace.h:
+        * css/FontFace.idl:
+
+2017-02-15  Jer Noble  <jer.noble@apple.com>
+
+        Disabled Media Sources should render black/silence
+        https://bugs.webkit.org/show_bug.cgi?id=168281
+
+        Reviewed by Eric Carlson.
+
+        Test: webrtc/video-disabled-black.html
+
+        Pass the enabled flag setting down from the MediaStreamTrackPrivate to its underlying
+        source, including RealtimeMediaSource and RealtimeOutgoingAudio/VideoSource. When either
+        enabled is cleared or muted is set, generate empty (black or silent) media, as opposed to
+        pausing media or (worse) continuing to send generated media.
+
+        * platform/mediastream/MediaStreamTrackPrivate.cpp:
+        (WebCore::MediaStreamTrackPrivate::setEnabled):
+        (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged):
+        * platform/mediastream/MediaStreamTrackPrivate.h:
+        * platform/mediastream/RealtimeMediaSource.cpp:
+        (WebCore::RealtimeMediaSource::setEnabled):
+        * platform/mediastream/RealtimeMediaSource.h:
+        (WebCore::RealtimeMediaSource::enabled):
+        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
+        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
+        (WebCore::MockRealtimeAudioSourceMac::render):
+        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
+        (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
+        (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
+        (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
+        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
+        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
+        (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
+        (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
+        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
+        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::generateFrame):
+
+2017-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Editing history scripts should not add the contenteditable attribute or override key events
+        https://bugs.webkit.org/show_bug.cgi?id=168389
+        <rdar://problem/30529945>
+
+        Reviewed by Dan Bernstein.
+
+        Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
+        rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
+        events. These were initially added for compatibility with a test harness early on, and should have been removed
+        earlier.
+
+        * Scripts/DumpEditingHistory.js:
+
+2017-02-15  Jer Noble  <jer.noble@apple.com>
+
+        Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary
+        https://bugs.webkit.org/show_bug.cgi?id=168381
+
+        Reviewed by Eric Carlson.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
+
+2017-02-15  Anders Carlsson  <andersca@apple.com>
+
+        Fix build.
+
+        * page/DragController.cpp:
+        (WebCore::DragController::doSystemDrag):
+
+2017-02-15  Anders Carlsson  <andersca@apple.com>
+
+        Modernize DragClient::startDrag somewhat
+        https://bugs.webkit.org/show_bug.cgi?id=168379
+
+        Reviewed by Tim Horton.
+
+        Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
+        instead of whether it's a link or not.
+
+        * loader/EmptyClients.cpp:
+        * page/DragClient.h:
+        * page/DragController.cpp:
+        (WebCore::DragController::startDrag):
+        (WebCore::DragController::doImageDrag):
+        (WebCore::DragController::doSystemDrag):
+        * page/DragController.h:
+
+2017-02-15  Chris Dumez  <cdumez@apple.com>
+
+        Expose Symbol.toPrimitive / valueOf on Location instances
+        https://bugs.webkit.org/show_bug.cgi?id=168295
+
+        Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
+
+        Expose Symbol.toPrimitive / valueOf on Location instances as per:
+        - https://html.spec.whatwg.org/#the-location-interface
+
+        Firefox and Chrome already comply with the specification.
+
+        Tests: fast/dom/location-valueOf-after-object-prototype-update.html
+               fast/dom/location-valueOf-after-object-prototype-update2.html
+               imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
+               imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+
+2017-02-15  Aakash Jain  <aakash_jain@apple.com>
+
+        Remove WebIOSEvent interface
+        https://bugs.webkit.org/show_bug.cgi?id=168368
+
+        Reviewed by Tim Horton.
+
+        * platform/ios/WebEvent.h: Removed WebIOSEvent.
+
+2017-02-15  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] Form Validation Bubble should be sensitive to Dynamic Type
+        https://bugs.webkit.org/show_bug.cgi?id=168291
+        <rdar://problem/30508593>
+
+        Reviewed by Tim Horton.
+
+        Update ValidationBubble implementation on iOS to stop obeying the
+        minimum font size setting, given that this setting is not exposed
+        on iOS. Instead, we now rely on
+        [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
+        will give us a font whose size obeys Dynamic Type [1] setting on iOS.
+
+        [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
+
+        No new tests, no easily testable.
+
+        * platform/ios/ValidationBubbleIOS.mm:
+        (WebCore::ValidationBubble::ValidationBubble):
+
+2017-02-15  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [JSC] Drop PassRefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=168320
+
+        Reviewed by Saam Barati.
+
+        * bindings/js/ScriptSourceCode.h:
+        (WebCore::ScriptSourceCode::ScriptSourceCode):
+        Use Ref and pass it to SourceCode.
+
+        * replay/ReplayController.cpp:
+        (WebCore::ReplayController::frameNavigated):
+        Pass reference.
+
+2017-02-15  Xabier Rodriguez Calvar  <calvaris@igalia.com>
+
+        [GStreamer][MSE][EME] Handle protection event also at decryptor level
+        https://bugs.webkit.org/show_bug.cgi?id=168316
+
+        Reviewed by Žan Doberšek.
+
+        So far in MSE pipeline we were handling the encryption events
+        only when they arrived at the demuxer but this won't work in any
+        kind of key renegotiation as the event will never arrive. Now we
+        connect to the element messages, check for the drm id and send it
+        to the private player for processing.
+
+        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+        (WebCore::appendPipelineElementMessageCallback):
+        (WebCore::AppendPipeline::AppendPipeline):
+        (WebCore::AppendPipeline::handleElementMessage):
+        * platform/graphics/gstreamer/mse/AppendPipeline.h:
+
+2017-02-15  Zan Dobersek  <zdobersek@igalia.com>
+
+        [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
+        https://bugs.webkit.org/show_bug.cgi?id=168362
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        In MediaKeys::setServerCertificate(), when the CDM implementation
+        doesn't support server certificates, it should resolve the promise
+        with the 'false' value, as mandated by the specification, and not
+        reject it.
+
+        A test case in mock-MediaKeys-setServerCertificate.html is updated.
+
+        * Modules/encryptedmedia/MediaKeys.cpp:
+        (WebCore::MediaKeys::setServerCertificate):
+
+2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
+        https://bugs.webkit.org/show_bug.cgi?id=168115
+
+        Reviewed by Darin Adler.
+
+        In r206014 HTTPHeaderMap::add() was updated to combine common headers with ',' instead of ", " to match the
+        fetch specification, but the uncommon headers are still combined with ", ".
+
+        * platform/network/HTTPHeaderMap.cpp:
+        (WebCore::HTTPHeaderMap::add):
+
+2017-02-14  Ryosuke Niwa  <rniwa@webkit.org>
+
+        An assertion failure inside removeChildren
+        https://bugs.webkit.org/show_bug.cgi?id=168069
+
+        Reviewed by Brent Fulgham.
+
+        The bug was caused by notifyRemovePendingSheet executing scripts synchronously where it shouldn't.
+
+        Removed the call to notifyRemovePendingSheetIfNeeded in notifyChildNodeRemoved. Instead, invoke it
+        in its call sites when they're safe.
+
+        Test: http/tests/security/move-iframe-within-focus-handler-inside-removal.html
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::takeAllChildrenFrom):
+        (WebCore::ContainerNode::notifyChildInserted):
+        (WebCore::ContainerNode::removeChild):
+        (WebCore::ContainerNode::parserRemoveChild):
+        (WebCore::ContainerNode::replaceAllChildren):
+        (WebCore::ContainerNode::removeChildren):
+        * dom/ContainerNodeAlgorithms.cpp:
+        (WebCore::notifyChildNodeRemoved):
+
+2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GStreamer] Several tests are timing out after r212349
+        https://bugs.webkit.org/show_bug.cgi?id=168359
+
+        Reviewed by Žan Doberšek.
+
+        This is because they are failing the cross origin check. Those tests are not using WebKitWebSrc, but
+        GstFileSrc. I didn't consider the case of source not being a WebKitWebSrc.
+
+        Fixes several timeout instroduced in r212349.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin): Split the source check in two. First check if
+        it's nullptr, and return false. Then check if it's a WebKitWebSrc and return true if it isn't.
+
+2017-02-14  Brent Fulgham  <bfulgham@apple.com>
+
+        Revalidate URL after events that could trigger navigations
+        https://bugs.webkit.org/show_bug.cgi?id=168071
+        <rdar://problem/30450379>
+
+        Reviewed by Ryosuke Niwa.
+
+        When arbitary javascript runs during a load, we should revalidate
+        the URLs involved to make sure they are still valid.
+
+        Tests: http/tests/plugins/navigation-during-load-embed.html
+               http/tests/plugins/navigation-during-load.html
+
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::updateWidget): Confirm we are still allowed to
+        load the URL after executing JS callbacks.
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::isURLAllowed): Split existing function into
+        existing protected method, and a new public method that checks a passed URL
+        for validity.
+        * html/HTMLFrameElementBase.h:
+        * html/HTMLFrameOwnerElement.h:
+        (WebCore::HTMLFrameOwnerElement::isURLAllowed):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::updateWidget): Confirm we are still allowed to
+        load the URL after executing JS callbacks.
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::requestFrame): Ditto.
+
+2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GStreamer] Implement MediaPlayerPrivate::hasSingleSecurityOrigin()
+        https://bugs.webkit.org/show_bug.cgi?id=168322
+
+        Reviewed by Žan Doberšek.
+
+        It currently returns true unconditionally. Add resolved-location property to WebKitWebSourceGStreamer to track
+        the resolved url returned by the server and use that from MediaPlayerPrivate to check if there was a cross
+        origin redirection.
+
+        Fixes: http/tests/security/canvas-remote-read-remote-video-redirect.html
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webKitWebSrcFinalize):
+        (webKitWebSrcGetProperty):
+        (webKitWebSrcStart):
+        (webKitWebSrcQueryWithParent):
+        (webKitWebSrcGetUri):
+        (webKitWebSrcSetUri):
+        (StreamingClient::handleResponseReceived):
+        (ResourceHandleStreamingClient::wasBlocked):
+        (ResourceHandleStreamingClient::cannotShowURL):
+
+2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Unreviewed, rolling out r211967.
+
+        Caused rendering issues in HiDPI
+
+        Reverted changeset:
+
+        "[GTK] scroll with transparent background not repainted after
+        scrollY >= 32768"
+        https://bugs.webkit.org/show_bug.cgi?id=154283
+        http://trac.webkit.org/changeset/211967
+
+2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Update cookie manager API to properly work with ephemeral sessions
+        https://bugs.webkit.org/show_bug.cgi?id=168230
+
+        Reviewed by Michael Catanzaro.
+
+        Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
+        new libsoup API to support removing recently modified cookies.
+
+        * platform/network/soup/CookieJarSoup.cpp:
+        (WebCore::deleteAllCookiesModifiedSince):
+
 2017-02-14  Joseph Pecoraro  <pecoraro@apple.com>
 
         [WebIDL] Improve serializer = { inherit }