Incorrect positioning of floating pseudo-elements in table captions
authorrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 19:52:10 +0000 (19:52 +0000)
committerrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 19:52:10 +0000 (19:52 +0000)
commit1ee13b0429ac202a63e92bf81d1333be1bcc089e
treefb9c84c6b459dec7a8d3cc36ae39f7c9788b3bc4
parente93e69f154cebda33d7d7c7acdb355c28914949f
Incorrect positioning of floating pseudo-elements in table captions
https://bugs.webkit.org/show_bug.cgi?id=76664

Reviewed by Julien Chaffraix.

Source/WebCore:

Tests: fast/table/caption-encloses-overhanging-float-expected.html
       fast/table/caption-encloses-overhanging-float.html

Allow table captions to expand and enclose overhanging floats. When performing
layout on a caption ensure that its logical top is set so that it does not mistakenly
conclude that floats in a previous sibling are intruding into it when they're not.

Mostly diagnosed by Abhishek Arya.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::expandsToEncloseOverhangingFloats): add table captions to the list
 that can enclosed overhanging floats.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layoutCaption): use the best available approximation of the caption's logical
 top offset before laying it out.
(WebCore::RenderTable::layout):
* rendering/RenderTable.h:

LayoutTests:

* fast/table/caption-encloses-overhanging-float-expected.html: Added.
* fast/table/caption-encloses-overhanging-float.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/table/caption-encloses-overhanging-float-expected.html [new file with mode: 0644]
LayoutTests/fast/table/caption-encloses-overhanging-float.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h