Bug 253883 - [MSE] SourceBuffer.buffered should return the same object if it's not modified
Summary: [MSE] SourceBuffer.buffered should return the same object if it's not modified
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-14 05:01 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-03-19 19:33 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-03-14 05:01:25 PDT
Per spec, https://w3c.github.io/media-source/#dom-sourcebuffer-buffered

Step 5,
```
5. If intersection ranges does not contain the exact same range information as the current value of this attribute, then update the current value of this attribute to intersection ranges.
6. Return the current value of this attribute.
```

The current value of this attribute should only be modified if it has changed.

However, currently a copy of the attribute is always returned:
https://searchfox.org/wubkat/rev/7a7d33c945c423639d0e625352d98c40411716f2/Source/WebCore/Modules/mediasource/SourceBuffer.cpp#123-124

```
   // 2. Return a new static normalized TimeRanges object for the media segments buffered.
    return m_private->buffered()->copy();
```

seems to be based on an old spec.
Comment 1 Radar WebKit Bug Importer 2023-03-14 05:01:50 PDT
<rdar://problem/106695698>
Comment 2 Jean-Yves Avenard [:jya] 2023-03-19 00:16:12 PDT
Origin of change in the spec was https://www.w3.org/Bugs/Public/show_bug.cgi?id=27790
Comment 3 Jean-Yves Avenard [:jya] 2023-03-19 02:02:57 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11694
Comment 4 EWS 2023-03-19 17:41:53 PDT
Committed 261848@main (f373c652ff7f): <https://commits.webkit.org/261848@main>

Reviewed commits have been landed. Closing PR #11694 and removing active labels.