Changeset 265050 in webkit


Ignore:
Timestamp:
Jul 29, 2020 12:12:46 PM (4 years ago)
Author:
Chris Dumez
Message:

Make sure playback state constants remain on OscillatorNode for backward compatibility
https://bugs.webkit.org/show_bug.cgi?id=214925

Reviewed by Eric Carlson.

Source/WebCore:

Make sure playback state constants remain on OscillatorNode for backward compatibility,
while we keep supporting the prefixed Web Audio API.

No new tests, updated existing test.

  • Modules/webaudio/OscillatorNode.idl:
  • Modules/webaudio/WebKitOscillatorNode.idl:

LayoutTests:

Improve layout test coverage.

  • webaudio/oscillatornode-legacy-api-expected.txt:
  • webaudio/oscillatornode-legacy-api.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r265048 r265050  
     12020-07-29  Chris Dumez  <cdumez@apple.com>
     2
     3        Make sure playback state constants remain on OscillatorNode for backward compatibility
     4        https://bugs.webkit.org/show_bug.cgi?id=214925
     5
     6        Reviewed by Eric Carlson.
     7
     8        Improve layout test coverage.
     9
     10        * webaudio/oscillatornode-legacy-api-expected.txt:
     11        * webaudio/oscillatornode-legacy-api.html:
     12
    1132020-07-29  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/webaudio/oscillatornode-legacy-api-expected.txt

    r265028 r265050  
    55
    66PASS OscillatorNode.prototype.playbackState is undefined.
    7 PASS OscillatorNode.UNSCHEDULED_STATE is undefined.
    8 PASS OscillatorNode.SCHEDULED_STATE is undefined.
    9 PASS OscillatorNode.PLAYING_STATE is undefined.
    10 PASS OscillatorNode.FINISHED_STATE is undefined.
    11 PASS webkitOscillatorNode.UNSCHEDULED_STATE is 0
    12 PASS webkitOscillatorNode.SCHEDULED_STATE is 1
    13 PASS webkitOscillatorNode.PLAYING_STATE is 2
    14 PASS webkitOscillatorNode.FINISHED_STATE is 3
     7PASS OscillatorNode.UNSCHEDULED_STATE is 0
     8PASS OscillatorNode.SCHEDULED_STATE is 1
     9PASS OscillatorNode.PLAYING_STATE is 2
     10PASS OscillatorNode.FINISHED_STATE is 3
     11PASS legacyOscillator.playbackState is defined.
     12PASS legacyOscillator.UNSCHEDULED_STATE is 0
     13PASS legacyOscillator.SCHEDULED_STATE is 1
     14PASS legacyOscillator.PLAYING_STATE is 2
     15PASS legacyOscillator.FINISHED_STATE is 3
    1516PASS successfullyParsed is true
    1617
  • trunk/LayoutTests/webaudio/oscillatornode-legacy-api.html

    r265028 r265050  
    22<html>
    33<head>
    4     <script src="../resources/js-test-pre.js"></script>
     4    <script src="../resources/js-test.js"></script>
    55</head>
    66<body>
     
    99
    1010        shouldBeUndefined("OscillatorNode.prototype.playbackState");
    11         shouldBeUndefined("OscillatorNode.UNSCHEDULED_STATE");
    12         shouldBeUndefined("OscillatorNode.SCHEDULED_STATE");
    13         shouldBeUndefined("OscillatorNode.PLAYING_STATE");
    14         shouldBeUndefined("OscillatorNode.FINISHED_STATE");
    1511
    16         shouldBe("webkitOscillatorNode.UNSCHEDULED_STATE", "0");
    17         shouldBe("webkitOscillatorNode.SCHEDULED_STATE", "1");
    18         shouldBe("webkitOscillatorNode.PLAYING_STATE", "2");
    19         shouldBe("webkitOscillatorNode.FINISHED_STATE", "3");
     12        // Tests backward compatibility for prefixed API.
     13        shouldBe("OscillatorNode.UNSCHEDULED_STATE", "0");
     14        shouldBe("OscillatorNode.SCHEDULED_STATE", "1");
     15        shouldBe("OscillatorNode.PLAYING_STATE", "2");
     16        shouldBe("OscillatorNode.FINISHED_STATE", "3");
     17
     18        let legacyContext = new webkitAudioContext;
     19        let legacyOscillator = legacyContext.createOscillator();
     20        shouldBeDefined("legacyOscillator.playbackState");
     21        shouldBe("legacyOscillator.UNSCHEDULED_STATE", "0");
     22        shouldBe("legacyOscillator.SCHEDULED_STATE", "1");
     23        shouldBe("legacyOscillator.PLAYING_STATE", "2");
     24        shouldBe("legacyOscillator.FINISHED_STATE", "3");
    2025    </script>
    21     <script src="../resources/js-test-post.js"></script>
    2226</body>
    2327</html>
  • trunk/Source/WebCore/ChangeLog

    r265048 r265050  
     12020-07-29  Chris Dumez  <cdumez@apple.com>
     2
     3        Make sure playback state constants remain on OscillatorNode for backward compatibility
     4        https://bugs.webkit.org/show_bug.cgi?id=214925
     5
     6        Reviewed by Eric Carlson.
     7
     8        Make sure playback state constants remain on OscillatorNode for backward compatibility,
     9        while we keep supporting the prefixed Web Audio API.
     10
     11        No new tests, updated existing test.
     12
     13        * Modules/webaudio/OscillatorNode.idl:
     14        * Modules/webaudio/WebKitOscillatorNode.idl:
     15
    1162020-07-29  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebCore/Modules/webaudio/OscillatorNode.idl

    r265028 r265050  
    2828    JSGenerateToJSObject,
    2929    ActiveDOMObject,
    30     EnabledBySetting=ModernUnprefixedWebAudio
     30    EnabledBySetting=WebAudio&ModernUnprefixedWebAudio
    3131] interface OscillatorNode : AudioScheduledSourceNode {
    3232    [MayThrowException] constructor (BaseAudioContext context, optional OscillatorOptions options);
     
    3838
    3939    void setPeriodicWave(PeriodicWave wave);
     40
     41    // FIXME: Those legacy playback state constants are kept for backward compatibility with the
     42    // prefixed API and should be removed once we stop supporting the prefixed API.
     43    [EnabledBySetting=PrefixedWebAudio] const unsigned short UNSCHEDULED_STATE = 0;
     44    [EnabledBySetting=PrefixedWebAudio] const unsigned short SCHEDULED_STATE = 1;
     45    [EnabledBySetting=PrefixedWebAudio] const unsigned short PLAYING_STATE = 2;
     46    [EnabledBySetting=PrefixedWebAudio] const unsigned short FINISHED_STATE = 3;
    4047};
  • trunk/Source/WebCore/Modules/webaudio/WebKitOscillatorNode.idl

    r265028 r265050  
    2929    EnabledBySetting=WebAudio&PrefixedWebAudio,
    3030    JSGenerateToJSObject,
    31     InterfaceName=webkitOscillatorNode,
     31    NoInterfaceObject,
    3232] interface WebKitOscillatorNode : AudioScheduledSourceNode {
    3333    attribute OscillatorType type;
Note: See TracChangeset for help on using the changeset viewer.