2008-10-01 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Dave Hyatt

        Clean up code that changes the RenderStyle passed in to
        table renderer setStyle() methods.

        https://bugs.webkit.org/show_bug.cgi?id=21287

        Tests: fast/table/floating-th.html
               fast/table/table-display-types-strict.html
               fast/table/table-display-types.html

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::adjustRenderStyle):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::setStyle):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::setStyle):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::setStyle):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cb1ab089
2008-10-01 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dave Hyatt
New tests for display types and float on table elements.
https://bugs.webkit.org/show_bug.cgi?id=21287
* fast/table/floating-th.html: Added.
* fast/table/table-display-types-strict.html: Added.
* fast/table/table-display-types.html: Added.
* platform/mac/fast/table/floating-th-expected.txt: Added.
* platform/mac/fast/table/table-display-types-expected.txt: Added.
* platform/mac/fast/table/table-display-types-strict-expected.txt: Added.
2008-10-02 Adele Peterson <adele@apple.com>
Reviewed by Dan Bernstein.
......
2008-10-01 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dave Hyatt
Clean up code that changes the RenderStyle passed in to
table renderer setStyle() methods.
https://bugs.webkit.org/show_bug.cgi?id=21287
Tests: fast/table/floating-th.html
fast/table/table-display-types-strict.html
fast/table/table-display-types.html
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::adjustRenderStyle):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::setStyle):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::setStyle):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::setStyle):
2008-10-02 Darin Adler <darin@apple.com>
- fix build
......
......@@ -1360,6 +1360,18 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
style->setDisplay(style->isDisplayInlineType() ? INLINE_TABLE : TABLE);
}
if (e && (e->hasTagName(tdTag) || e->hasTagName(thTag))) {
if (style->whiteSpace() == KHTML_NOWRAP) {
// Figure out if we are really nowrapping or if we should just
// use normal instead. If the width of the cell is fixed, then
// we don't actually use NOWRAP.
if (style->width().isFixed())
style->setWhiteSpace(NORMAL);
else
style->setWhiteSpace(NOWRAP);
}
}
// Tables never support the -webkit-* values for text-align and will reset back to the default.
if (e && e->hasTagName(tableTag) && (style->textAlign() == WEBKIT_LEFT || style->textAlign() == WEBKIT_CENTER || style->textAlign() == WEBKIT_RIGHT))
style->setTextAlign(TAAUTO);
......
......@@ -225,17 +225,7 @@ void RenderTableCell::setStyle(RenderStyle* newStyle)
if (parent() && section() && style() && style()->height() != newStyle->height())
section()->setNeedsCellRecalc();
newStyle->setDisplay(TABLE_CELL);
if (newStyle->whiteSpace() == KHTML_NOWRAP) {
// Figure out if we are really nowrapping or if we should just
// use normal instead. If the width of the cell is fixed, then
// we don't actually use NOWRAP.
if (newStyle->width().isFixed())
newStyle->setWhiteSpace(NORMAL);
else
newStyle->setWhiteSpace(NOWRAP);
}
ASSERT(newStyle->display() == TABLE_CELL);
RenderBlock::setStyle(newStyle);
setHasBoxDecorations(true);
......
......@@ -59,7 +59,7 @@ void RenderTableRow::setStyle(RenderStyle* newStyle)
if (section() && style() && style()->height() != newStyle->height())
section()->setNeedsCellRecalc();
newStyle->setDisplay(TABLE_ROW);
ASSERT(newStyle->display() == TABLE_ROW);
RenderContainer::setStyle(newStyle);
}
......
......@@ -79,17 +79,6 @@ void RenderTableSection::destroy()
recalcTable->setNeedsSectionRecalc();
}
void RenderTableSection::setStyle(RenderStyle* newStyle)
{
// we don't allow changing this one
if (style())
newStyle->setDisplay(style()->display());
else if (newStyle->display() != TABLE_FOOTER_GROUP && newStyle->display() != TABLE_HEADER_GROUP)
newStyle->setDisplay(TABLE_ROW_GROUP);
RenderContainer::setStyle(newStyle);
}
void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
......
......@@ -45,8 +45,6 @@ public:
virtual void destroy();
virtual void setStyle(RenderStyle*);
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual int lineHeight(bool firstLine, bool isRootLineBox = false) const { return 0; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment