Bug 157253 - Stop using string-based enumerations in TextTrack, and eliminate support for string-based enumerations
Summary: Stop using string-based enumerations in TextTrack, and eliminate support for ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-01 18:06 PDT by Darin Adler
Modified: 2016-05-01 23:05 PDT (History)
1 user (show)

See Also:


Attachments
Patch (86.11 KB, patch)
2016-05-01 21:33 PDT, Darin Adler
cdumez: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews125 for ios-simulator-wk2 (876.28 KB, application/zip)
2016-05-01 22:33 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2016-05-01 18:06:12 PDT
Stop using string-based enumerations in TextTrack, and eliminate support for string-based enumerations
Comment 1 Darin Adler 2016-05-01 21:33:49 PDT
Created attachment 277890 [details]
Patch
Comment 2 Chris Dumez 2016-05-01 22:32:12 PDT
Comment on attachment 277890 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=277890&action=review

r=me with comments

> Source/WebCore/html/HTMLTrackElement.cpp:124
>      setAttribute(kindAttr, kind);

setAttributeWithoutSynchronization()

> Source/WebCore/html/HTMLTrackElement.h:44
> +    const AtomicString& srclang() const;

Do we still need this one now that the attribute has been marked as [Reflect]? Is this called from non-bindings code?

> Source/WebCore/html/HTMLTrackElement.h:45
> +    const AtomicString& label() const;

ditto.

> Source/WebCore/html/track/TextTrack.cpp:462
> +    return (m_kind == TextTrackKind::Captions || m_kind == TextTrackKind::Subtitles || m_kind != TextTrackKind::Forced)

I think this should be m_kind == TextTrackKind::Forced

> Source/WebCore/html/track/TextTrack.h:198
> +#if !ENABLE(MEDIA_SOURCE)

I would have done the #ifdefing inside the function instead of duplicating it.
Comment 3 Build Bot 2016-05-01 22:33:02 PDT
Comment on attachment 277890 [details]
Patch

Attachment 277890 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1253882

New failing tests:
imported/w3c/web-platform-tests/html/dom/reflection-embedded.html
Comment 4 Build Bot 2016-05-01 22:33:05 PDT
Created attachment 277891 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 5 Darin Adler 2016-05-01 22:44:33 PDT
Comment on attachment 277890 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=277890&action=review

>> Source/WebCore/html/HTMLTrackElement.cpp:124
>>      setAttribute(kindAttr, kind);
> 
> setAttributeWithoutSynchronization()

Makes sense. I wish fastGetAttribute had a name that was more similar since both are basically the same concept!

>> Source/WebCore/html/HTMLTrackElement.h:44
>> +    const AtomicString& srclang() const;
> 
> Do we still need this one now that the attribute has been marked as [Reflect]? Is this called from non-bindings code?

Yes, it’s called in a couple places. Could change those to call fastGetAttribute directly but I thought I would leave it like this for now.

>> Source/WebCore/html/HTMLTrackElement.h:45
>> +    const AtomicString& label() const;
> 
> ditto.

Same here.

>> Source/WebCore/html/track/TextTrack.cpp:462
>> +    return (m_kind == TextTrackKind::Captions || m_kind == TextTrackKind::Subtitles || m_kind != TextTrackKind::Forced)
> 
> I think this should be m_kind == TextTrackKind::Forced

Oops, yes. I bet that’s why a test is failing. Fixing it.

>> Source/WebCore/html/track/TextTrack.h:198
>> +#if !ENABLE(MEDIA_SOURCE)
> 
> I would have done the #ifdefing inside the function instead of duplicating it.

I duplicated it to avoid UNUSED_PARAM. What do you think?
Comment 6 Darin Adler 2016-05-01 23:05:22 PDT
Committed r200317: <http://trac.webkit.org/changeset/200317>