Web Inspector: allow import() inside the inspector
[WebKit-https.git] / Source / WebCore / ChangeLog
index e7753ad..94395e1 100644 (file)
@@ -1,3 +1,281 @@
+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