[webkit-reviews] review denied: [Bug 79751] Display a TextTrackCue when snap-to-lines flag is set : [Attachment 158681] Updated patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 16 23:30:31 PDT 2012


Tony Chang <tony at chromium.org> has denied Victor Carbune <victor at rosedu.org>'s
request for review:
Bug 79751: Display a TextTrackCue when snap-to-lines flag is set
https://bugs.webkit.org/show_bug.cgi?id=79751

Attachment 158681: Updated patch
https://bugs.webkit.org/attachment.cgi?id=158681&action=review

------- Additional Comments from Tony Chang <tony at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=158681&action=review


I mainly just looked at the code in rendering, but it looks OK to me.  Looks
like you still have compile errors on Qt and Mac.

> Source/WebCore/rendering/RenderTextTrackCue.cpp:45
> +    m_cue->snapToLines() ? repositionCueSnapToLinesSet() :
repositionCueSnapToLinesNotSet();

Nit: I would just use a regular if/else here. I always feel weird using a
ternary without a return/assignment.

> Source/WebCore/rendering/RenderTextTrackCue.cpp:112
> +inline bool RenderTextTrackCue::isOutside() const

Nit: I normally prefer to let the compiler decide to inline or not unless we
know this is going to cause slowness.  I guess it's not a big deal here since
we call each of these functions once.

> Source/WebCore/rendering/RenderTextTrackCue.cpp:168
> +    if (m_cue->getWritingDirection() != TextTrackCue::Horizontal)

Nit: Can you use an 'else' here?

> Source/WebCore/rendering/RenderTextTrackCue.cpp:216
> +    // FIXME(BUG 84296): Implement overlapping detection when snap-to-lines
is not set.

Nit: I've never seen this FIXME() syntax.  I would just put the URL after the
comment. E.g.,
// FIXME: Implement overlapping detection when snap-to-lines is not set.
http://wkb.ug/84296

> Source/WebCore/rendering/RenderTextTrackCue.h:60
> +    TextTrackCue* m_cue;
> +
> +    FloatPoint m_fallbackPosition;
> +    LayoutUnit m_position;
> +    LayoutUnit m_step;

Having all these member variables is unfortunate.  They'll use memory after
layout is done even though we don't need them.	One way to avoid this would be
to make a struct with the params you need and pass it around to each function
or just pass a bunch of params around.


More information about the webkit-reviews mailing list