[webkit-reviews] review granted: [Bug 60184] Introduce HTML5 track list objects : [Attachment 94076] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 19 11:27:23 PDT 2011


Eric Carlson <eric.carlson at apple.com> has granted Leandro Graciá Gil
<leandrogracia at chromium.org>'s request for review:
Bug 60184: Introduce HTML5 track list objects
https://bugs.webkit.org/show_bug.cgi?id=60184

Attachment 94076: Patch
https://bugs.webkit.org/attachment.cgi?id=94076&action=review

------- Additional Comments from Eric Carlson <eric.carlson at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=94076&action=review

> Source/WebCore/dom/ExclusiveTrackList.cpp:62
> +    if (index != NoSelection && !checkIndex(index, ec))
> +	   return;
> +
> +    ASSERT(index >= NoSelection && index < static_cast<long>(length()));

Doesn't the checkIndex() test above mean that this ASSERT can never fire?


> Source/WebCore/dom/MultipleTrackList.cpp:67
> +    ASSERT(index < length());

Ditto.


> Source/WebCore/dom/MultipleTrackList.cpp:78
> +    ASSERT(index < length());

Ditto.


> Source/WebCore/dom/TrackList.cpp:78
> +bool TrackList::checkIndex(unsigned long index, ExceptionCode& ec) const
> +{
> +    if (index >= length()) {
> +	   ec = INDEX_SIZE_ERR;
> +	   return false;
> +    }
> +
> +    ec = 0;
> +    return true;
> +}

The spec says "If there is no such track, then the method must instead throw an
INDEX_SIZE_ERR exception", so shouldn't this also fail if index is negative?


More information about the webkit-reviews mailing list