RESOLVED DUPLICATE of bug 95625 Bug 95490
[CSS Exclusions] add support for the basic shapes
https://bugs.webkit.org/show_bug.cgi?id=95490
Summary [CSS Exclusions] add support for the basic shapes
Hans Muller
Reported 2012-08-30 13:01:57 PDT
Initial support for the shapes listed in the "Basic Shapes" section of the CSS Exclusions spec - http://dev.w3.org/csswg/css3-exclusions/#basic-shapes-from-svg-syntax.
Attachments
Patch (56.45 KB, patch)
2012-08-30 13:28 PDT, Hans Muller
no flags
Patch (61.39 KB, patch)
2012-08-30 15:31 PDT, Hans Muller
no flags
Patch (60.26 KB, patch)
2012-08-31 10:25 PDT, Hans Muller
no flags
Patch (59.79 KB, patch)
2012-08-31 11:50 PDT, Hans Muller
no flags
Patch (59.78 KB, patch)
2012-08-31 13:50 PDT, Hans Muller
no flags
Hans Muller
Comment 1 2012-08-30 13:28:44 PDT
WebKit Review Bot
Comment 2 2012-08-30 13:46:53 PDT
Comment on attachment 161541 [details] Patch Attachment 161541 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13680864
Early Warning System Bot
Comment 3 2012-08-30 13:49:26 PDT
Gyuyoung Kim
Comment 4 2012-08-30 13:50:37 PDT
Early Warning System Bot
Comment 5 2012-08-30 14:53:22 PDT
Build Bot
Comment 6 2012-08-30 14:56:08 PDT
Peter Beverloo (cr-android ews)
Comment 7 2012-08-30 15:24:57 PDT
Comment on attachment 161541 [details] Patch Attachment 161541 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/13699008
Hans Muller
Comment 8 2012-08-30 15:31:14 PDT
Hans Muller
Comment 9 2012-08-30 15:37:48 PDT
(In reply to comment #8) Added the new filenames to five WebCore build files (they'd already been added to the XCode project). Hopefully that's all of them.
Build Bot
Comment 10 2012-08-30 16:00:35 PDT
Bear Travis
Comment 11 2012-08-30 17:04:35 PDT
Here's a first pass over the code. I have not yet taken a really good look at the geometry algorithms, so comments on those will follow later. > Source/WebCore/ChangeLog:31 > + (WebCore::IntervalX1Comparator::operator()): For a patch this large, you will probably need to write function-level comments (full-sentences) for each of the ChangeLog entries. You may be able to hold off a while if you anticipate large-scale architecture changes during the review process. > Source/WebCore/platform/graphics/XSInterval.cpp:1 > +/* I think XS is not the most descriptive prefix. ExclusionShape is probably a little too long. BasicShape, or just Shape? What classes are we most worried about naming collisions with? > Source/WebCore/platform/graphics/XSInterval.cpp:37 > +struct IntervalX1Comparator { Would the name XSIntervalComparator be more appropriate? > Source/WebCore/platform/graphics/XSInterval.cpp:45 > +{ WebKit code leans towards full-word variable names: http://www.webkit.org/coding/coding-style.html#names-full-words Perhaps other and result? > Source/WebCore/platform/graphics/XSInterval.cpp:70 > + for (size_t i = 0; i < v.size(); i++) { Think I'm reading this right. Since interval is only null on the first pass, and v is guaranteed to have at least one element, I think this can change to: ASSERT(v.size()); interval = &v[0]; for (size_t i = 1; ... ; ... ) > Source/WebCore/platform/graphics/XSInterval.cpp:71 > + if (!interval) If the above is correct, you can remove this case > Source/WebCore/platform/graphics/XSInterval.cpp:81 > + if (interval) And this null-check, and just append the interval. > Source/WebCore/platform/graphics/XSPolygon.h:1 > +/* Because the patch is already large, and we aren't testing Polygons yet, I would recommend removing the Polygon files and add them in a subsequent patch. > Source/WebCore/platform/graphics/XSRectangle.cpp:35 > +// See http://hansmuller-webkit.blogspot.com/2012/07/computing-horizonal-rounded-rectangle.html I would remove the blog reference in the file, and place it in the bug or the ChangeLog. > Source/WebCore/platform/graphics/XShape.cpp:103 > + case BasicShape::BASIC_SHAPE_POLYGON: { If you remove Polygon, this can be changed to notImplemented() > Source/WebCore/platform/graphics/XShape.cpp:115 > + default: Removing the default case adds a compile-time check that each shape case is covered. The ASSERT_NOT_REACHED can then be below the switch statement. > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1325 > + if (wrapShapeInfo) { I would change this back to the original form (no lineHeight), and add that in a subsequent patch. > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1327 > + LayoutUnit lineBottom = lineTop + lineHeight(true, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes); "true" should be replaced with layoutState.lineInfo().isFirstLine() > Source/WebCore/rendering/WrapShapeInfo.cpp:-108 > - Whitespace removed > Source/WebCore/rendering/WrapShapeInfo.cpp:114 > +bool WrapShapeInfo::computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineBottom) Leave the signature on this as just lineTop, until you use lineBottom > Source/WebCore/rendering/WrapShapeInfo.h:81 > + bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineBottom); Ditto
Hans Muller
Comment 12 2012-08-31 07:58:48 PDT
(In reply to comment #11) > > Source/WebCore/platform/graphics/XSInterval.cpp:1 > > +/* > > I think XS is not the most descriptive prefix. ExclusionShape is probably a little too long. BasicShape, or just Shape? What classes are we most worried about naming collisions with? Since the classes are intended to (just) support operations required by CSS Exclusions, I don't think a generic prefix like "Shape" would make sense. BasicShape (nee WrapShape) has already been used as the name of the class that just encodes the CSS information. ExclusionShape is what "XS" is short for. I was reluctant replace the abbreviation because names like ExclusionShapeIntervalX1Comparator are pretty clunky. > > > Source/WebCore/platform/graphics/XSInterval.cpp:37 > > +struct IntervalX1Comparator { > > Would the name XSIntervalComparator be more appropriate? No, that would obscure the important fact that XSInterval's "x1" field is what's being compared. > > Source/WebCore/platform/graphics/XSInterval.cpp:45 > > +{ > > WebKit code leans towards full-word variable names: > http://www.webkit.org/coding/coding-style.html#names-full-words > Perhaps other and result? Yes, that would probably be more coding-style compliant. > > Source/WebCore/platform/graphics/XSInterval.cpp:70 > > + for (size_t i = 0; i < v.size(); i++) { > > Think I'm reading this right. Since interval is only null on the first pass, and v is guaranteed to have at least one element, I think this can change to: > ASSERT(v.size()); > interval = &v[0]; > for (size_t i = 1; ... ; ... ) What you mean is that v is guaranteed to have two elements. In that case, yes the code could be refactored as you've suggested.
Hans Muller
Comment 13 2012-08-31 10:25:39 PDT
Build Bot
Comment 14 2012-08-31 10:46:41 PDT
Hans Muller
Comment 15 2012-08-31 11:50:08 PDT
Created attachment 161744 [details] Patch Fixed an uninitialized variable problem that the windows compiler was complaining about; removed extraneous trailing white space in the new files.
Build Bot
Comment 16 2012-08-31 12:22:08 PDT
Hans Muller
Comment 17 2012-08-31 13:50:43 PDT
Created attachment 161764 [details] Patch Eliminated a dead code path in XShape::createXShape() that caused an error in the Windows build.
Hans Muller
Comment 18 2012-08-31 16:53:19 PDT
*** This bug has been marked as a duplicate of bug 95625 ***
Note You need to log in before you can comment on or make changes to this bug.