WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
12425
border-radius not applied to fieldset with legend
https://bugs.webkit.org/show_bug.cgi?id=12425
Summary
border-radius not applied to fieldset with legend
nerkles
Reported
2007-01-26 12:50:34 PST
border-radius not applied to fieldset
Attachments
Shows the bug.
(858 bytes, text/html)
2007-01-26 17:49 PST
,
nerkles
no flags
Details
Implements border radius logic for a fieldset, based off RenderObject's implementation
(25.79 KB, patch)
2008-06-18 04:02 PDT
,
Alex Taylor
no flags
Details
Formatted Diff
Diff
Additional test case.
(6.29 KB, text/html)
2008-06-18 04:04 PDT
,
Alex Taylor
no flags
Details
Method two: using a clipping region
(2.09 KB, patch)
2008-06-20 18:36 PDT
,
Alex Taylor
no flags
Details
Formatted Diff
Diff
Method two: using a clipping region with no border radius speed up
(5.25 KB, patch)
2008-06-20 19:49 PDT
,
Alex Taylor
mitz: review-
Details
Formatted Diff
Diff
Method two: using a clipping region
(27.69 KB, patch)
2008-06-20 23:06 PDT
,
Alex Taylor
mitz: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
mitz
Comment 1
2007-01-26 12:58:44 PST
Confirmed. Changed component to Layout & Rendering.
Sam Weinig
Comment 2
2007-01-26 17:25:50 PST
I cannot reproduce this in ToT. Could you please attach a test case demonstrating border-radius not working.
nerkles
Comment 3
2007-01-26 17:49:59 PST
Created
attachment 12700
[details]
Shows the bug. I hadn't noticed that the bug only appears if the fieldset includes a LEGEND. Sorry about that. Here's a test file.
Alex Taylor
Comment 4
2008-06-13 20:28:53 PDT
I'll take this one, RenderFieldset has a separate border drawing code path if there is a legend present to make sure the border doesn't overlap the legend. It needs to be upgraded to deal with Border Radii.
Alex Taylor
Comment 5
2008-06-18 04:02:33 PDT
Created
attachment 21812
[details]
Implements border radius logic for a fieldset, based off RenderObject's implementation This patch implements the border radius logic based off RenderObject's implementation but with parts that make sure the area around the legend is excluded. This just extends the current "draw the border pieces that don't overlap the legend" logic with some additional trigonometry to make the arcs shorter if the legend will overlap rather than just not rendering a corner piece. This seems to work well but I think we should instead make the legend be an clipped region of the border rather than 'avoiding drawing the border where the legend is' as the current (and this) implementation does. If that is the case, this entire function can hopefully be removed and the RenderObject version used, that would be a separate bug though. Firefox uses the clipped method, they clip the border around the bounding box of the legend element. This patch is for review only, no tests have been included in the patch.
Alex Taylor
Comment 6
2008-06-18 04:04:19 PDT
Created
attachment 21813
[details]
Additional test case. This displays many different situations that the legend can be in. Probably the basis for a layout test.
Alex Taylor
Comment 7
2008-06-18 04:10:09 PDT
Also, there are (double) and (int) c-style casts in there, should I be using static casts or another method, I haven't done any C++ casting in the past besides c-style so I need some pointers there.
Alex Taylor
Comment 8
2008-06-20 18:36:24 PDT
Created
attachment 21867
[details]
Method two: using a clipping region This patch uses the alternate way of clipping the legend. It clips the region where they legend will be displayed. This keeps the rendering consistent with the current case where there are no border radii but adds support but calling the parent's "paintBoxDecorations" method to follow the default code path but with a clipping region attached. This uses a lot less code than the current way of drawing the pieces around the legend and trying to not draw over the top of it. It also prevents code duplication between drawing borders for a fieldset and for a generic object. As a side note, testing showed that this is consistent with how Firefox handles the border radius + legend case on a fieldset.
mitz
Comment 9
2008-06-20 18:45:19 PDT
Comment on
attachment 21867
[details]
Method two: using a clipping region I like this approach much better than the other patch's. However, if you are removing the only call site to paintBorderMinusLegend(), you should also remove the method. Alternatively, you can choose to keep using it in the straight-corner case, since arguably clipping (and saving and restoring the graphics state) incurs a small performance cost.
Alex Taylor
Comment 10
2008-06-20 19:49:21 PDT
Created
attachment 21868
[details]
Method two: using a clipping region with no border radius speed up This patch adds a speed up to prevent unnecessary saving and restoring of the graphics context when we don't have border radii to deal with. Also added 3 layout tests for left align legend, right aligned legend and a really fat bordered fieldset where the clipping region is obvious.
mitz
Comment 11
2008-06-20 20:05:46 PDT
Comment on
attachment 21868
[details]
Method two: using a clipping region with no border radius speed up Looks good! A few comments: 1) Please add the bug URL and title to the change log and add change log comments about the code changes in each function. 2) Won't this paint fill layers a second time (except behind the legend)? + RenderBlock::paintBoxDecorations(paintInfo, tx, ty); Why are you not calling just paintBorder()? 3) Likewise, the change log for LayoutTests should include a reference to the bug. You should generate results (including pixel results) and include them in the patch. 4) Please add newlines: \ No newline at end of file 5) I think a single test containing the three separate cases would be better (make sure everything fits into the 800x600 rectangle that's included in pixel test results). Maybe something like LayoutTests/fast/block/basic/fieldset-stretch-to-legend.html , only adding border-radius, to cover all interesting cases. r- for now mostly because of 2)
mitz
Comment 12
2008-06-20 20:06:15 PDT
Comment on
attachment 21867
[details]
Method two: using a clipping region Removing the review flag, assuming this is obsoleted by the later patch.
Alex Taylor
Comment 13
2008-06-20 23:06:00 PDT
Created
attachment 21869
[details]
Method two: using a clipping region Addressed mitz concerns and changed call to paintBorderDecorations to paintBorder which was incorrect before. Added expected results to pixel test and created composite test case based from the base fieldset test,
mitz
Comment 14
2008-06-20 23:13:14 PDT
Comment on
attachment 21869
[details]
Method two: using a clipping region r=me LayoutTests/ChangeLog should include the expected results files, too, but this time the person landing the patch will have to add them.
mitz
Comment 15
2008-06-21 10:46:44 PDT
Landed in <
http://trac.webkit.org/changeset/34715
>.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug