Commit 4c91cc94 authored by robert@webkit.org's avatar robert@webkit.org

Growing a position:absolute element in a position:relative one in a table does...

Growing a position:absolute element in a position:relative one in a table does not update scrollHeight
https://bugs.webkit.org/show_bug.cgi?id=111977

Reviewed by David Hyatt.

Source/WebCore:

During simplified layout tables still need to know about overflow from positioned objects in any of
their cells.

Test: fast/table/cell-overflow-simplified-layout.html

* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::simplifiedNormalFlowLayout):
(WebCore):
* rendering/RenderTable.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
(WebCore):
(WebCore::RenderTableSection::computeOverflowFromCells):
* rendering/RenderTableSection.h:
(RenderTableSection):

LayoutTests:

* fast/table/cell-overflow-simplified-layout-expected.html: Added.
* fast/table/cell-overflow-simplified-layout.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 20c53674
2013-03-27 Robert Hogan <robert@webkit.org>
Growing a position:absolute element in a position:relative one in a table does not update scrollHeight
https://bugs.webkit.org/show_bug.cgi?id=111977
Reviewed by David Hyatt.
* fast/table/cell-overflow-simplified-layout-expected.html: Added.
* fast/table/cell-overflow-simplified-layout.html: Added.
2013-03-22 Geoffrey Garen <ggaren@apple.com>
Honor the setting for whether JavaScript markup is enabled
<!DOCTYPE html>
<html>
<head>
<style>
.rel {
position: relative;
width: 150px;
}
.pos {
background-color: cyan;
position: absolute;
width: 100%;
top: 0;
left: 0;
height: 800px;
}
</style>
</head>
<body>
<p>
Bug webkit.org/b/111977 : We should compute overflow from cells during simplified layout. The page should have a vertical scrollbar.
</p>
<table>
<tr>
<td>
<div class="rel">
<div class="pos"></div>
</div>
</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
.rel {
position: relative;
width: 150px;
}
.pos {
background-color: cyan;
position: absolute;
width: 100%;
top: 0;
left: 0;
}
</style>
</head>
<body>
<p>
Bug webkit.org/b/111977 : We should compute overflow from cells during simplified layout. The page should have a vertical scrollbar.
</p>
<table>
<tr>
<td>
<div class="rel">
<div class="pos"></div>
</div>
</td>
</tr>
</table>
<script>
var e = document.querySelector('.pos');
document.body.offsetHeight;
e.style.height = '800px';
</script>
</body>
</html>
2013-03-27 Robert Hogan <robert@webkit.org>
Growing a position:absolute element in a position:relative one in a table does not update scrollHeight
https://bugs.webkit.org/show_bug.cgi?id=111977
Reviewed by David Hyatt.
During simplified layout tables still need to know about overflow from positioned objects in any of
their cells.
Test: fast/table/cell-overflow-simplified-layout.html
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::simplifiedNormalFlowLayout):
(WebCore):
* rendering/RenderTable.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
(WebCore):
(WebCore::RenderTableSection::computeOverflowFromCells):
* rendering/RenderTableSection.h:
(RenderTableSection):
2013-03-22 Geoffrey Garen <ggaren@apple.com>
Honor the setting for whether JavaScript markup is enabled
......@@ -546,7 +546,7 @@ protected:
virtual bool hasLineIfEmpty() const;
bool simplifiedLayout();
void simplifiedNormalFlowLayout();
virtual void simplifiedNormalFlowLayout();
void setDesiredColumnCountAndWidth(int, LayoutUnit);
......
......@@ -381,6 +381,14 @@ void RenderTable::distributeExtraLogicalHeight(int extraLogicalHeight)
// ASSERT(!topSection() || !extraLogicalHeight);
}
void RenderTable::simplifiedNormalFlowLayout()
{
for (RenderTableSection* section = topSection(); section; section = sectionBelow(section)) {
section->layoutIfNeeded();
section->computeOverflowFromCells();
}
}
void RenderTable::layout()
{
StackStats::LayoutCheckPoint layoutCheckPoint;
......
......@@ -264,6 +264,7 @@ public:
protected:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
virtual void simplifiedNormalFlowLayout();
private:
virtual const char* renderName() const { return "RenderTable"; }
......
......@@ -636,6 +636,20 @@ void RenderTableSection::layoutRows()
setLogicalHeight(m_rowPos[totalRows]);
computeOverflowFromCells(totalRows, nEffCols);
statePusher.pop();
}
void RenderTableSection::computeOverflowFromCells()
{
unsigned totalRows = m_grid.size();
unsigned nEffCols = table()->numEffCols();
computeOverflowFromCells(totalRows, nEffCols);
}
void RenderTableSection::computeOverflowFromCells(unsigned totalRows, unsigned nEffCols)
{
unsigned totalCellsCount = nEffCols * totalRows;
int maxAllowedOverflowingCellsCount = totalCellsCount < gMinTableSizeToUseFastPaintPathWithOverflowingCell ? 0 : gMaxAllowedOverflowingCellRatioForFastPaintPath * totalCellsCount;
......@@ -668,8 +682,6 @@ void RenderTableSection::layoutRows()
}
ASSERT(hasOverflowingCell == this->hasOverflowingCell());
statePusher.pop();
}
int RenderTableSection::calcOuterBorderBefore() const
......
......@@ -79,6 +79,7 @@ public:
int calcRowLogicalHeight();
void layoutRows();
void computeOverflowFromCells();
RenderTable* table() const { return toRenderTable(parent()); }
......@@ -232,6 +233,7 @@ private:
void distributeRemainingExtraLogicalHeight(int& extraLogicalHeight);
bool hasOverflowingCell() const { return m_overflowingCells.size() || m_forceSlowPaintPathWithOverflowingCell; }
void computeOverflowFromCells(unsigned totalRows, unsigned nEffCols);
CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); }
CellSpan fullTableColumnSpan() const { return CellSpan(0, table()->columns().size()); }
......
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