-
robert@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=71705 Reviewed by Julien Chaffraix. Source/WebCore: Tests: css2.1/20110323/border-collapse-offset-002-expected.html fast/css/caption-width-absolute-position-offset-top.htm fast/css/caption-width-absolute-position.htm fast/css/caption-width-fixed-position-offset-top.htm fast/css/caption-width-fixed-position.htm fast/css/caption-width-relative-position-offset-top.htm fast/css/caption-width-relative-position.htm Table captions are implemented as children of the table but have a special requirement to expand to the full width of the table rather than just the 'available' width, i.e. the full width minus padding and borders. To accomodate this create a RenderTableCaption object that reimplements containingBlockLogicalWidthForContent() to return the full width of the containing block (i.e. the table) rather than the available width. * CMakeLists.txt: Add RenderTableCaption.[cpp|h] * GNUmakefile.list.am: Add RenderTableCaption.[cpp|h] * Target.pri: Add RenderTableCaption.[cpp|h] * WebCore.gypi: Add RenderTableCaption.[cpp|h] * WebCore.vcproj/WebCore.vcproj: Add RenderTableCaption.[cpp|h] * WebCore.xcodeproj/project.pbxproj: Add RenderTableCaption.[cpp|h] * rendering/RenderBlock.cpp: (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks): Use RenderTableCaption * rendering/RenderObject.cpp: (WebCore::RenderObject::createObject): Add RenderTableCaption.[cpp|h] (WebCore::RenderObject::addChild): ditto * rendering/RenderObject.h: (WebCore::RenderObject::isTableCaption): * rendering/RenderTable.cpp: (WebCore::RenderTable::addChild): * rendering/RenderTable.h: * rendering/RenderTableCaption.cpp: Added. (WebCore::RenderTableCaption::RenderTableCaption): Implement RenderTableCaption (WebCore::RenderTableCaption::~RenderTableCaption): (WebCore::RenderTableCaption::containingBlockLogicalWidthForContent): Return the containing block's full width rather than it's available width. * rendering/RenderTableCaption.h: Added. (WebCore::RenderTableCaption::isTableCaption): (WebCore::toRenderTableCaption): * rendering/RenderingAllInOne.cpp: LayoutTests: Table captions now use the width of the table rather than the width of the table minus the borders. This allows captions to center accurately but unfortunately a lot of mozilla table tests need to be rebaselined as many of them use captions for explaining the purpose of individual test files! Add border-collapse-offset-002.htm which now renders correctly. * css2.1/20110323/border-collapse-offset-002-expected.html: Added. * css2.1/20110323/border-collapse-offset-002.htm: Added. * fast/css/caption-width-absolute-position-expected.png: Added. * fast/css/caption-width-absolute-position-expected.txt: Added. * fast/css/caption-width-absolute-position-offset-top-expected.png: Added. * fast/css/caption-width-absolute-position-offset-top-expected.txt: Added. * fast/css/caption-width-absolute-position-offset-top.htm: Added. * fast/css/caption-width-absolute-position.htm: Added. * fast/css/caption-width-fixed-position-expected.png: Added. * fast/css/caption-width-fixed-position-expected.txt: Added. * fast/css/caption-width-fixed-position-offset-top-expected.png: Added. * fast/css/caption-width-fixed-position-offset-top-expected.txt: Added. * fast/css/caption-width-fixed-position-offset-top.htm: Added. * fast/css/caption-width-fixed-position.htm: Added. * fast/css/caption-width-relative-position-expected.png: Added. * fast/css/caption-width-relative-position-expected.txt: Added. * fast/css/caption-width-relative-position-offset-top-expected.png: Added. * fast/css/caption-width-relative-position-offset-top-expected.txt: Added. * fast/css/caption-width-relative-position-offset-top.htm: Added. * fast/css/caption-width-relative-position.htm: Added. * platform/chromium/test_expectations.txt: Suppress affected table tests until rebaselined. * platform/gtk/test_expectations.txt: ditto * platform/mac/test_expectations.txt: ditto * platform/qt/test_expectations.txt: ditto * platform/win/test_expectations.txt: ditto git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
5b7bc0af