[webkit-reviews] review denied: [Bug 120439] [CSS Shapes] Revise the ShapeInterval set operations' implementation : [Attachment 210172] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 3 11:30:59 PDT 2013

Alexandru Chiculita <achicu at adobe.com> has denied Hans Muller
<giles_joplin at yahoo.com>'s request for review:
Bug 120439: [CSS Shapes] Revise the ShapeInterval set operations'

Attachment 210172: Patch

------- Additional Comments from Alexandru Chiculita <achicu at adobe.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=210172&action=review

I would like to remove the operator< and operator > from the float intervals. I
know you use it for sorting, but for that case I would rather have a separate
comparator. The comparator is confusing as it could be interpreted as comparing
left, right, both or just the length.

> Source/WebCore/rendering/shapes/ShapeInterval.h:90
>      {

I think we should assert that the two intervals are already sorted.

> Source/WebCore/rendering/shapes/ShapeInterval.h:129
> +	       if (working->overlaps(*next)) {

This only works if the intervals in both vectors are not self-overlapping. I
think we need to enforce that with an assert. Also, assert that the two are

> Source/WebCore/rendering/shapes/ShapeInterval.h:138
> +    static void subtractShapeIntervals(const ShapeIntervals& a, const
ShapeIntervals& b, ShapeIntervals& result)

Assert the expectations of the function (ie. intervals are sorted and not

> Source/WebCore/rendering/shapes/ShapeInterval.h:165
> +		   if (aValue < bValue) {

I don't like using the operator < here. I think the actual members instead of
the operator "<" would be less confusing. In this case it can be interpreted
two ways: a) aValue.x2 < bValue.x1 or b) aValue.x1  < bValue.x1.

You've used this pattern in multiple place, please update all of them and
remove the operators.

More information about the webkit-reviews mailing list