Closed Bug 1412180 Opened 7 years ago Closed 7 years ago

[webvtt] implement region id on VTTRegion.

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: bechen, Assigned: bechen)

References

()

Details

Attachments

(1 file)

There is a "region id" attribute on VTTRegion.webidl we not implement yet.
https://w3c.github.io/webvtt/#webvtt-region-identifier

I need this one for our region implementation.
Priority: -- → P3
Comment on attachment 8923300 [details]
Bug 1412180 - implement regionID on TextTrackRegion.

https://reviewboard.mozilla.org/r/194478/#review199510

Per spec the setter shouldn't throw. Throwing probably makes sense, but that needs to be defined in the spec. So, file a spec bug, link that here
and tell how likely the spec will be change.

::: dom/media/TextTrackRegion.h:138
(Diff revision 1)
> +  }
> +
> +  void SetId(const nsAString& aId, ErrorResult& aRv)
> +  {
> +    if (InvalidIdString(aId)) {
> +      aRv.Throw(NS_ERROR_DOM_INVALID_CHARACTER_ERR);

The spec doesn't define this behavior.
https://w3c.github.io/webvtt/#dom-vttregion-id

::: dom/media/TextTrackRegion.h:190
(Diff revision 1)
>    }
>  
> +  inline bool InvalidIdString(const nsAString& aId)
> +  {
> +    nsString s(aId);
> +    if(s.Find("-->") != kNotFound) {

Could you use FindInReadable here to avoid extra allocation use of nsString causes.
(or perhaps use nsAutoString)
Attachment #8923300 - Flags: review?(bugs) → review-
Comment on attachment 8923300 [details]
Bug 1412180 - implement regionID on TextTrackRegion.

https://reviewboard.mozilla.org/r/194478/#review201860
Attachment #8923300 - Flags: review?(bugs) → review+
Comment on attachment 8923300 [details]
Bug 1412180 - implement regionID on TextTrackRegion.

https://reviewboard.mozilla.org/r/194478/#review202030
Attachment #8923300 - Flags: review?(giles) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3cb5c8d2f793
implement regionID on TextTrackRegion. r=rillian,smaug
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3cb5c8d2f793
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: