WebCore:
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 21:56:31 +0000 (21:56 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2008 21:56:31 +0000 (21:56 +0000)
commita219382f2b325a4839c4378f55d64163c78e402e
tree12c1a428cf350a8369852b1d0a4138695cca96a4
parent2dfae579242396268e54b9b259d1ab80b7bb21de
WebCore:

        Fix for http://bugs.webkit.org/show_bug.cgi?id=14975

        Computed size of padding is incorrect because we default padding to auto.  This is a made-up value that
        was only used to implement cellpadding on tables.  We needed this made-up value in order to tell that
        padding wasn't set so that we could then apply cellpadding.

        This patch rewrites cellpadding to be like other browsers.  Instead of being a setting on the table
        renderer that applies to all cells (even ones that were not <td>s), cellpadding is now mapped into the
        style of <td>s.  With this change it effectively becomes a content model feature and not a rendering
        feature.

        For example, a <td> will pick up cellpadding even when it is not a cell and/or the enclosing <table> is
        not a table.  Anonymous cells and CSS-display-type cells will now never pick up cellpadding.  This behavior
        is all consistent with other browsers.

        Reviewed by Antti

        Added fast/css/padding-no-renderer.html

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::canShareStyleWithElement):
        (WebCore::CSSStyleSelector::styleForElement):
        * css/CSSStyleSelector.h:
        * dom/StyledElement.cpp:
        * dom/StyledElement.h:
        (WebCore::StyledElement::canHaveAdditionalAttributeStyleDecls):
        (WebCore::StyledElement::additionalAttributeStyleDecls):
        * html/HTMLTableCellElement.cpp:
        (WebCore::HTMLTableCellElement::additionalAttributeStyleDecls):
        * html/HTMLTableCellElement.h:
        (WebCore::HTMLTableCellElement::canHaveAdditionalAttributeStyleDecls):
        * html/HTMLTableColElement.cpp:
        (WebCore::HTMLTableColElement::additionalAttributeStyleDecls):
        * html/HTMLTableColElement.h:
        (WebCore::HTMLTableColElement::canHaveAdditionalAttributeStyleDecls):
        * html/HTMLTableElement.cpp:
        (WebCore::HTMLTableElement::parseMappedAttribute):
        (WebCore::HTMLTableElement::additionalAttributeStyleDecls):
        (WebCore::HTMLTableElement::addSharedCellDecls):
        (WebCore::HTMLTableElement::addSharedCellBordersDecl):
        (WebCore::HTMLTableElement::addSharedCellPaddingDecl):
        (WebCore::HTMLTableElement::addSharedGroupDecls):
        (WebCore::HTMLTableElement::attach):
        * html/HTMLTableElement.h:
        (WebCore::HTMLTableElement::canHaveAdditionalAttributeStyleDecls):
        * html/HTMLTableSectionElement.cpp:
        (WebCore::HTMLTableSectionElement::additionalAttributeStyleDecls):
        * html/HTMLTableSectionElement.h:
        (WebCore::HTMLTableSectionElement::canHaveAdditionalAttributeStyleDecls):
        * rendering/AutoTableLayout.cpp:
        (WebCore::AutoTableLayout::recalcColumn):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::paddingTop):
        (WebCore::RenderObject::paddingBottom):
        (WebCore::RenderObject::paddingLeft):
        (WebCore::RenderObject::paddingRight):
        * rendering/RenderStyle.cpp:
        (WebCore::StyleSurroundData::StyleSurroundData):
        * rendering/RenderStyle.h:
        (WebCore::RenderStyle::initialPadding):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::RenderTable):
        * rendering/RenderTable.h:

LayoutTests:

        Updated results for http://bugs.webkit.org/show_bug.cgi?id=14975

        Reviewed by Antti

        * fast/css/computed-style-without-renderer-expected.txt:
        * fast/css/padding-no-renderer-expected.txt: Added.
        * fast/css/padding-no-renderer.html: Added.
        * platform/mac/fast/css/acid2-expected.checksum:
        * platform/mac/fast/css/acid2-expected.png:
        * platform/mac/fast/css/acid2-expected.txt:
        * platform/mac/fast/css/acid2-pixel-expected.checksum:
        * platform/mac/fast/css/acid2-pixel-expected.png:
        * platform/mac/fast/css/acid2-pixel-expected.txt:
        * platform/mac/fast/frames/viewsource-attribute-expected.checksum:
        * platform/mac/fast/frames/viewsource-attribute-expected.png:
        * platform/mac/fast/frames/viewsource-attribute-expected.txt:
        * platform/mac/fast/lists/ordered-list-with-no-ol-tag-expected.checksum:
        * platform/mac/fast/lists/ordered-list-with-no-ol-tag-expected.png:
        * platform/mac/fast/lists/ordered-list-with-no-ol-tag-expected.txt:
        * platform/mac/fast/table/add-before-anonymous-child-expected.checksum:
        * platform/mac/fast/table/add-before-anonymous-child-expected.png:
        * platform/mac/fast/table/add-before-anonymous-child-expected.txt:
        * platform/mac/fast/table/cell-absolute-child-expected.checksum:
        * platform/mac/fast/table/cell-absolute-child-expected.png:
        * platform/mac/fast/table/cell-absolute-child-expected.txt:
        * platform/mac/fast/table/frame-and-rules-expected.checksum:
        * platform/mac/fast/table/frame-and-rules-expected.png:
        * platform/mac/fast/table/frame-and-rules-expected.txt:
        * platform/mac/http/tests/misc/acid2-expected.checksum:
        * platform/mac/http/tests/misc/acid2-expected.png:
        * platform/mac/http/tests/misc/acid2-expected.txt:
        * platform/mac/http/tests/misc/acid2-pixel-expected.checksum:
        * platform/mac/http/tests/misc/acid2-pixel-expected.png:
        * platform/mac/http/tests/misc/acid2-pixel-expected.txt:
        * platform/mac/tables/mozilla/bugs/bug30985-expected.checksum:
        * platform/mac/tables/mozilla/bugs/bug30985-expected.png:
        * platform/mac/tables/mozilla/bugs/bug30985-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
53 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/computed-style-without-renderer-expected.txt
LayoutTests/fast/css/padding-no-renderer-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/padding-no-renderer.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/acid2-expected.checksum
LayoutTests/platform/mac/fast/css/acid2-expected.png
LayoutTests/platform/mac/fast/css/acid2-expected.txt
LayoutTests/platform/mac/fast/css/acid2-pixel-expected.checksum
LayoutTests/platform/mac/fast/css/acid2-pixel-expected.png
LayoutTests/platform/mac/fast/css/acid2-pixel-expected.txt
LayoutTests/platform/mac/fast/frames/viewsource-attribute-expected.checksum
LayoutTests/platform/mac/fast/frames/viewsource-attribute-expected.png
LayoutTests/platform/mac/fast/frames/viewsource-attribute-expected.txt
LayoutTests/platform/mac/fast/lists/ordered-list-with-no-ol-tag-expected.checksum
LayoutTests/platform/mac/fast/lists/ordered-list-with-no-ol-tag-expected.png
LayoutTests/platform/mac/fast/lists/ordered-list-with-no-ol-tag-expected.txt
LayoutTests/platform/mac/fast/table/add-before-anonymous-child-expected.checksum
LayoutTests/platform/mac/fast/table/add-before-anonymous-child-expected.png
LayoutTests/platform/mac/fast/table/add-before-anonymous-child-expected.txt
LayoutTests/platform/mac/fast/table/cell-absolute-child-expected.checksum
LayoutTests/platform/mac/fast/table/cell-absolute-child-expected.png
LayoutTests/platform/mac/fast/table/cell-absolute-child-expected.txt
LayoutTests/platform/mac/fast/table/frame-and-rules-expected.checksum
LayoutTests/platform/mac/fast/table/frame-and-rules-expected.png
LayoutTests/platform/mac/fast/table/frame-and-rules-expected.txt
LayoutTests/platform/mac/http/tests/misc/acid2-expected.checksum
LayoutTests/platform/mac/http/tests/misc/acid2-expected.png
LayoutTests/platform/mac/http/tests/misc/acid2-expected.txt
LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.checksum
LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.png
LayoutTests/platform/mac/http/tests/misc/acid2-pixel-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug30985-expected.checksum
LayoutTests/platform/mac/tables/mozilla/bugs/bug30985-expected.png
LayoutTests/platform/mac/tables/mozilla/bugs/bug30985-expected.txt
WebCore/ChangeLog
WebCore/css/CSSStyleSelector.cpp
WebCore/css/CSSStyleSelector.h
WebCore/dom/StyledElement.cpp
WebCore/dom/StyledElement.h
WebCore/html/HTMLTableCellElement.cpp
WebCore/html/HTMLTableCellElement.h
WebCore/html/HTMLTableColElement.cpp
WebCore/html/HTMLTableColElement.h
WebCore/html/HTMLTableElement.cpp
WebCore/html/HTMLTableElement.h
WebCore/html/HTMLTableSectionElement.cpp
WebCore/html/HTMLTableSectionElement.h
WebCore/rendering/AutoTableLayout.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderStyle.cpp
WebCore/rendering/RenderStyle.h
WebCore/rendering/RenderTable.cpp
WebCore/rendering/RenderTable.h