Bug 101060 - Fix the collapsing border code to handle mixed directionality at the row level
Summary: Fix the collapsing border code to handle mixed directionality at the row level
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Julien Chaffraix
URL:
Keywords:
Depends on:
Blocks: 79272
  Show dependency treegraph
 
Reported: 2012-11-02 08:24 PDT by Julien Chaffraix
Modified: 2012-11-04 23:55 PST (History)
4 users (show)

See Also:


Attachments
Proposed change: fixed the collapsing border code. (20.09 KB, patch)
2012-11-02 09:02 PDT, Julien Chaffraix
no flags Details | Formatted Diff | Diff
Updated change: fixed per Ojan's comment. (20.24 KB, patch)
2012-11-02 11:02 PDT, Julien Chaffraix
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2012-11-02 08:24:27 PDT
Our current border collapsing code wrongly ignores any direction queues below the table-row-group (section in WebKit speak).

Other browsers (and the specification) don't have this limitation. This is another step towards fixing bug 79272 and properly supporting mixed direction at the cell level.
Comment 1 Julien Chaffraix 2012-11-02 09:02:02 PDT
Created attachment 172074 [details]
Proposed change: fixed the collapsing border code.
Comment 2 Ojan Vafai 2012-11-02 09:32:39 PDT
Comment on attachment 172074 [details]
Proposed change: fixed the collapsing border code.

View in context: https://bugs.webkit.org/attachment.cgi?id=172074&action=review

r- for the test.

> Source/WebCore/ChangeLog:43
> +        Updated these functios to work with mixed directionality.

typo: functios

> Source/WebCore/ChangeLog:56
> +        This is a bug in our implementation: we used to return a non-zero width for inexistant borders (per CSS 2.1,
> +        'border-style: off | hidden' should have a 0 width).

I don't see a test for this fix.

> Source/WebCore/rendering/RenderTableSection.cpp:1276
> +    ASSERT_UNUSED(cell, cell->isFirstOrLastCellInRow());

this should just be an ASSERT now.

> LayoutTests/fast/table/border-collapsing/table-ltr-rows-mixed-direction-expected.html:1
> +<!DOCTYPE>

This doctype is quirksmode I believe. You should be using <!DOCTYPE html>.
Comment 3 Julien Chaffraix 2012-11-02 10:32:53 PDT
Comment on attachment 172074 [details]
Proposed change: fixed the collapsing border code.

View in context: https://bugs.webkit.org/attachment.cgi?id=172074&action=review

>> Source/WebCore/ChangeLog:56
>> +        'border-style: off | hidden' should have a 0 width).
> 
> I don't see a test for this fix.

This is covered by LayoutTests/fast/table/border-collapsing/last-cell-left-border-hidden-table-ltr-section-rtl.html which was showing a diff due to having a 3px hidden border returning a width of 3px instead of 0px.

>> LayoutTests/fast/table/border-collapsing/table-ltr-rows-mixed-direction-expected.html:1
>> +<!DOCTYPE>
> 
> This doctype is quirksmode I believe. You should be using <!DOCTYPE html>.

Good catch, dumb error. This should put the document in quirksmode per HTML5 parsing.
Comment 4 Ojan Vafai 2012-11-02 10:37:39 PDT
Comment on attachment 172074 [details]
Proposed change: fixed the collapsing border code.

View in context: https://bugs.webkit.org/attachment.cgi?id=172074&action=review

>>> Source/WebCore/ChangeLog:56
>>> +        'border-style: off | hidden' should have a 0 width).
>> 
>> I don't see a test for this fix.
> 
> This is covered by LayoutTests/fast/table/border-collapsing/last-cell-left-border-hidden-table-ltr-section-rtl.html which was showing a diff due to having a 3px hidden border returning a width of 3px instead of 0px.

I don't see a diff for this in this patch. Maybe you forgot to include it?
Comment 5 Julien Chaffraix 2012-11-02 10:55:16 PDT
Comment on attachment 172074 [details]
Proposed change: fixed the collapsing border code.

View in context: https://bugs.webkit.org/attachment.cgi?id=172074&action=review

>>>> Source/WebCore/ChangeLog:56
>>>> +        'border-style: off | hidden' should have a 0 width).
>>> 
>>> I don't see a test for this fix.
>> 
>> This is covered by LayoutTests/fast/table/border-collapsing/last-cell-left-border-hidden-table-ltr-section-rtl.html which was showing a diff due to having a 3px hidden border returning a width of 3px instead of 0px.
> 
> I don't see a diff for this in this patch. Maybe you forgot to include it?

The test was showing a local diff before I touched CollapsedBorderValue::width. The diff was wrong and was what caused me to find this bug (ie that we could have a 3px hidden green border that would add 3px to our cell's logical width). The root cause of this change is that we are changing which borders are considered during resolution.

FWIW our collapsing border resolution code is not very air-tight due to its complexity and this should make it more robust.
Comment 6 Julien Chaffraix 2012-11-02 11:02:35 PDT
Created attachment 172089 [details]
Updated change: fixed per Ojan's comment.
Comment 7 WebKit Review Bot 2012-11-04 23:55:53 PST
Comment on attachment 172089 [details]
Updated change: fixed per Ojan's comment.

Clearing flags on attachment: 172089

Committed r133439: <http://trac.webkit.org/changeset/133439>
Comment 8 WebKit Review Bot 2012-11-04 23:55:57 PST
All reviewed patches have been landed.  Closing bug.