[Webkit-unassigned] [Bug 113062] Cleanup text track selection logic

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 22 12:15:15 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=113062





--- Comment #13 from Jer Noble <jer.noble at apple.com>  2013-03-22 12:17:42 PST ---
(From update of attachment 194603)
View in context: https://bugs.webkit.org/attachment.cgi?id=194603&action=review

r+, with a couple of nits.

> Source/WebCore/page/CaptionUserPreferences.cpp:80
> +        setUserPrefersCaptions(false);
> +        setUserPrefersCaptions(false);

Should the second line be "setUserPrefersSubtitles(false)"?

> Source/WebCore/page/CaptionUserPreferences.cpp:220
> +    return (languages.size() - languageMatchIndex) * 10;

Why 10?  This could be a constant which explains its importance.

> Source/WebCore/page/CaptionUserPreferencesMac.mm:634
> +        if (track->kind() == track->subtitlesKeyword())
> +            trackScore = 3;
> +        else {
> +            if (!track->isClosedCaptions())
> +                trackScore = 2;
> +            else
> +                trackScore = 1;
> +        }
> +    }

This is confusingly structured.  Could you make this an 'if...else if... else' instead?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the webkit-unassigned mailing list