Bug 69773

Summary: CSS 2.1 failure: border-spacing-applies-to-015.htm
Product: WebKit Reporter: Robert Hogan <robert>
Component: CSSAssignee: Robert Hogan <robert>
Status: RESOLVED FIXED    
Severity: Normal CC: hyatt, robert, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 47141    
Attachments:
Description Flags
Patch
none
Patch hyatt: review+

Description Robert Hogan 2011-10-10 11:34:53 PDT
WebKit only allows one caption per table.
Comment 1 Robert Hogan 2011-10-11 11:52:03 PDT
Created attachment 110553 [details]
Patch
Comment 2 Dave Hyatt 2011-11-01 11:36:45 PDT
Comment on attachment 110553 [details]
Patch

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

> Source/WebCore/rendering/RenderTable.cpp:203
> +        if (node())
> +          node()->setNeedsStyleRecalc();

Funny looking indentation here.

> Source/WebCore/rendering/RenderTable.cpp:738
> -                    recalcCaption(toRenderBlock(child));
> +                    toRenderBlock(child)->setNeedsLayout(true);

Why do you even need to mark it as needing layout? Can't you just yank this code completely?
Comment 3 Robert Hogan 2011-11-01 14:13:35 PDT
Created attachment 113214 [details]
Patch
Comment 4 Dave Hyatt 2011-11-02 11:29:37 PDT
Comment on attachment 113214 [details]
Patch

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

> Source/WebCore/rendering/RenderTable.cpp:1196
> -            if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) {
> +            if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || m_captions.contains(child))) {

Seems like it would be faster instead of asking if the child is contained in a Vector (which has to crawl the whole vector) to just say:

(child->isTableSection() || (child->isRenderBlock() && child->style()->display() == TABLE_CAPTION))
Comment 5 Dave Hyatt 2011-11-02 11:32:58 PDT
Comment on attachment 113214 [details]
Patch

r=me
Comment 6 Robert Hogan 2011-11-14 12:41:44 PST
Committed r100177: <http://trac.webkit.org/changeset/100177>