WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
6838
Incomplete repaint of collapsed table borders
https://bugs.webkit.org/show_bug.cgi?id=6838
Summary
Incomplete repaint of collapsed table borders
mitz
Reported
2006-01-26 05:25:58 PST
See the attached testcase. All tables in the testcase have border-collapse: collapse and border: 8px solid. The Test buttons make changes that require some or all of the table's border to be repainted, yet only the inner 4 pixels paint. To force repaint, switch to another tab and go back.
Attachments
Testcase
(1.84 KB, text/html)
2006-01-26 05:26 PST
,
mitz
no flags
Details
Basis for a possible fix
(10.38 KB, patch)
2006-01-26 09:50 PST
,
mitz
darin
: review-
Details
Formatted Diff
Diff
Patch
(27.60 KB, patch)
2006-04-14 09:40 PDT
,
mitz
hyatt
: review-
Details
Formatted Diff
Diff
Table background test case
(420 bytes, text/html)
2006-04-18 04:14 PDT
,
mitz
no flags
Details
Current background positioning
(4.54 KB, image/png)
2006-04-18 04:15 PDT
,
mitz
no flags
Details
Background positioning with the patch
(4.69 KB, image/png)
2006-04-18 04:17 PDT
,
mitz
no flags
Details
Another background test case
(793 bytes, text/html)
2006-04-20 13:49 PDT
,
mitz
no flags
Details
WinIE rendering
(2.13 KB, image/png)
2006-04-20 13:50 PDT
,
mitz
no flags
Details
Firefox rendering
(1.96 KB, image/png)
2006-04-20 13:51 PDT
,
mitz
no flags
Details
TOT WebKit rendering
(2.07 KB, image/png)
2006-04-20 13:51 PDT
,
mitz
no flags
Details
Patched WebKit rendering - painting in the table's border box
(2.13 KB, image/png)
2006-04-20 13:54 PDT
,
mitz
no flags
Details
Patch including change log and repaint test
(41.18 KB, patch)
2006-05-03 06:43 PDT
,
mitz
hyatt
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
mitz
Comment 1
2006-01-26 05:26:59 PST
Created
attachment 5987
[details]
Testcase
mitz
Comment 2
2006-01-26 09:50:26 PST
Created
attachment 5990
[details]
Basis for a possible fix I'm not sure this is the right approach. If it is, then the margin overflow dimensions should probably be cached by the table and the FIXMEs should be addressed.
Darin Adler
Comment 3
2006-01-27 08:50:32 PST
Comment on
attachment 5990
[details]
Basis for a possible fix I'm disappointed we have to add so much new code, but it looks pretty good to me. Is there any way to share more of this? Should we invent a structure that holds the four separate widths so it can be a single function instead of 4? I believe you forgot to mark the functions virtual. + const BorderValue sb = style()->borderRight(); We normally don't mark local variables const. + return int(borderWidth / 2.0 + 0.5); Can be done more efficiently by doing (borderWidth + 1) / 2. This idiom comes up multiple times.
mitz
Comment 4
2006-01-28 12:54:14 PST
I've run into another problem: if you Select All in the testcase, the selection highlight eats into the last table's border. (I wonder why that table's contents aren't selected btw).
Dave Hyatt
Comment 5
2006-02-12 01:08:38 PST
Note that our implementation of collapsed table borders no longer matches the spec. The spec actually changed. "UAs must compute an initial left and right border width for the table by examining the first and last cells in the first row of the table. The left border width of the table is half of the first cell's collapsed left border, and the right border width of the table is half of the last cell's collapsed right border. If subsequent rows have larger collapsed left and right borders, then any excess spills into the margin area of the table. The top border width of the table is computed by examining all cells who collapse their top borders with the top border of the table. The top border width of the table is equal to half of the maximum collapsed top border. The bottom border width is computed by examining all cells whose bottom borders collapse with the bottom of the table. The bottom border width is equal to half of the maximum collapsed bottom border." So top/bottom collapsed border overflow is no longer possible, and left/right overflow becomes extremely unlikely with these changes.
mitz
Comment 6
2006-04-13 06:41:28 PDT
Going to try again.
mitz
Comment 7
2006-04-14 09:40:33 PDT
Created
attachment 7701
[details]
Patch This patch implements the updated spec. Some notes: 1. It might be better to cache outerBorderLeft/Right/Top/Bottom in RenderTable as well. 2. The spec says "CSS 2.1 does not define where the edge of a background on a table element lies" but I tried to maintain the current behavior. It works with solid backgrounds but image backgrounds are positioned differently, and I am not sure how to fix it. 3. The patch causes 43 layout tests to fail. With the exception of pixel failures due to (2) above, the new layouts look correct to me. 4. Some failures are due to the dump showing "[border: none]" due to the fact that a table has a non-zero border but its own border-width property is zero.
Dave Hyatt
Comment 8
2006-04-18 00:02:24 PDT
Comment on
attachment 7701
[details]
Patch This looks good to me.
Dave Hyatt
Comment 9
2006-04-18 00:03:31 PDT
Can you provide a testcase that illustrates an example where the image background changes? (Maybe include screenshots). We should probably understand that different before we land anything.
Dave Hyatt
Comment 10
2006-04-18 00:03:58 PDT
difference. :)
mitz
Comment 11
2006-04-18 04:14:52 PDT
Created
attachment 7797
[details]
Table background test case
mitz
Comment 12
2006-04-18 04:15:16 PDT
Created
attachment 7798
[details]
Current background positioning
mitz
Comment 13
2006-04-18 04:17:40 PDT
Created
attachment 7799
[details]
Background positioning with the patch (In reply to
comment #9
)
> Can you provide a testcase that illustrates an example where the image > background changes? (Maybe include screenshots). We should probably understand > that different before we land anything.
The difference is clear. I just don't know if paintBackground or paintBackgroundExtended can do what I want them to do.
Dave Hyatt
Comment 14
2006-04-18 14:32:40 PDT
Comment on
attachment 7701
[details]
Patch Discussing the image positioning issue some more on IRC right now. :)
Dave Hyatt
Comment 15
2006-04-18 14:46:02 PDT
Check WinIE to study what they do. We may need a quirk. Painting in the table's border box in strict mode seems like the right thing to do. It won't match anyone else probably because nobody else has implemented this new spec.
mitz
Comment 16
2006-04-20 13:49:55 PDT
Created
attachment 7855
[details]
Another background test case
mitz
Comment 17
2006-04-20 13:50:46 PDT
Created
attachment 7856
[details]
WinIE rendering
mitz
Comment 18
2006-04-20 13:51:15 PDT
Created
attachment 7857
[details]
Firefox rendering
mitz
Comment 19
2006-04-20 13:51:44 PDT
Created
attachment 7858
[details]
TOT WebKit rendering
mitz
Comment 20
2006-04-20 13:54:45 PDT
Created
attachment 7859
[details]
Patched WebKit rendering - painting in the table's border box This is with the patch (
attachment 7701
[details]
) minus these lines: + if (collapseBorders()) { + _tx += borderLeft(); + w -= borderLeft() + borderRight(); + _ty += borderTop(); + h -= borderTop() + borderBottom(); + }
mitz
Comment 21
2006-04-20 13:58:42 PDT
Neither browser rendered the table differently w/o the DOCTYPE.
mitz
Comment 22
2006-05-03 06:43:35 PDT
Created
attachment 8094
[details]
Patch including change log and repaint test Changed background positioning (by removing the 6 lines mentioned in the previous comment). I reviewed layout/pixel test failures from this patch and they all look like the new results should be accepted.
Dave Hyatt
Comment 23
2006-05-06 22:59:56 PDT
Comment on
attachment 8094
[details]
Patch including change log and repaint test r=me
Darin Adler
Comment 24
2006-05-14 21:37:45 PDT
Committed revision 14372.
mitz
Comment 25
2006-05-20 00:38:14 PDT
The fix for this bug caused
bug 9009
.
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