Changeset 234940 in webkit


Ignore:
Timestamp:
Aug 16, 2018 10:57:01 AM (6 years ago)
Author:
jer.noble@apple.com
Message:

Add Experimental Feature support for SourceBuffer.changeType()
https://bugs.webkit.org/show_bug.cgi?id=188626
LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

  • resources/import-expectations.json:
  • web-platform-tests/media-source/mediasource-changetype-expected.txt: Added.
  • web-platform-tests/media-source/mediasource-changetype-play-expected.txt: Added.
  • web-platform-tests/media-source/mediasource-changetype-play.html: Added.
  • web-platform-tests/media-source/mediasource-changetype-util.js: Added.

(findSupportedChangeTypeTestTypes):
(appendBuffer):
(trimBuffered):
(trimDuration):
(runChangeTypeTest):
(mediaSourceChangeTypeTest):

  • web-platform-tests/media-source/mediasource-changetype.html: Added.
  • web-platform-tests/media-source/mp3/sound_5.mp3: Added.
  • web-platform-tests/media-source/mp3/w3c-import.log: Added.
  • web-platform-tests/media-source/w3c-import.log:
  • web-platform-tests/media-source/webm/test-vp9.webm: Added.
  • web-platform-tests/media-source/webm/w3c-import.log:

Source/WebCore:

Reviewed by Eric Carlson.

Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html

imported/w3c/web-platform-tests/media-source/mediasource-changetype.html

The WICG is incubating a new proposal to allow clients to switch between streams
with different codecs within the same SourceBuffer. The proposal is being tracked
by <https://github.com/w3c/media-source/issues/155> and the proposed spec change
is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.

Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching.
The AVStreamDataParser does not necessarily emit every frame appended, and after a
new init segment is appended, it's possible that frames from the previous media
segment will be emitted. This causes an error condition to occur, due to an added
check in the spec for a new flag. When the SourceBuffer asks its private implementation
to reset the parser state, since there's no API on AVStreamDataParser to actually
reset the parser state, just set a flag to drop all emitted buffers until the next
initialization segment is parsed.

  • Modules/mediasource/MediaSource.cpp:

(WebCore::MediaSource::contentTypeShouldGenerateTimestamps):
(WebCore::MediaSource::setDurationInternal):
(WebCore::MediaSource::addSourceBuffer):

  • Modules/mediasource/MediaSource.h:
  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::changeType):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::validateInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

  • Modules/mediasource/SourceBuffer.h:
  • Modules/mediasource/SourceBuffer.idl:
  • page/Settings.yaml:
  • platform/graphics/SourceBufferPrivate.h:

(WebCore::SourceBufferPrivate::canSwitchToType):

  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):

Source/WebKit:

Reviewed by Eric Carlson.

  • Shared/WebPreferences.yaml:
  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetSourceBufferChangeTypeEnabled):
(WKPreferencesGetSourceBufferChangeTypeEnabled):

  • UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

<rdar://problem/43356021>

Reviewed by Eric Carlson.

Add a new WebPreference property mapping to the WebCore SourceBufferChangeTypeEnabled setting.

  • WebView/WebPreferenceKeysPrivate.h:
  • WebView/WebPreferences.mm:

(+[WebPreferences initialize]):
(-[WebPreferences sourceBufferChangeTypeEnabled]):
(-[WebPreferences setSourceBufferChangeTypeEnabled:]):

  • WebView/WebPreferencesPrivate.h:
  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]):

Tools:

<rdar://problem/43356021>

Reviewed by Eric Carlson.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

Reviewed by Eric Carlson.

  • platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt: Added.
Location:
trunk
Files:
10 added
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r234933 r234940  
     12018-08-15  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Experimental Feature support for SourceBuffer.changeType()
     4        https://bugs.webkit.org/show_bug.cgi?id=188626
     5
     6        Reviewed by Eric Carlson.
     7
     8        * platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt: Added.
     9
    1102018-08-16  Per Arne Vollan  <pvollan@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r234893 r234940  
     12018-08-15  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Experimental Feature support for SourceBuffer.changeType()
     4        https://bugs.webkit.org/show_bug.cgi?id=188626
     5
     6        Reviewed by Eric Carlson.
     7
     8        * resources/import-expectations.json:
     9        * web-platform-tests/media-source/mediasource-changetype-expected.txt: Added.
     10        * web-platform-tests/media-source/mediasource-changetype-play-expected.txt: Added.
     11        * web-platform-tests/media-source/mediasource-changetype-play.html: Added.
     12        * web-platform-tests/media-source/mediasource-changetype-util.js: Added.
     13        (findSupportedChangeTypeTestTypes):
     14        (appendBuffer):
     15        (trimBuffered):
     16        (trimDuration):
     17        (runChangeTypeTest):
     18        (mediaSourceChangeTypeTest):
     19        * web-platform-tests/media-source/mediasource-changetype.html: Added.
     20        * web-platform-tests/media-source/mp3/sound_5.mp3: Added.
     21        * web-platform-tests/media-source/mp3/w3c-import.log: Added.
     22        * web-platform-tests/media-source/w3c-import.log:
     23        * web-platform-tests/media-source/webm/test-vp9.webm: Added.
     24        * web-platform-tests/media-source/webm/w3c-import.log:
     25
    1262018-08-14  Ryosuke Niwa  <rniwa@webkit.org>
    227
  • trunk/LayoutTests/imported/w3c/resources/import-expectations.json

    r234798 r234940  
    255255    "web-platform-tests/mathml": "import",
    256256    "web-platform-tests/media-capabilities": "skip",
     257    "web-platform-tests/media-source": "import",
    257258    "web-platform-tests/mediacapture-image": "skip",
    258259    "web-platform-tests/mediacapture-record": "skip",
  • trunk/LayoutTests/imported/w3c/web-platform-tests/media-source/w3c-import.log

    r216354 r234940  
    22Do NOT modify these tests directly in WebKit.
    33Instead, create a pull request on the WPT github:
    4         https://github.com/w3c/web-platform-tests
     4        https://github.com/web-platform-tests/wpt
    55
    66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
     
    3535/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html
    3636/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-buffered.html
     37/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html
     38/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-changetype-util.js
     39/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-changetype.html
    3740/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-closed.html
    3841/LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-a-bitrate.html
  • trunk/LayoutTests/imported/w3c/web-platform-tests/media-source/webm/w3c-import.log

    r216354 r234940  
    22Do NOT modify these tests directly in WebKit.
    33Instead, create a pull request on the WPT github:
    4         https://github.com/w3c/web-platform-tests
     4        https://github.com/web-platform-tests/wpt
    55
    66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
     
    3636/LayoutTests/imported/w3c/web-platform-tests/media-source/webm/test-v-256k-320x240-30fps-10kfr.webm
    3737/LayoutTests/imported/w3c/web-platform-tests/media-source/webm/test-vp8-vorbis-webvtt.webm
     38/LayoutTests/imported/w3c/web-platform-tests/media-source/webm/test-vp9.webm
    3839/LayoutTests/imported/w3c/web-platform-tests/media-source/webm/test.webm
  • trunk/Source/WebCore/ChangeLog

    r234938 r234940  
     12018-08-15  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Experimental Feature support for SourceBuffer.changeType()
     4        https://bugs.webkit.org/show_bug.cgi?id=188626
     5
     6        Reviewed by Eric Carlson.
     7
     8        Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html
     9               imported/w3c/web-platform-tests/media-source/mediasource-changetype.html
     10
     11        The WICG is incubating a new proposal to allow clients to switch between streams
     12        with different codecs within the same SourceBuffer. The proposal is being tracked
     13        by <https://github.com/w3c/media-source/issues/155> and the proposed spec change
     14        is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.
     15
     16        Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching.
     17        The AVStreamDataParser does not necessarily emit every frame appended, and after a
     18        new init segment is appended, it's possible that frames from the previous media
     19        segment will be emitted. This causes an error condition to occur, due to an added
     20        check in the spec for a new flag. When the SourceBuffer asks its private implementation
     21        to reset the parser state, since there's no API on AVStreamDataParser to actually
     22        reset the parser state, just set a flag to drop all emitted buffers until the next
     23        initialization segment is parsed.
     24
     25        * Modules/mediasource/MediaSource.cpp:
     26        (WebCore::MediaSource::contentTypeShouldGenerateTimestamps):
     27        (WebCore::MediaSource::setDurationInternal):
     28        (WebCore::MediaSource::addSourceBuffer):
     29        * Modules/mediasource/MediaSource.h:
     30        * Modules/mediasource/SourceBuffer.cpp:
     31        (WebCore::SourceBuffer::changeType):
     32        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
     33        (WebCore::SourceBuffer::validateInitializationSegment):
     34        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
     35        * Modules/mediasource/SourceBuffer.h:
     36        * Modules/mediasource/SourceBuffer.idl:
     37        * page/Settings.yaml:
     38        * platform/graphics/SourceBufferPrivate.h:
     39        (WebCore::SourceBufferPrivate::canSwitchToType):
     40        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
     41        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
     42        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
     43        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
     44        (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
     45        (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
     46
    1472018-08-16  Christopher Reid  <chris.reid@sony.com>
    248
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp

    r234374 r234940  
    345345}
    346346
     347bool MediaSource::contentTypeShouldGenerateTimestamps(const ContentType& contentType)
     348{
     349    return contentType.containerType() == "audio/aac" || contentType.containerType() == "audio/mpeg";
     350}
     351
    347352bool MediaSource::hasBufferedTime(const MediaTime& time)
    348353{
     
    525530
    526531    // 6. Update the media duration to new duration and run the HTMLMediaElement duration change algorithm.
    527     LOG(MediaSource, "MediaSource::setDurationInternal(%p) - duration(%g)", this, duration.toDouble());
     532    LOG(MediaSource, "MediaSource::setDurationInternal(%p) - duration(%s)", this, duration.toString().utf8().data());
    528533    m_private->durationChanged();
    529534
     
    663668    // NOTE: In the current byte stream format registry <http://www.w3.org/2013/12/byte-stream-format-registry/>
    664669    // only the "MPEG Audio Byte Stream Format" has the "Generate Timestamps Flag" value set.
    665     bool shouldGenerateTimestamps = contentType.containerType() == "audio/aac" || contentType.containerType() == "audio/mpeg";
     670    bool shouldGenerateTimestamps = contentTypeShouldGenerateTimestamps(contentType);
    666671    buffer->setShouldGenerateTimestamps(shouldGenerateTimestamps);
    667672
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.h

    r234374 r234940  
    104104
    105105    static const MediaTime& currentTimeFudgeFactor();
     106    static bool contentTypeShouldGenerateTimestamps(const ContentType&);
    106107
    107108private:
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r234374 r234940  
    349349}
    350350
     351ExceptionOr<void> SourceBuffer::changeType(const String& type)
     352{
     353    // changeType() proposed API. See issue #155: <https://github.com/w3c/media-source/issues/155>
     354    // https://rawgit.com/wicg/media-source/codec-switching/index.html#dom-sourcebuffer-changetype
     355
     356    // 1. If type is an empty string then throw a TypeError exception and abort these steps.
     357    if (type.isEmpty())
     358        return Exception { TypeError };
     359
     360    // 2. If this object has been removed from the sourceBuffers attribute of the parent media source,
     361    // then throw an InvalidStateError exception and abort these steps.
     362    // 3. If the updating attribute equals true, then throw an InvalidStateError exception and abort these steps.
     363    if (isRemoved() || m_updating)
     364        return Exception { InvalidStateError };
     365
     366    // 4. If type contains a MIME type that is not supported or contains a MIME type that is not supported with
     367    // the types specified (currently or previously) of SourceBuffer objects in the sourceBuffers attribute of
     368    // the parent media source, then throw a NotSupportedError exception and abort these steps.
     369    ContentType contentType(type);
     370    if (!m_private->canSwitchToType(contentType))
     371        return Exception { NotSupportedError };
     372
     373    // 5. If the readyState attribute of the parent media source is in the "ended" state then run the following
     374    // steps:
     375    // 5.1. Set the readyState attribute of the parent media source to "open"
     376    // 5.2. Queue a task to fire a simple event named sourceopen at the parent media source.
     377    m_source->openIfInEndedState();
     378
     379    // 6. Run the reset parser state algorithm.
     380    resetParserState();
     381
     382    // 7. Update the generate timestamps flag on this SourceBuffer object to the value in the "Generate Timestamps
     383    // Flag" column of the byte stream format registry [MSE-REGISTRY] entry that is associated with type.
     384    setShouldGenerateTimestamps(MediaSource::contentTypeShouldGenerateTimestamps(contentType));
     385
     386    // ↳ If the generate timestamps flag equals true:
     387    // Set the mode attribute on this SourceBuffer object to "sequence", including running the associated steps
     388    // for that attribute being set.
     389    if (m_shouldGenerateTimestamps)
     390        setMode(AppendMode::Sequence);
     391
     392    // ↳ Otherwise:
     393    // Keep the previous value of the mode attribute on this SourceBuffer object, without running any associated
     394    // steps for that attribute being set.
     395    // NOTE: No-op.
     396
     397    // 9. Set pending initialization segment for changeType flag to true.
     398    m_pendingInitializationSegmentForChangeType = true;
     399
     400    return { };
     401}
     402
    351403void SourceBuffer::abortIfUpdating()
    352404{
     
    10111063        // ↳ Otherwise:
    10121064        //   Run the duration change algorithm with new duration set to positive Infinity.
    1013         MediaTime newDuration = segment.duration.isValid() ? segment.duration : MediaTime::positiveInfiniteTime();
    1014         m_source->setDurationInternal(newDuration);
     1065        if (segment.duration.isValid() && !segment.duration.isIndefinite())
     1066            m_source->setDurationInternal(segment.duration);
     1067        else
     1068            m_source->setDurationInternal(MediaTime::positiveInfiniteTime());
    10151069    }
    10161070
     
    12071261    }
    12081262
     1263    // (Note: Issue #155 adds this step after step 5:)
     1264    // 6. Set  pending initialization segment for changeType flag  to false.
     1265    m_pendingInitializationSegmentForChangeType = false;
     1266
    12091267    // 6. If the HTMLMediaElement.readyState attribute is HAVE_NOTHING, then run the following steps:
    12101268    if (m_private->readyState() == MediaPlayer::HaveNothing) {
     
    12411299
    12421300    //   * The codecs for each track, match what was specified in the first initialization segment.
    1243     for (auto& audioTrackInfo : segment.audioTracks) {
    1244         if (!m_audioCodecs.contains(audioTrackInfo.description->codec()))
    1245             return false;
     1301    // (Note: Issue #155 strikes out this check. For broad compatibility when this experimental feature
     1302    // is not enabled, only perform this check if the "pending initialization segment for changeType flag"
     1303    // is not set.)
     1304    if (!m_pendingInitializationSegmentForChangeType) {
     1305        for (auto& audioTrackInfo : segment.audioTracks) {
     1306            if (!m_audioCodecs.contains(audioTrackInfo.description->codec()))
     1307                return false;
     1308        }
    12461309    }
    12471310
     
    13291392
    13301393    // 3.5.1 Segment Parser Loop
    1331     // 6.1 If the first initialization segment received flag is false, then run the append error algorithm
     1394    // 6.1 If the first initialization segment received flag is false, (Note: Issue # 155 & changeType()
     1395    // algorithm) or the  pending initialization segment for changeType flag  is true, (End note)
     1396    // then run the append error algorithm
    13321397    //     with the decode error parameter set to true and abort this algorithm.
    13331398    // Note: current design makes SourceBuffer somehow ignorant of append state - it's more a thing
    13341399    //  of SourceBufferPrivate. That's why this check can't really be done in appendInternal.
    13351400    //  unless we force some kind of design with state machine switching.
    1336     if (!m_receivedFirstInitializationSegment) {
     1401    if (!m_receivedFirstInitializationSegment || m_pendingInitializationSegmentForChangeType) {
    13371402        appendError(true);
    13381403        return;
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r234374 r234940  
    8080    ExceptionOr<void> remove(double start, double end);
    8181    ExceptionOr<void> remove(const MediaTime&, const MediaTime&);
     82    ExceptionOr<void> changeType(const String&);
    8283
    8384    const TimeRanges& bufferedInternal() const { ASSERT(m_buffered); return *m_buffered; }
     
    236237    bool m_bufferFull { false };
    237238    bool m_shouldGenerateTimestamps { false };
     239    bool m_pendingInitializationSegmentForChangeType { false };
    238240};
    239241
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl

    r222454 r234940  
    6969    attribute EventHandler onerror;
    7070    attribute EventHandler onabort;
     71
     72    [EnabledBySetting=SourceBufferChangeType, MayThrowException] void changeType(DOMString type);
    7173};
  • trunk/Source/WebCore/page/Settings.yaml

    r234808 r234940  
    433433  conditional: MEDIA_SOURCE
    434434
     435sourceBufferChangeTypeEnabled:
     436  initial: false
     437  conditional: MEDIA_SOURCE
     438
    435439# FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
    436440allowMultiElementImplicitSubmission:
  • trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h

    r230909 r234940  
    6464
    6565    virtual Vector<String> enqueuedSamplesForTrackID(const AtomicString&) { return { }; }
     66
     67    virtual bool canSwitchToType(const ContentType&) { return false; }
    6668};
    6769
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h

    r228709 r234940  
    145145    void setActive(bool) final;
    146146    void notifyClientWhenReadyForMoreSamples(const AtomicString& trackID) final;
     147    bool canSwitchToType(const ContentType&) final;
    147148
    148149    void didBecomeReadyForMoreSamples(int trackID);
     
    195196    bool m_parsingSucceeded { true };
    196197    bool m_parserStateWasReset { false };
     198    bool m_discardSamplesUntilNextInitializationSegment { false };
    197199    int m_enabledVideoTrackID { -1 };
    198200    int m_protectedTrackID { -1 };
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

    r232643 r234940  
    539539    m_audioTracks.clear();
    540540
     541    m_discardSamplesUntilNextInitializationSegment = false;
     542
    541543    SourceBufferPrivateClient::InitializationSegment segment;
    542544
     
    608610    }
    609611
     612    if (m_discardSamplesUntilNextInitializationSegment)
     613        return false;
     614
    610615    if (m_client) {
    611616        Ref<MediaSample> mediaSample = MediaSampleAVFObjC::create(sampleBuffer, trackID);
     
    747752{
    748753    m_parserStateWasReset = true;
     754    m_discardSamplesUntilNextInitializationSegment = true;
    749755}
    750756
     
    11981204}
    11991205
     1206bool SourceBufferPrivateAVFObjC::canSwitchToType(const ContentType& contentType)
     1207{
     1208    MediaEngineSupportParameters parameters;
     1209    parameters.isMediaSource = true;
     1210    parameters.type = contentType;
     1211    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
     1212}
     1213
    12001214void SourceBufferPrivateAVFObjC::setVideoLayer(AVSampleBufferDisplayLayer* layer)
    12011215{
  • trunk/Source/WebKit/ChangeLog

    r234939 r234940  
     12018-08-15  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Experimental Feature support for SourceBuffer.changeType()
     4        https://bugs.webkit.org/show_bug.cgi?id=188626
     5
     6        Reviewed by Eric Carlson.
     7
     8        * Shared/WebPreferences.yaml:
     9        * UIProcess/API/C/WKPreferences.cpp:
     10        (WKPreferencesSetSourceBufferChangeTypeEnabled):
     11        (WKPreferencesGetSourceBufferChangeTypeEnabled):
     12        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     13
    1142018-08-16  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r234723 r234940  
    13101310  webcoreBinding: none
    13111311
     1312SourceBufferChangeTypeEnabled:
     1313  type: bool
     1314  defaultValue: DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
     1315  humanReadableName: "Media Source Codec Switching Support"
     1316  humanReadableDescription: "Enable Media Source Codec Switching through changeType()"
     1317  category: experimental
     1318  condition: ENABLE(MEDIA_SOURCE)
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp

    r234482 r234940  
    14691469}
    14701470
     1471void WKPreferencesSetSourceBufferChangeTypeEnabled(WKPreferencesRef preferencesRef, bool enabled)
     1472{
     1473    toImpl(preferencesRef)->setSourceBufferChangeTypeEnabled(enabled);
     1474}
     1475
     1476bool WKPreferencesGetSourceBufferChangeTypeEnabled(WKPreferencesRef preferencesRef)
     1477{
     1478    return toImpl(preferencesRef)->sourceBufferChangeTypeEnabled();
     1479}
     1480
    14711481void WKPreferencesSetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
    14721482{
  • trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h

    r234482 r234940  
    378378WK_EXPORT bool WKPreferencesGetMediaSourceEnabled(WKPreferencesRef preferencesRef);
    379379
     380// Defaults to false;
     381WK_EXPORT void WKPreferencesSetSourceBufferChangeTypeEnabled(WKPreferencesRef preferencesRef, bool enabled);
     382WK_EXPORT bool WKPreferencesGetSourceBufferChangeTypeEnabled(WKPreferencesRef preferencesRef);
     383
    380384// Default to false.
    381385WK_EXPORT void WKPreferencesSetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef, bool enabled);
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r234930 r234940  
     12018-08-16  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Experimental Feature support for SourceBuffer.changeType()
     4        https://bugs.webkit.org/show_bug.cgi?id=188626
     5        <rdar://problem/43356021>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Add a new WebPreference property mapping to the WebCore SourceBufferChangeTypeEnabled setting.
     10
     11        * WebView/WebPreferenceKeysPrivate.h:
     12        * WebView/WebPreferences.mm:
     13        (+[WebPreferences initialize]):
     14        (-[WebPreferences sourceBufferChangeTypeEnabled]):
     15        (-[WebPreferences setSourceBufferChangeTypeEnabled:]):
     16        * WebView/WebPreferencesPrivate.h:
     17        * WebView/WebView.mm:
     18        (-[WebView _preferencesChanged:]):
     19
    1202018-08-16  Aditya Keerthi  <akeerthi@apple.com>
    221
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h

    r234482 r234940  
    164164#define WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey @"WebKitUseLegacyTextAlignPositionedElementBehavior"
    165165#define WebKitMediaSourceEnabledPreferenceKey @"WebKitMediaSourceEnabled"
     166#define WebKitSourceBufferChangeTypeEnabledPreferenceKey @"WebKitSourceBufferChangeTypeEnabled"
    166167#define WebKitShouldConvertPositionStyleOnCopyPreferenceKey @"WebKitShouldConvertPositionStyleOnCopy"
    167168#define WebKitImageControlsEnabledPreferenceKey @"WebKitImageControlsEnabled"
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm

    r234685 r234940  
    606606#if ENABLE(MEDIA_SOURCE)
    607607        [NSNumber numberWithBool:YES], WebKitMediaSourceEnabledPreferenceKey,
     608        @NO, WebKitSourceBufferChangeTypeEnabledPreferenceKey,
    608609#endif
    609610#if ENABLE(SERVICE_CONTROLS)
     
    27432744}
    27442745
     2746- (BOOL)sourceBufferChangeTypeEnabled
     2747{
     2748    return [self _boolValueForKey:WebKitSourceBufferChangeTypeEnabledPreferenceKey];
     2749}
     2750
     2751- (void)setSourceBufferChangeTypeEnabled:(BOOL)enabled
     2752{
     2753    [self _setBoolValue:enabled forKey:WebKitSourceBufferChangeTypeEnabledPreferenceKey];
     2754}
     2755
    27452756- (BOOL)imageControlsEnabled
    27462757{
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h

    r234723 r234940  
    615615@property (nonatomic) BOOL mediaCapabilitiesEnabled;
    616616@property (nonatomic) BOOL allowCrossOriginSubresourcesToAskForCredentials;
     617@property (nonatomic) BOOL sourceBufferChangeTypeEnabled;
    617618
    618619#if TARGET_OS_IPHONE
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r234685 r234940  
    30223022#if ENABLE(MEDIA_SOURCE)
    30233023    settings.setMediaSourceEnabled([preferences mediaSourceEnabled]);
     3024    settings.setSourceBufferChangeTypeEnabled([preferences sourceBufferChangeTypeEnabled]);
    30243025#endif
    30253026
  • trunk/Tools/ChangeLog

    r234930 r234940  
     12018-08-16  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Experimental Feature support for SourceBuffer.changeType()
     4        https://bugs.webkit.org/show_bug.cgi?id=188626
     5        <rdar://problem/43356021>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * DumpRenderTree/mac/DumpRenderTree.mm:
     10        (enableExperimentalFeatures):
     11        (resetWebPreferencesToConsistentValues):
     12        * WebKitTestRunner/TestController.cpp:
     13        (WTR::TestController::resetPreferencesToConsistentValues):
     14
    1152018-08-16  Aditya Keerthi  <akeerthi@apple.com>
    216
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r234723 r234940  
    869869    [preferences setServerTimingEnabled:YES];
    870870    [preferences setIntersectionObserverEnabled:YES];
     871    preferences.sourceBufferChangeTypeEnabled = YES;
    871872}
    872873
     
    961962    [preferences setWebAudioEnabled:YES];
    962963    [preferences setMediaSourceEnabled:YES];
     964    [preferences setSourceBufferChangeTypeEnabled:YES];
    963965
    964966    [preferences setShadowDOMEnabled:YES];
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r234912 r234940  
    741741    WKPreferencesSetSerifFontFamily(preferences, serifFontFamily);
    742742    WKPreferencesSetAsynchronousSpellCheckingEnabled(preferences, false);
    743 #if ENABLE(WEB_AUDIO)
     743#if ENABLE(MEDIA_SOURCE)
    744744    WKPreferencesSetMediaSourceEnabled(preferences, true);
     745    WKPreferencesSetSourceBufferChangeTypeEnabled(preferences, true);
    745746#endif
    746747
Note: See TracChangeset for help on using the changeset viewer.