Diff
Modified: trunk/LayoutTests/ChangeLog (132640 => 132641)
--- trunk/LayoutTests/ChangeLog 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/LayoutTests/ChangeLog 2012-10-26 13:13:00 UTC (rev 132641)
@@ -1,3 +1,17 @@
+2012-10-26 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r132612.
+ http://trac.webkit.org/changeset/132612
+ https://bugs.webkit.org/show_bug.cgi?id=100512
+
+ Crashes fast/events/tabindex-focus-blur-all.html in debug mode
+ (Requested by pfeldman on #webkit).
+
+ * fast/table/col-span-change-relayout-expected.txt: Removed.
+ * fast/table/col-span-change-relayout.html: Removed.
+ * fast/table/simplified-layout-table-expected.html: Removed.
+ * fast/table/simplified-layout-table.html: Removed.
+
2012-10-26 Dominik Röttsches <[email protected]>
Unreviewed Apple Win gardening.
Deleted: trunk/LayoutTests/fast/table/col-span-change-relayout-expected.txt (132640 => 132641)
--- trunk/LayoutTests/fast/table/col-span-change-relayout-expected.txt 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/LayoutTests/fast/table/col-span-change-relayout-expected.txt 2012-10-26 13:13:00 UTC (rev 132641)
@@ -1,7 +0,0 @@
-This test checks that dynamically changing a column's 'span' properly recompute the cell's widths.
-
-The table below shrink to 200px after changing the column's span.
-
-PASS
-PASS
-
Deleted: trunk/LayoutTests/fast/table/col-span-change-relayout.html (132640 => 132641)
--- trunk/LayoutTests/fast/table/col-span-change-relayout.html 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/LayoutTests/fast/table/col-span-change-relayout.html 2012-10-26 13:13:00 UTC (rev 132641)
@@ -1,58 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <script src=""
- <style>
- table
- {
- border-collapse: collapse;
- table-layout: fixed;
- width: 200px;
- }
- td
- {
- background: green;
- height: 1em;
- }
- </style>
- <script>
- if (window.testRunner)
- testRunner.dumpAsText();
-
- function log(msg)
- {
- var console = document.getElementById('console');
- console.appendChild(document.createTextNode(msg));
- console.appendChild(document.createElement('br'));
- }
-
- function changeColSpan()
- {
- document.getElementById('table').setAttribute('data-expected-width', 300);
- checkLayout('table');
-
- var col = document.getElementById('column');
- col.setAttribute("span", "1");
- document.getElementById('table').setAttribute('data-expected-width', 200);
- checkLayout('table');
- }
- </script>
- </head>
- <body _onload_="changeColSpan();">
- <p>This test checks that dynamically changing a column's 'span' properly recompute the cell's widths.</p>
- <p>The table below shrink to 200px after changing the column's span.</p>
- <table id="table">
- <colgroup>
- <col span="2" id="column" style="width: 100px"></col>
- <col style="width: 100px;"></col>
- </colgroup>
- <tr>
- <td id="cell"></td>
- <td></td>
- <td></td>
- </tr>
- </table>
- <p id="console"></p>
- </body>
-</html>
-
Deleted: trunk/LayoutTests/fast/table/simplified-layout-table-expected.html (132640 => 132641)
--- trunk/LayoutTests/fast/table/simplified-layout-table-expected.html 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/LayoutTests/fast/table/simplified-layout-table-expected.html 2012-10-26 13:13:00 UTC (rev 132641)
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-div {
- height: 100px;
- width: 100px;
- background-color: green;
- opacity: 0.8;
- padding: 0px;
- -webkit-transform: translate(50px, 50px);
-}
-</style>
-</head>
-<p>Test for <a href="" and RenderTableCol::layout should never be called.</p>
-<p>This test checks that simplified layout works on a table with a <col>.</p>
-<div></div>
-</html>
Deleted: trunk/LayoutTests/fast/table/simplified-layout-table.html (132640 => 132641)
--- trunk/LayoutTests/fast/table/simplified-layout-table.html 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/LayoutTests/fast/table/simplified-layout-table.html 2012-10-26 13:13:00 UTC (rev 132641)
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-table {
- border-spacing: 0px;
-}
-col {
- width: 100px;
-}
-td {
- height: 100px;
- background-color: green;
- opacity: 0.8;
- padding: 0px;
-}
-td.transformed {
- -webkit-transform: translate(50px, 50px);
-}
-</style>
-<script>
-function simplifiedLayout()
-{
- var cell = document.getElementsByTagName("td")[0];
- // Force layout.
- cell.offsetTop;
- cell.classList.add("transformed");
-}
-window.addEventListener("load", simplifiedLayout);
-</script>
-</head>
-<p>Test for <a href="" and RenderTableCol::layout should never be called.</p>
-<p>This test checks that simplified layout works on a table with a <col>.</p>
-<table>
- <col></col>
- <tbody>
- <tr><td></td></tr>
- </tbody>
-</table>
-</html>
Modified: trunk/Source/WebCore/ChangeLog (132640 => 132641)
--- trunk/Source/WebCore/ChangeLog 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/Source/WebCore/ChangeLog 2012-10-26 13:13:00 UTC (rev 132641)
@@ -1,3 +1,25 @@
+2012-10-26 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r132612.
+ http://trac.webkit.org/changeset/132612
+ https://bugs.webkit.org/show_bug.cgi?id=100512
+
+ Crashes fast/events/tabindex-focus-blur-all.html in debug mode
+ (Requested by pfeldman on #webkit).
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::AutoTableLayout::recalcColumn):
+ * rendering/FixedTableLayout.cpp:
+ (WebCore::FixedTableLayout::calcWidthArray):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::layout):
+ * rendering/RenderTableCol.cpp:
+ (WebCore::RenderTableCol::styleDidChange):
+ (WebCore::RenderTableCol::updateFromElement):
+ (WebCore::RenderTableCol::computePreferredLogicalWidths):
+ * rendering/RenderTableCol.h:
+ (RenderTableCol):
+
2012-10-26 Pavel Feldman <[email protected]>
Web Inspector: fast return upon setting the same dock side.
Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (132640 => 132641)
--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp 2012-10-26 13:13:00 UTC (rev 132641)
@@ -49,77 +49,81 @@
RenderTableCell* fixedContributor = 0;
RenderTableCell* maxContributor = 0;
- for (RenderTableSection* section = m_table->topNonEmptySection(); section; section = m_table->sectionBelow(section, SkipEmptySections)) {
- unsigned numRows = section->numRows();
- ASSERT(numRows);
- for (unsigned i = 0; i < numRows; i++) {
- RenderTableSection::CellStruct current = section->cellAt(i, effCol);
- RenderTableCell* cell = current.primaryCell();
+ for (RenderObject* child = m_table->children()->firstChild(); child; child = child->nextSibling()) {
+ if (child->isRenderTableCol())
+ toRenderTableCol(child)->computePreferredLogicalWidths();
+ else if (child->isTableSection()) {
+ RenderTableSection* section = toRenderTableSection(child);
+ unsigned numRows = section->numRows();
+ for (unsigned i = 0; i < numRows; i++) {
+ RenderTableSection::CellStruct current = section->cellAt(i, effCol);
+ RenderTableCell* cell = current.primaryCell();
+
+ if (current.inColSpan || !cell)
+ continue;
- if (current.inColSpan || !cell)
- continue;
+ bool cellHasContent = cell->children()->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
+ if (cellHasContent)
+ columnLayout.emptyCellsOnly = false;
- bool cellHasContent = cell->children()->firstChild() || cell->style()->hasBorder() || cell->style()->hasPadding();
- if (cellHasContent)
- columnLayout.emptyCellsOnly = false;
+ // A cell originates in this column. Ensure we have
+ // a min/max width of at least 1px for this column now.
+ columnLayout.minLogicalWidth = max<int>(columnLayout.minLogicalWidth, cellHasContent ? 1 : 0);
+ columnLayout.maxLogicalWidth = max<int>(columnLayout.maxLogicalWidth, 1);
- // A cell originates in this column. Ensure we have
- // a min/max width of at least 1px for this column now.
- columnLayout.minLogicalWidth = max<int>(columnLayout.minLogicalWidth, cellHasContent ? 1 : 0);
- columnLayout.maxLogicalWidth = max<int>(columnLayout.maxLogicalWidth, 1);
+ if (cell->colSpan() == 1) {
+ if (cell->preferredLogicalWidthsDirty())
+ cell->computePreferredLogicalWidths();
+ columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth(), columnLayout.minLogicalWidth);
+ if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogicalWidth) {
+ columnLayout.maxLogicalWidth = cell->maxPreferredLogicalWidth();
+ maxContributor = cell;
+ }
- if (cell->colSpan() == 1) {
- if (cell->preferredLogicalWidthsDirty())
- cell->computePreferredLogicalWidths();
- columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth(), columnLayout.minLogicalWidth);
- if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogicalWidth) {
- columnLayout.maxLogicalWidth = cell->maxPreferredLogicalWidth();
- maxContributor = cell;
- }
-
- // All browsers implement a size limit on the cell's max width.
- // Our limit is based on KHTML's representation that used 16 bits widths.
- // FIXME: Other browsers have a lower limit for the cell's max width.
- const int cCellMaxWidth = 32760;
- Length cellLogicalWidth = cell->styleOrColLogicalWidth();
- if (cellLogicalWidth.value() > cCellMaxWidth)
- cellLogicalWidth.setValue(cCellMaxWidth);
- if (cellLogicalWidth.isNegative())
- cellLogicalWidth.setValue(0);
- switch (cellLogicalWidth.type()) {
- case Fixed:
- // ignore width=0
- if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercent()) {
- LayoutUnit logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth.value());
- if (columnLayout.logicalWidth.isFixed()) {
- // Nav/IE weirdness
- if ((logicalWidth > columnLayout.logicalWidth.value())
- || ((columnLayout.logicalWidth.value() == logicalWidth) && (maxContributor == cell))) {
+ // All browsers implement a size limit on the cell's max width.
+ // Our limit is based on KHTML's representation that used 16 bits widths.
+ // FIXME: Other browsers have a lower limit for the cell's max width.
+ const int cCellMaxWidth = 32760;
+ Length cellLogicalWidth = cell->styleOrColLogicalWidth();
+ if (cellLogicalWidth.value() > cCellMaxWidth)
+ cellLogicalWidth.setValue(cCellMaxWidth);
+ if (cellLogicalWidth.isNegative())
+ cellLogicalWidth.setValue(0);
+ switch (cellLogicalWidth.type()) {
+ case Fixed:
+ // ignore width=0
+ if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercent()) {
+ LayoutUnit logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth.value());
+ if (columnLayout.logicalWidth.isFixed()) {
+ // Nav/IE weirdness
+ if ((logicalWidth > columnLayout.logicalWidth.value())
+ || ((columnLayout.logicalWidth.value() == logicalWidth) && (maxContributor == cell))) {
+ columnLayout.logicalWidth.setValue(Fixed, logicalWidth);
+ fixedContributor = cell;
+ }
+ } else {
columnLayout.logicalWidth.setValue(Fixed, logicalWidth);
fixedContributor = cell;
}
- } else {
- columnLayout.logicalWidth.setValue(Fixed, logicalWidth);
- fixedContributor = cell;
}
+ break;
+ case Percent:
+ m_hasPercent = true;
+ if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercent() || cellLogicalWidth.value() > columnLayout.logicalWidth.value()))
+ columnLayout.logicalWidth = cellLogicalWidth;
+ break;
+ case Relative:
+ // FIXME: Need to understand this case and whether it makes sense to compare values
+ // which are not necessarily of the same type.
+ if (cellLogicalWidth.value() > columnLayout.logicalWidth.value())
+ columnLayout.logicalWidth = cellLogicalWidth;
+ default:
+ break;
}
- break;
- case Percent:
- m_hasPercent = true;
- if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercent() || cellLogicalWidth.value() > columnLayout.logicalWidth.value()))
- columnLayout.logicalWidth = cellLogicalWidth;
- break;
- case Relative:
- // FIXME: Need to understand this case and whether it makes sense to compare values
- // which are not necessarily of the same type.
- if (cellLogicalWidth.value() > columnLayout.logicalWidth.value())
- columnLayout.logicalWidth = cellLogicalWidth;
- default:
- break;
+ } else if (!effCol || section->primaryCellAt(i, effCol - 1) != cell) {
+ // This spanning cell originates in this column. Insert the cell into spanning cells list.
+ insertSpanCell(cell);
}
- } else if (!effCol || section->primaryCellAt(i, effCol - 1) != cell) {
- // This spanning cell originates in this column. Insert the cell into spanning cells list.
- insertSpanCell(cell);
}
}
}
Modified: trunk/Source/WebCore/rendering/FixedTableLayout.cpp (132640 => 132641)
--- trunk/Source/WebCore/rendering/FixedTableLayout.cpp 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/Source/WebCore/rendering/FixedTableLayout.cpp 2012-10-26 13:13:00 UTC (rev 132641)
@@ -88,6 +88,8 @@
unsigned currentEffectiveColumn = 0;
for (RenderTableCol* col = m_table->firstColumn(); col; col = col->nextColumn()) {
+ col->computePreferredLogicalWidths();
+
// Width specified by column-groups that have column child does not affect column width in fixed layout tables
if (col->isTableColumnGroupWithColumnChildren())
continue;
Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (132640 => 132641)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2012-10-26 13:13:00 UTC (rev 132641)
@@ -378,15 +378,20 @@
bool collapsing = collapseBorders();
- // We ignore table col / colgroup in this iteration as they are only used to size the cell's widths during auto / fixed table layout.
- for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) {
- if (m_columnLogicalWidthChanged)
- section->setChildNeedsLayout(true, MarkOnlyThis);
- section->layoutIfNeeded();
- totalSectionLogicalHeight += section->calcRowLogicalHeight();
- if (collapsing)
- section->recalcOuterBorder();
- ASSERT(!section->needsLayout());
+ for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+ if (child->isTableSection()) {
+ RenderTableSection* section = toRenderTableSection(child);
+ if (m_columnLogicalWidthChanged)
+ section->setChildNeedsLayout(true, MarkOnlyThis);
+ section->layoutIfNeeded();
+ totalSectionLogicalHeight += section->calcRowLogicalHeight();
+ if (collapsing)
+ section->recalcOuterBorder();
+ ASSERT(!section->needsLayout());
+ } else if (child->isRenderTableCol()) {
+ child->layoutIfNeeded();
+ ASSERT(!child->needsLayout());
+ }
}
// If any table section moved vertically, we will just repaint everything from that
Modified: trunk/Source/WebCore/rendering/RenderTableCol.cpp (132640 => 132641)
--- trunk/Source/WebCore/rendering/RenderTableCol.cpp 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/Source/WebCore/rendering/RenderTableCol.cpp 2012-10-26 13:13:00 UTC (rev 132641)
@@ -49,9 +49,6 @@
{
RenderBox::styleDidChange(diff, oldStyle);
- if (diff == StyleDifferenceLayout)
- propagateLayoutCueToTable();
-
// If border was changed, notify table.
if (parent()) {
RenderTable* table = this->table();
@@ -69,9 +66,8 @@
m_span = tc->span();
} else
m_span = !(style() && style()->display() == TABLE_COLUMN_GROUP);
-
- if (m_span != oldSpan && style())
- propagateLayoutCueToTable();
+ if (m_span != oldSpan && style() && parent())
+ setNeedsLayoutAndPrefWidthsRecalc();
}
void RenderTableCol::willBeRemovedFromTree()
@@ -118,28 +114,12 @@
void RenderTableCol::computePreferredLogicalWidths()
{
- // <col> and <colgroup> don't have preferred logical widths as they have
- // no content so computing our preferred logical widths is wasteful.
- ASSERT_NOT_REACHED();
-}
+ setPreferredLogicalWidthsDirty(false);
-void RenderTableCol::layout()
-{
- // There is no need to layout table <col> or <colgroup> as they have no content.
- // We cannot ASSERT_NOT_REACHED here as simplified normal flow layout forces
- // layout on any renderer.
+ for (RenderObject* child = firstChild(); child; child = child->nextSibling())
+ child->setPreferredLogicalWidthsDirty(false);
}
-void RenderTableCol::propagateLayoutCueToTable() const
-{
- // Forward any layout hint to the table: this is required as the table is
- // the one to layout / compute preferred logical widths on all the cells.
- if (RenderTable* table = this->table()) {
- table->setChildNeedsLayout(true);
- table->setPreferredLogicalWidthsDirty(true);
- }
-}
-
RenderTable* RenderTableCol::table() const
{
RenderObject* table = parent();
Modified: trunk/Source/WebCore/rendering/RenderTableCol.h (132640 => 132641)
--- trunk/Source/WebCore/rendering/RenderTableCol.h 2012-10-26 12:55:57 UTC (rev 132640)
+++ trunk/Source/WebCore/rendering/RenderTableCol.h 2012-10-26 13:13:00 UTC (rev 132641)
@@ -40,6 +40,8 @@
const RenderObjectChildList* children() const { return &m_children; }
RenderObjectChildList* children() { return &m_children; }
+ virtual void computePreferredLogicalWidths();
+
unsigned span() const { return m_span; }
void setSpan(unsigned span) { m_span = span; }
@@ -75,9 +77,6 @@
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
- virtual void computePreferredLogicalWidths() OVERRIDE;
- virtual void layout() OVERRIDE;
-
virtual const char* renderName() const { return "RenderTableCol"; }
virtual bool isRenderTableCol() const OVERRIDE { return true; }
virtual void updateFromElement();
@@ -93,8 +92,6 @@
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
- void propagateLayoutCueToTable() const;
-
RenderTable* table() const;
RenderObjectChildList m_children;