Commit 4699f527 authored by hyatt's avatar hyatt
Browse files

Second half of fix for 13793, make sure rules=groups works properly with

        spanning colgroups.

        Also make sure colgroups get an actual span of 1 (instead of incorrectly
        giving them a span of 0).

        Reviewed by mitz

        fast/table/colgroup-spanning-groups-rules.html

        * html/HTMLTableColElement.cpp:
        (WebCore::HTMLTableColElement::HTMLTableColElement):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::colElement):
        * rendering/RenderTable.h:
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::collapsedLeftBorder):
        (WebCore::RenderTableCell::collapsedRightBorder):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f5fc941d
2007-05-21 David Hyatt <hyatt@apple.com>
Second half of fix for 13793, make sure rules=groups works properly with
spanning colgroups.
Also make sure colgroups get an actual span of 1 (instead of incorrectly
giving them a span of 0).
Reviewed by mitz
fast/table/colgroup-spanning-groups-rules.html
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::HTMLTableColElement):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::colElement):
* rendering/RenderTable.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::collapsedLeftBorder):
(WebCore::RenderTableCell::collapsedRightBorder):
2007-05-20 David Hyatt <hyatt@apple.com>
 
Half of a fix for 13793, make sure rules=groups and border behave properly
......@@ -38,7 +38,7 @@ using namespace HTMLNames;
HTMLTableColElement::HTMLTableColElement(const QualifiedName& tagName, Document *doc)
: HTMLTablePartElement(tagName, doc)
{
_span = (tagName.matches(colgroupTag) ? 0 : 1);
_span = 1;
}
HTMLTagStatus HTMLTableColElement::endTagRequirement() const
......
......@@ -570,7 +570,7 @@ void RenderTable::appendColumn(int span)
setNeedsLayoutAndPrefWidthsRecalc();
}
RenderTableCol* RenderTable::colElement(int col) const
RenderTableCol* RenderTable::colElement(int col, bool* startEdge, bool* endEdge) const
{
if (!m_hasColElements)
return 0;
......@@ -582,9 +582,16 @@ RenderTableCol* RenderTable::colElement(int col) const
RenderTableCol* colElem = static_cast<RenderTableCol*>(child);
int span = colElem->span();
if (!colElem->firstChild()) {
int startCol = cCol;
int endCol = cCol + span - 1;
cCol += span;
if (cCol > col)
if (cCol > col) {
if (startEdge)
*startEdge = startCol == col;
if (endEdge)
*endEdge = endCol == col;
return colElem;
}
}
RenderObject* next = child->firstChild();
......
......@@ -160,7 +160,7 @@ public:
(collapseBorders() ? 0 : (paddingLeft() + paddingRight() + (numEffCols() + 1) * hBorderSpacing()));
}
RenderTableCol* colElement(int col) const;
RenderTableCol* colElement(int col, bool* startEdge = 0, bool* endEdge = 0) const;
bool needsSectionRecalc() const { return m_needsSectionRecalc; }
void setNeedsSectionRecalc()
......
......@@ -329,8 +329,10 @@ CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
}
// (5) Our column's left border.
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? colSpan() - 1 : 0));
if (colElt) {
bool startColEdge;
bool endColEdge;
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? colSpan() - 1 : 0), &startColEdge, &endColEdge);
if (colElt && (!rtl ? startColEdge : endColEdge)) {
result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL));
if (!result.exists())
return result;
......@@ -338,8 +340,8 @@ CollapsedBorderValue RenderTableCell::collapsedLeftBorder(bool rtl) const
// (6) The right border of the column to the left.
if (!leftmostColumn) {
colElt = tableElt->colElement(col() + (rtl ? colSpan() : -1));
if (colElt) {
colElt = tableElt->colElement(col() + (rtl ? colSpan() : -1), &startColEdge, &endColEdge);
if (colElt && (!rtl ? endColEdge : startColEdge)) {
result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), BCOL));
if (!result.exists())
return result;
......@@ -390,8 +392,10 @@ CollapsedBorderValue RenderTableCell::collapsedRightBorder(bool rtl) const
}
// (5) Our column's right border.
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? 0 : colSpan() - 1));
if (colElt) {
bool startColEdge;
bool endColEdge;
RenderTableCol* colElt = tableElt->colElement(col() + (rtl ? 0 : colSpan() - 1), &startColEdge, &endColEdge);
if (colElt && (!rtl ? endColEdge : startColEdge)) {
result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderRight(), BCOL));
if (!result.exists())
return result;
......@@ -399,8 +403,8 @@ CollapsedBorderValue RenderTableCell::collapsedRightBorder(bool rtl) const
// (6) The left border of the column to the right.
if (!rightmostColumn) {
colElt = tableElt->colElement(col() + (rtl ? -1 : colSpan()));
if (colElt) {
colElt = tableElt->colElement(col() + (rtl ? -1 : colSpan()), &startColEdge, &endColEdge);
if (colElt && (!rtl ? startColEdge : endColEdge)) {
result = compareBorders(result, CollapsedBorderValue(&colElt->style()->borderLeft(), BCOL));
if (!result.exists())
return result;
......
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