<rdar://problem/10262205> Allow column progression to be independent of writing mode
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Oct 2011 17:59:32 +0000 (17:59 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Oct 2011 17:59:32 +0000 (17:59 +0000)
commit4f3bbd4d589039993028448dfbdb490fcf1b2a4b
tree9ab8b674722dca3c365ec7f01369a939bd81b9ae
parent03d179dec6adc31e54fe98a147eb420df6ace535
<rdar://problem/10262205> Allow column progression to be independent of writing mode
https://bugs.webkit.org/show_bug.cgi?id=71028

Reviewed by Darin Adler.

Source/WebCore:

Tests: fast/multicol/block-axis-horizontal-bt.html
       fast/multicol/block-axis-horizontal-tb.html
       fast/multicol/block-axis-vertical-lr.html
       fast/multicol/block-axis-vertical-rl.html
       fast/multicol/flipped-blocks-hit-test.html

Allow “columns” to be stacked along the block axis rather than the inline axis. This can facilitate
paginated interfaces. A column-axis property is added in order to enable this mode.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Handle the column-axis property.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Ditto.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map ColumnAxis values to identifiers.
(WebCore::CSSPrimitiveValue::operator ColumnAxis): Map identifiers to ColumnAxis values.
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty): Updated to return false for the column-axis property.
* css/CSSPropertyNames.in: Added -webkit-column-axis.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty): Handle column-axis.
* rendering/ColumnInfo.h:
(WebCore::ColumnInfo::ColumnInfo): Added m_progressionAxis to the initialization list.
(WebCore::ColumnInfo::progressionAxis): Added this getter.
(WebCore::ColumnInfo::setProgressionAxis): Added this setter.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addOverflowFromChildren): Simplified, and thus also made this function work
with block-axis column progression.
(WebCore::RenderBlock::paintColumnRules): Added code to paint rules between columns with block-axis
progression.
(WebCore::RenderBlock::paintColumnContents): Adjusted the painting offset for the block-axis
column progression case.
(WebCore::RenderBlock::nodeAtPoint): Fixed hit-testing in flipped-blocks writing modes. This is
covered by flipped-blocks-hit-test.html.
(WebCore::RenderBlock::hitTestColumns): Adjusted the offset for the block-axis column progression
case.
(WebCore::RenderBlock::calcColumnWidth): Set the column width to the content logical width in
the block-axis column progression case. The column-width and column-count properties are ignored.
(WebCore::RenderBlock::setDesiredColumnCountAndWidth): Set the column progression axis based on
the style.
(WebCore::RenderBlock::columnCount): Broke up an assertion into two.
(WebCore::RenderBlock::columnRectAt): Updated for block-axis column progression.
(WebCore::RenderBlock::adjustPointToColumnContents): Ditto.
(WebCore::RenderBlock::adjustRectForColumns): Ditto.
(WebCore::RenderBlock::adjustForColumns): Ditto.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintChildLayerIntoColumns): Adjusted the offser for the block-axis column
progression case.
(WebCore::RenderLayer::hitTestChildLayerColumns): Ditto.
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::columnAxis): Added this getter.
(WebCore::InheritedFlags::hasInlineColumnAxis): Added. Checks the column axis against the writing
mode.
(WebCore::InheritedFlags::specifiesColumns): Changed to return true if the specified column axis
is the block axis.
(WebCore::InheritedFlags::setColumnAxis): Added this setter.
(WebCore::InheritedFlags::initialColumnAxis): Added. Returns AutoColumnAxis.
* rendering/style/RenderStyleConstants.h: Added a ColumnAxis enum.
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData): Added m_axis to the initialization list.
(WebCore::StyleMultiColData::operator==): Compare m_axis.
* rendering/style/StyleMultiColData.h: Added m_axis member variable.

LayoutTests:

* fast/multicol/block-axis-horizontal-bt.html: Added.
* fast/multicol/block-axis-horizontal-tb.html: Added.
* fast/multicol/block-axis-vertical-lr.html: Added.
* fast/multicol/block-axis-vertical-rl.html: Added.
* fast/multicol/flipped-blocks-hit-test-expected.txt: Added.
* fast/multicol/flipped-blocks-hit-test.html: Added.
* fast/multicol/resources/block-axis.css: Added.
* platform/mac/fast/multicol/block-axis-horizontal-bt-expected.png: Added.
* platform/mac/fast/multicol/block-axis-horizontal-bt-expected.txt: Added.
* platform/mac/fast/multicol/block-axis-horizontal-tb-expected.png: Added.
* platform/mac/fast/multicol/block-axis-horizontal-tb-expected.txt: Added.
* platform/mac/fast/multicol/block-axis-vertical-lr-expected.png: Added.
* platform/mac/fast/multicol/block-axis-vertical-lr-expected.txt: Added.
* platform/mac/fast/multicol/block-axis-vertical-rl-expected.png: Added.
* platform/mac/fast/multicol/block-axis-vertical-rl-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/multicol/block-axis-horizontal-bt.html [new file with mode: 0644]
LayoutTests/fast/multicol/block-axis-horizontal-tb.html [new file with mode: 0644]
LayoutTests/fast/multicol/block-axis-vertical-lr.html [new file with mode: 0644]
LayoutTests/fast/multicol/block-axis-vertical-rl.html [new file with mode: 0644]
LayoutTests/fast/multicol/flipped-blocks-hit-test-expected.txt [new file with mode: 0644]
LayoutTests/fast/multicol/flipped-blocks-hit-test.html [new file with mode: 0644]
LayoutTests/fast/multicol/resources/block-axis.css [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-horizontal-bt-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-horizontal-bt-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-horizontal-tb-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-horizontal-tb-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-vertical-lr-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-vertical-lr-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-vertical-rl-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/multicol/block-axis-vertical-rl-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/rendering/ColumnInfo.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleMultiColData.cpp
Source/WebCore/rendering/style/StyleMultiColData.h