Changeset 76726 in webkit


Ignore:
Timestamp:
Jan 26, 2011 3:10:57 PM (13 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=46421, make multi-column layout work with vertical text.

Reviewed by Dan Bernstein.

Added new tests in fast/multicol/vertical-lr and fast/multicol/vertical-rl.

Source/WebCore:

  • css/html.css:

Update p, blockquote and h1-h6 to respect directionality so that column layout tests that use those
elements work properly.

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
Fix a flipping bug with the computation of lineTopIncludingMargins where it could be incorrectly shrunk
in some cases (causing lines to all stack on top of one another).

  • rendering/InlineTextBox.h:

(WebCore::InlineTextBox::calculateBoundaries):
Fix calculateBoundaries to be physical rather than logical.

  • rendering/LayoutState.cpp:

(WebCore::LayoutState::addForcedColumnBreak):

  • rendering/LayoutState.h:

Rename childY to childLogicalOffset.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::addOverflowFromChildren):
(WebCore::RenderBlock::addOverflowFromFloats):
(WebCore::RenderBlock::collapseMargins):
(WebCore::RenderBlock::estimateLogicalTopPosition):
(WebCore::RenderBlock::layoutBlockChild):
(WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
(WebCore::RenderBlock::paintColumnRules):
(WebCore::RenderBlock::paintColumnContents):
(WebCore::RenderBlock::paintFloats):
(WebCore::RenderBlock::selectionGaps):
(WebCore::RenderBlock::removeFloatingObjectsBelow):
(WebCore::RenderBlock::addOverhangingFloats):
(WebCore::RenderBlock::hitTestFloats):
(WebCore::RenderBlock::hitTestColumns):
(WebCore::RenderBlock::calcColumnWidth):
(WebCore::RenderBlock::desiredColumnWidth):
(WebCore::RenderBlock::columnRectAt):
(WebCore::RenderBlock::layoutColumns):
(WebCore::RenderBlock::adjustPointToColumnContents):
(WebCore::RenderBlock::adjustRectForColumns):
(WebCore::RenderBlock::flipForWritingModeIncludingColumns):
(WebCore::RenderBlock::adjustForColumns):
(WebCore::RenderBlock::adjustForBorderFit):
(WebCore::RenderBlock::nextPageLogicalTop):
(WebCore::RenderBlock::applyBeforeBreak):
(WebCore::RenderBlock::applyAfterBreak):
(WebCore::RenderBlock::adjustForUnsplittableChild):
(WebCore::RenderBlock::adjustLinePositionForPagination):

  • rendering/RenderBlock.h:

(WebCore::RenderBlock::logicalRightOffsetForContent):
(WebCore::RenderBlock::logicalLeftOffsetForContent):
(WebCore::RenderBlock::leftForFloatIncludingMargin):
(WebCore::RenderBlock::topForFloatIncludingMargin):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::layoutInlineChildren):
(WebCore::RenderBlock::determineStartPosition):
Reworking of all the RenderBlock column functions to support flipping and vertical modes.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::offsetFromContainer):
(WebCore::RenderBox::flipForWritingModeIncludingColumns):
Patch offsetFromContainer to be aware of flipped block writing modes when dealing with column layouts.

  • rendering/RenderBox.h:

(WebCore::RenderBox::clientLogicalBottom):
Fix a bug in clientLogicalBottom where it didn't add in the right border/padding.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock):
Better terminology for pagination.

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::offsetFromContainer):
(WebCore::RenderInline::mapLocalToContainer):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paintChildLayerIntoColumns):
(WebCore::RenderLayer::hitTestChildLayerColumns):
(WebCore::RenderLayer::localBoundingBox):
(WebCore::RenderLayer::boundingBox):
Patch painting in RenderLayers to be vertical-text-aware.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::mapLocalToContainer):
Add code to be flipped block-aware with columns.

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::layout):

  • rendering/RenderTableRow.cpp:

(WebCore::RenderTableRow::layout):

  • rendering/RenderTableSection.cpp:

(WebCore::RenderTableSection::layoutRows):
Fix pagination to use better terminology.

  • rendering/RenderText.cpp:

(WebCore::RenderText::absoluteQuads):
(WebCore::RenderText::absoluteQuadsForRange):
Fix a bug where vertical text wasn't taken into account.

LayoutTests:

  • fast/multicol/break-properties-expected.txt:
  • fast/multicol/break-properties.html:
  • fast/multicol/float-truncation.html:
  • fast/multicol/vertical-lr: Added.
  • fast/multicol/vertical-lr/border-padding-pagination.html: Added.
  • fast/multicol/vertical-lr/break-properties-expected.txt: Added.
  • fast/multicol/vertical-lr/break-properties.html: Added.
  • fast/multicol/vertical-lr/column-break-with-balancing.html: Added.
  • fast/multicol/vertical-lr/column-count-with-rules.html: Added.
  • fast/multicol/vertical-lr/column-rules.html: Added.
  • fast/multicol/vertical-lr/float-avoidance.html: Added.
  • fast/multicol/vertical-lr/float-multicol.html: Added.
  • fast/multicol/vertical-lr/float-paginate-complex.html: Added.
  • fast/multicol/vertical-lr/float-paginate.html: Added.
  • fast/multicol/vertical-lr/float-truncation-expected.txt: Added.
  • fast/multicol/vertical-lr/float-truncation.html: Added.
  • fast/multicol/vertical-lr/gap-non-negative-expected.txt: Added.
  • fast/multicol/vertical-lr/gap-non-negative.html: Added.
  • fast/multicol/vertical-lr/image-inside-nested-blocks-with-border-expected.txt: Added.
  • fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html: Added.
  • fast/multicol/vertical-lr/nested-columns.html: Added.
  • fast/multicol/vertical-lr/resources: Added.
  • fast/multicol/vertical-lr/resources/blimp.png: Added.
  • fast/multicol/vertical-lr/unsplittable-inline-block.html: Added.
  • fast/multicol/vertical-rl: Added.
  • fast/multicol/vertical-rl/border-padding-pagination.html: Added.
  • fast/multicol/vertical-rl/break-properties-expected.txt: Added.
  • fast/multicol/vertical-rl/break-properties.html: Added.
  • fast/multicol/vertical-rl/column-break-with-balancing.html: Added.
  • fast/multicol/vertical-rl/column-count-with-rules.html: Added.
  • fast/multicol/vertical-rl/column-rules.html: Added.
  • fast/multicol/vertical-rl/float-avoidance.html: Added.
  • fast/multicol/vertical-rl/float-multicol.html: Added.
  • fast/multicol/vertical-rl/float-paginate-complex.html: Added.
  • fast/multicol/vertical-rl/float-paginate.html: Added.
  • fast/multicol/vertical-rl/float-truncation-expected.txt: Added.
  • fast/multicol/vertical-rl/float-truncation.html: Added.
  • fast/multicol/vertical-rl/gap-non-negative-expected.txt: Added.
  • fast/multicol/vertical-rl/gap-non-negative.html: Added.
  • fast/multicol/vertical-rl/image-inside-nested-blocks-with-border-expected.txt: Added.
  • fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html: Added.
  • fast/multicol/vertical-rl/nested-columns.html: Added.
  • fast/multicol/vertical-rl/resources: Added.
  • fast/multicol/vertical-rl/resources/blimp.png: Added.
  • fast/multicol/vertical-rl/unsplittable-inline-block.html: Added.
  • platform/mac/fast/multicol/vertical-lr: Added.
  • platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/column-rules-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/column-rules-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/column-rules-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/float-multicol-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/float-multicol-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/float-paginate-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/float-paginate-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/float-paginate-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/nested-columns-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/nested-columns-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/nested-columns-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.png: Added.
  • platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl: Added.
  • platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/column-rules-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/column-rules-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/column-rules-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/float-multicol-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/float-multicol-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/float-paginate-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/float-paginate-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/float-paginate-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/nested-columns-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/nested-columns-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/nested-columns-expected.txt: Added.
  • platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.checksum: Added.
  • platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.png: Added.
  • platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.txt: Added.
Location:
trunk
Files:
104 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76723 r76726  
     12011-01-26  Dave Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=46421, make multi-column layout work with vertical text.
     6
     7        Added new tests in fast/multicol/vertical-lr and fast/multicol/vertical-rl.
     8
     9        * fast/multicol/break-properties-expected.txt:
     10        * fast/multicol/break-properties.html:
     11        * fast/multicol/float-truncation.html:
     12        * fast/multicol/vertical-lr: Added.
     13        * fast/multicol/vertical-lr/border-padding-pagination.html: Added.
     14        * fast/multicol/vertical-lr/break-properties-expected.txt: Added.
     15        * fast/multicol/vertical-lr/break-properties.html: Added.
     16        * fast/multicol/vertical-lr/column-break-with-balancing.html: Added.
     17        * fast/multicol/vertical-lr/column-count-with-rules.html: Added.
     18        * fast/multicol/vertical-lr/column-rules.html: Added.
     19        * fast/multicol/vertical-lr/float-avoidance.html: Added.
     20        * fast/multicol/vertical-lr/float-multicol.html: Added.
     21        * fast/multicol/vertical-lr/float-paginate-complex.html: Added.
     22        * fast/multicol/vertical-lr/float-paginate.html: Added.
     23        * fast/multicol/vertical-lr/float-truncation-expected.txt: Added.
     24        * fast/multicol/vertical-lr/float-truncation.html: Added.
     25        * fast/multicol/vertical-lr/gap-non-negative-expected.txt: Added.
     26        * fast/multicol/vertical-lr/gap-non-negative.html: Added.
     27        * fast/multicol/vertical-lr/image-inside-nested-blocks-with-border-expected.txt: Added.
     28        * fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html: Added.
     29        * fast/multicol/vertical-lr/nested-columns.html: Added.
     30        * fast/multicol/vertical-lr/resources: Added.
     31        * fast/multicol/vertical-lr/resources/blimp.png: Added.
     32        * fast/multicol/vertical-lr/unsplittable-inline-block.html: Added.
     33        * fast/multicol/vertical-rl: Added.
     34        * fast/multicol/vertical-rl/border-padding-pagination.html: Added.
     35        * fast/multicol/vertical-rl/break-properties-expected.txt: Added.
     36        * fast/multicol/vertical-rl/break-properties.html: Added.
     37        * fast/multicol/vertical-rl/column-break-with-balancing.html: Added.
     38        * fast/multicol/vertical-rl/column-count-with-rules.html: Added.
     39        * fast/multicol/vertical-rl/column-rules.html: Added.
     40        * fast/multicol/vertical-rl/float-avoidance.html: Added.
     41        * fast/multicol/vertical-rl/float-multicol.html: Added.
     42        * fast/multicol/vertical-rl/float-paginate-complex.html: Added.
     43        * fast/multicol/vertical-rl/float-paginate.html: Added.
     44        * fast/multicol/vertical-rl/float-truncation-expected.txt: Added.
     45        * fast/multicol/vertical-rl/float-truncation.html: Added.
     46        * fast/multicol/vertical-rl/gap-non-negative-expected.txt: Added.
     47        * fast/multicol/vertical-rl/gap-non-negative.html: Added.
     48        * fast/multicol/vertical-rl/image-inside-nested-blocks-with-border-expected.txt: Added.
     49        * fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html: Added.
     50        * fast/multicol/vertical-rl/nested-columns.html: Added.
     51        * fast/multicol/vertical-rl/resources: Added.
     52        * fast/multicol/vertical-rl/resources/blimp.png: Added.
     53        * fast/multicol/vertical-rl/unsplittable-inline-block.html: Added.
     54        * platform/mac/fast/multicol/vertical-lr: Added.
     55        * platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.checksum: Added.
     56        * platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.png: Added.
     57        * platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.txt: Added.
     58        * platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.checksum: Added.
     59        * platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.png: Added.
     60        * platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.txt: Added.
     61        * platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.checksum: Added.
     62        * platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.png: Added.
     63        * platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.txt: Added.
     64        * platform/mac/fast/multicol/vertical-lr/column-rules-expected.checksum: Added.
     65        * platform/mac/fast/multicol/vertical-lr/column-rules-expected.png: Added.
     66        * platform/mac/fast/multicol/vertical-lr/column-rules-expected.txt: Added.
     67        * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.checksum: Added.
     68        * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png: Added.
     69        * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.txt: Added.
     70        * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.checksum: Added.
     71        * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.png: Added.
     72        * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt: Added.
     73        * platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.checksum: Added.
     74        * platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.png: Added.
     75        * platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.txt: Added.
     76        * platform/mac/fast/multicol/vertical-lr/float-paginate-expected.checksum: Added.
     77        * platform/mac/fast/multicol/vertical-lr/float-paginate-expected.png: Added.
     78        * platform/mac/fast/multicol/vertical-lr/float-paginate-expected.txt: Added.
     79        * platform/mac/fast/multicol/vertical-lr/nested-columns-expected.checksum: Added.
     80        * platform/mac/fast/multicol/vertical-lr/nested-columns-expected.png: Added.
     81        * platform/mac/fast/multicol/vertical-lr/nested-columns-expected.txt: Added.
     82        * platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.checksum: Added.
     83        * platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.png: Added.
     84        * platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.txt: Added.
     85        * platform/mac/fast/multicol/vertical-rl: Added.
     86        * platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.checksum: Added.
     87        * platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.png: Added.
     88        * platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.txt: Added.
     89        * platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.checksum: Added.
     90        * platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.png: Added.
     91        * platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt: Added.
     92        * platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.checksum: Added.
     93        * platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.png: Added.
     94        * platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.txt: Added.
     95        * platform/mac/fast/multicol/vertical-rl/column-rules-expected.checksum: Added.
     96        * platform/mac/fast/multicol/vertical-rl/column-rules-expected.png: Added.
     97        * platform/mac/fast/multicol/vertical-rl/column-rules-expected.txt: Added.
     98        * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.checksum: Added.
     99        * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png: Added.
     100        * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.txt: Added.
     101        * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.checksum: Added.
     102        * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.png: Added.
     103        * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt: Added.
     104        * platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.checksum: Added.
     105        * platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.png: Added.
     106        * platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.txt: Added.
     107        * platform/mac/fast/multicol/vertical-rl/float-paginate-expected.checksum: Added.
     108        * platform/mac/fast/multicol/vertical-rl/float-paginate-expected.png: Added.
     109        * platform/mac/fast/multicol/vertical-rl/float-paginate-expected.txt: Added.
     110        * platform/mac/fast/multicol/vertical-rl/nested-columns-expected.checksum: Added.
     111        * platform/mac/fast/multicol/vertical-rl/nested-columns-expected.png: Added.
     112        * platform/mac/fast/multicol/vertical-rl/nested-columns-expected.txt: Added.
     113        * platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.checksum: Added.
     114        * platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.png: Added.
     115        * platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.txt: Added.
     116
    11172011-01-26  Tony Chang  <tony@chromium.org>
    2118
  • trunk/LayoutTests/fast/multicol/break-properties-expected.txt

    r62632 r76726  
    11PASS: 'break-before' is at (218, 8)
    22PASS: 'after-break' is at (428, 8)
    3 FAIL: 'no-break' is at (428, 68) instead of (533 ,8)
    43
  • trunk/LayoutTests/fast/multicol/break-properties.html

    r61065 r76726  
    3333    testBoxPosition("break-before", 218, 8);
    3434    testBoxPosition("after-break", 428, 8);
    35     testBoxPosition("no-break", 533, 8);
    3635</script>
  • trunk/LayoutTests/fast/multicol/float-truncation.html

    r67660 r76726  
     1<html>
     2<head>
    13<style>
    24    div.columns {
     
    1820    }
    1921</style>
     22</head>
     23<body>
    2024<div id="tests">
    2125    <div class="columns" style="height: 80px;">
  • trunk/Source/WebCore/ChangeLog

    r76724 r76726  
     12011-01-26  Dave Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=46421, make multi-column layout work with vertical text.
     6
     7        Added new tests in fast/multicol/vertical-lr and fast/multicol/vertical-rl.
     8
     9        * css/html.css:
     10        Update p, blockquote and h1-h6 to respect directionality so that column layout tests that use those
     11        elements work properly.
     12
     13        * rendering/InlineFlowBox.cpp:
     14        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
     15        Fix a flipping bug with the computation of lineTopIncludingMargins where it could be incorrectly shrunk
     16        in some cases (causing lines to all stack on top of one another).
     17
     18        * rendering/InlineTextBox.h:
     19        (WebCore::InlineTextBox::calculateBoundaries):
     20        Fix calculateBoundaries to be physical rather than logical.
     21
     22        * rendering/LayoutState.cpp:
     23        (WebCore::LayoutState::addForcedColumnBreak):
     24        * rendering/LayoutState.h:
     25        Rename childY to childLogicalOffset.
     26
     27        * rendering/RenderBlock.cpp:
     28        (WebCore::RenderBlock::layoutBlock):
     29        (WebCore::RenderBlock::addOverflowFromChildren):
     30        (WebCore::RenderBlock::addOverflowFromFloats):
     31        (WebCore::RenderBlock::collapseMargins):
     32        (WebCore::RenderBlock::estimateLogicalTopPosition):
     33        (WebCore::RenderBlock::layoutBlockChild):
     34        (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
     35        (WebCore::RenderBlock::paintColumnRules):
     36        (WebCore::RenderBlock::paintColumnContents):
     37        (WebCore::RenderBlock::paintFloats):
     38        (WebCore::RenderBlock::selectionGaps):
     39        (WebCore::RenderBlock::removeFloatingObjectsBelow):
     40        (WebCore::RenderBlock::addOverhangingFloats):
     41        (WebCore::RenderBlock::hitTestFloats):
     42        (WebCore::RenderBlock::hitTestColumns):
     43        (WebCore::RenderBlock::calcColumnWidth):
     44        (WebCore::RenderBlock::desiredColumnWidth):
     45        (WebCore::RenderBlock::columnRectAt):
     46        (WebCore::RenderBlock::layoutColumns):
     47        (WebCore::RenderBlock::adjustPointToColumnContents):
     48        (WebCore::RenderBlock::adjustRectForColumns):
     49        (WebCore::RenderBlock::flipForWritingModeIncludingColumns):
     50        (WebCore::RenderBlock::adjustForColumns):
     51        (WebCore::RenderBlock::adjustForBorderFit):
     52        (WebCore::RenderBlock::nextPageLogicalTop):
     53        (WebCore::RenderBlock::applyBeforeBreak):
     54        (WebCore::RenderBlock::applyAfterBreak):
     55        (WebCore::RenderBlock::adjustForUnsplittableChild):
     56        (WebCore::RenderBlock::adjustLinePositionForPagination):
     57        * rendering/RenderBlock.h:
     58        (WebCore::RenderBlock::logicalRightOffsetForContent):
     59        (WebCore::RenderBlock::logicalLeftOffsetForContent):
     60        (WebCore::RenderBlock::leftForFloatIncludingMargin):
     61        (WebCore::RenderBlock::topForFloatIncludingMargin):
     62        * rendering/RenderBlockLineLayout.cpp:
     63        (WebCore::RenderBlock::layoutInlineChildren):
     64        (WebCore::RenderBlock::determineStartPosition):
     65        Reworking of all the RenderBlock column functions to support flipping and vertical modes.
     66
     67        * rendering/RenderBox.cpp:
     68        (WebCore::RenderBox::offsetFromContainer):
     69        (WebCore::RenderBox::flipForWritingModeIncludingColumns):
     70        Patch offsetFromContainer to be aware of flipped block writing modes when dealing with column layouts.
     71
     72        * rendering/RenderBox.h:
     73        (WebCore::RenderBox::clientLogicalBottom):
     74        Fix a bug in clientLogicalBottom where it didn't add in the right border/padding.
     75       
     76        * rendering/RenderFlexibleBox.cpp:
     77        (WebCore::RenderFlexibleBox::layoutBlock):
     78        Better terminology for pagination.
     79
     80        * rendering/RenderInline.cpp:
     81        (WebCore::RenderInline::offsetFromContainer):
     82        (WebCore::RenderInline::mapLocalToContainer):
     83        * rendering/RenderLayer.cpp:
     84        (WebCore::RenderLayer::paintChildLayerIntoColumns):
     85        (WebCore::RenderLayer::hitTestChildLayerColumns):
     86        (WebCore::RenderLayer::localBoundingBox):
     87        (WebCore::RenderLayer::boundingBox):
     88        Patch painting in RenderLayers to be vertical-text-aware.
     89   
     90        * rendering/RenderObject.cpp:
     91        (WebCore::RenderObject::mapLocalToContainer):
     92        Add code to be flipped block-aware with columns.
     93
     94        * rendering/RenderTable.cpp:
     95        (WebCore::RenderTable::layout):
     96        * rendering/RenderTableRow.cpp:
     97        (WebCore::RenderTableRow::layout):
     98        * rendering/RenderTableSection.cpp:
     99        (WebCore::RenderTableSection::layoutRows):
     100        Fix pagination to use better terminology.
     101       
     102        * rendering/RenderText.cpp:
     103        (WebCore::RenderText::absoluteQuads):
     104        (WebCore::RenderText::absoluteQuadsForRange):
     105        Fix a bug where vertical text wasn't taken into account.
     106
    11072011-01-26  Dimitri Glazkov  <dglazkov@chromium.org>
    2108
  • trunk/Source/WebCore/css/html.css

    r75940 r76726  
    6262p {
    6363    display: block;
    64     margin: 1.0__qem 0px
     64    -webkit-margin-before: 1__qem;
     65    -webkit-margin-after: 1__qem;
     66    -webkit-margin-start: 0;
     67    -webkit-margin-end: 0;
    6568}
    6669
     
    8891blockquote {
    8992    display: block;
    90     margin: 1__qem 40px 1em 40px
     93    -webkit-margin-before: 1__qem;
     94    -webkit-margin-after: 1em;
     95    -webkit-margin-start: 40px;
     96    -webkit-margin-end: 40px;
    9197}
    9298
     
    97103figure {
    98104    display: block;
    99     margin: 1em 40px 1em 40px
     105    -webkit-margin-before: 1em;
     106    -webkit-margin-after: 1em;
     107    -webkit-margin-start: 40px;
     108    -webkit-margin-end: 40px;
    100109}
    101110
     
    122131hr {
    123132    display: block;
    124     margin: 0.5em auto;
     133    -webkit-margin-before: 0.5em;
     134    -webkit-margin-after: 0.5em;
     135    -webkit-margin-start: auto;
     136    -webkit-margin-end: auto;
    125137    border-style: inset;
    126138    border-width: 1px
     
    136148    display: block;
    137149    font-size: 2em;
    138     margin: .67__qem 0 .67em 0;
     150    -webkit-margin-before: 0.67__qem;
     151    -webkit-margin-after: 0.67em;
     152    -webkit-margin-start: 0;
     153    -webkit-margin-end: 0;
    139154    font-weight: bold
    140155}
     
    143158    display: block;
    144159    font-size: 1.5em;
    145     margin: .83__qem 0 .83em 0;
     160    -webkit-margin-before: 0.83__qem;
     161    -webkit-margin-after: 0.83em;
     162    -webkit-margin-start: 0;
     163    -webkit-margin-end: 0;
    146164    font-weight: bold
    147165}
     
    150168    display: block;
    151169    font-size: 1.17em;
    152     margin: 1__qem 0 1em 0;
     170    -webkit-margin-before: 1__qem;
     171    -webkit-margin-after: 1em;
     172    -webkit-margin-start: 0;
     173    -webkit-margin-end: 0;
    153174    font-weight: bold
    154175}
     
    156177h4 {
    157178    display: block;
    158     margin: 1.33__qem 0 1.33em 0;
     179    -webkit-margin-before: 1.33__qem;
     180    -webkit-margin-after: 1.33em;
     181    -webkit-margin-start: 0;
     182    -webkit-margin-end: 0;
    159183    font-weight: bold
    160184}
     
    163187    display: block;
    164188    font-size: .83em;
    165     margin: 1.67__qem 0 1.67em 0;
     189    -webkit-margin-before: 1.67__qem;
     190    -webkit-margin-after: 1.67em;
     191    -webkit-margin-start: 0;
     192    -webkit-margin-end: 0;
    166193    font-weight: bold
    167194}
     
    170197    display: block;
    171198    font-size: .67em;
    172     margin: 2.33__qem 0 2.33em 0;
     199    -webkit-margin-before: 2.33__qem;
     200    -webkit-margin-after: 2.33em;
     201    -webkit-margin-start: 0;
     202    -webkit-margin-end: 0;
    173203    font-weight: bold
    174204}
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r76442 r76726  
    605605       
    606606        int newLogicalTop = curr->logicalTop();
    607         int newLogicalTopIncludingMargins;
     607        int newLogicalTopIncludingMargins = newLogicalTop;
    608608        int boxHeight = curr->logicalHeight();
    609609        int boxHeightIncludingMargins = boxHeight;
  • trunk/Source/WebCore/rendering/InlineTextBox.h

    r75257 r76726  
    8282
    8383public:
    84     virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), logicalWidth(), logicalHeight()); }
     84    virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); }
    8585
    8686    virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos);
  • trunk/Source/WebCore/rendering/LayoutState.cpp

    r74121 r76726  
    168168}
    169169
    170 void LayoutState::addForcedColumnBreak(int childY)
     170void LayoutState::addForcedColumnBreak(int childLogicalOffset)
    171171{
    172172    if (!m_columnInfo || m_columnInfo->columnHeight())
    173173        return;
    174     m_columnInfo->addForcedBreak(pageLogicalOffset(childY));
     174    m_columnInfo->addForcedBreak(pageLogicalOffset(childLogicalOffset));
    175175}
    176176
  • trunk/Source/WebCore/rendering/LayoutState.h

    r76248 r76726  
    7272    int pageLogicalOffset(int childLogicalOffset) const;
    7373
    74     void addForcedColumnBreak(int childY);
     74    void addForcedColumnBreak(int childLogicalOffset);
    7575   
    7676    bool pageLogicalHeight() const { return m_pageLogicalHeight; }
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r76442 r76726  
    12601260
    12611261    if (view()->layoutState()->m_pageLogicalHeight)
    1262         setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(y()));
     1262        setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop()));
    12631263
    12641264    updateLayerTransform();
     
    13231323        if (columnCount(colInfo)) {
    13241324            IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1);
    1325             int overflowLeft = !style()->isLeftToRightDirection() ? min(0, lastRect.x()) : 0;
    1326             int overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.x() + lastRect.width()) : 0;
    1327             int overflowHeight = borderTop() + paddingTop() + colInfo->columnHeight();
    1328             addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight));
     1325            if (style()->isHorizontalWritingMode()) {
     1326                int overflowLeft = !style()->isLeftToRightDirection() ? min(0, lastRect.x()) : 0;
     1327                int overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.right()) : 0;
     1328                int overflowHeight = borderBefore() + paddingBefore() + colInfo->columnHeight();
     1329                addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight));
     1330            } else {
     1331                IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1);
     1332                int overflowTop = !style()->isLeftToRightDirection() ? min(0, lastRect.y()) : 0;
     1333                int overflowBottom = style()->isLeftToRightDirection() ? max(height(), lastRect.bottom()) : 0;
     1334                int overflowWidth = borderBefore() + paddingBefore() + colInfo->columnHeight();
     1335                addLayoutOverflow(IntRect(0, overflowTop, overflowWidth, overflowBottom - overflowTop));
     1336            }
    13291337        }
    13301338    }
     
    13761384    for (; (r = it.current()); ++it) {
    13771385        if (r->m_isDescendant)
    1378             addOverflowFromChild(r->m_renderer, IntSize(r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop()));
     1386            addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r)));
    13791387    }
    13801388    return;
     
    16421650    if (paginated && logicalTop > beforeCollapseLogicalTop) {
    16431651        int oldLogicalTop = logicalTop;
    1644         logicalTop = min(logicalTop, nextPageTop(beforeCollapseLogicalTop));
     1652        logicalTop = min(logicalTop, nextPageLogicalTop(beforeCollapseLogicalTop));
    16451653        setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop));
    16461654    }
     
    17121720    // page.
    17131721    if (paginated && logicalTopEstimate > logicalHeight())
    1714         logicalTopEstimate = min(logicalTopEstimate, nextPageTop(logicalHeight()));
     1722        logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTop(logicalHeight()));
    17151723
    17161724    logicalTopEstimate += getClearDelta(child, logicalTopEstimate);
     
    20552063    if (paginated) {
    20562064        // Check for an after page/column break.
    2057         int newHeight = applyAfterBreak(child, height(), marginInfo);
     2065        int newHeight = applyAfterBreak(child, logicalHeight(), marginInfo);
    20582066        if (newHeight != height())
    20592067            setLogicalHeight(newHeight);
     
    21522160        return;
    21532161
    2154     if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(y()) != pageLogicalOffset()))
     2162    if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(logicalTop()) != pageLogicalOffset()))
    21552163        setChildNeedsLayout(true, false);
    21562164}
     
    22292237    ColumnInfo* colInfo = columnInfo();
    22302238    unsigned colCount = columnCount(colInfo);
    2231     int currXOffset = style()->isLeftToRightDirection() ? 0 : contentWidth();
    2232     int ruleAdd = borderLeft() + paddingLeft();
    2233     int ruleX = style()->isLeftToRightDirection() ? 0 : contentWidth();
     2239    int currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();
     2240    int ruleAdd = logicalLeftOffsetForContent();
     2241    int ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth();
    22342242    for (unsigned i = 0; i < colCount; i++) {
    22352243        IntRect colRect = columnRectAt(colInfo, i);
    22362244
     2245        int inlineDirectionSize = style()->isHorizontalWritingMode() ? colRect.width() : colRect.height();
     2246       
    22372247        // Move to the next position.
    22382248        if (style()->isLeftToRightDirection()) {
    2239             ruleX += colRect.width() + colGap / 2;
    2240             currXOffset += colRect.width() + colGap;
     2249            ruleLogicalLeft += inlineDirectionSize + colGap / 2;
     2250            currLogicalLeftOffset += inlineDirectionSize + colGap;
    22412251        } else {
    2242             ruleX -= (colRect.width() + colGap / 2);
    2243             currXOffset -= (colRect.width() + colGap);
     2252            ruleLogicalLeft -= (inlineDirectionSize + colGap / 2);
     2253            currLogicalLeftOffset -= (inlineDirectionSize + colGap);
    22442254        }
    22452255       
    22462256        // Now paint the column rule.
    22472257        if (i < colCount - 1) {
    2248             int ruleStart = tx + ruleX - ruleWidth / 2 + ruleAdd;
    2249             int ruleEnd = ruleStart + ruleWidth;
    2250             int ruleTop = ty + borderTop() + paddingTop();
    2251             int ruleBottom = ruleTop + contentHeight();
    2252             drawLineForBoxSide(paintInfo.context, ruleStart, ruleTop, ruleEnd, ruleBottom,
     2258            int ruleLeft = style()->isHorizontalWritingMode() ? tx + ruleLogicalLeft - ruleWidth / 2 + ruleAdd : tx + borderBefore() + paddingBefore();
     2259            int ruleRight = style()->isHorizontalWritingMode() ? ruleLeft + ruleWidth : ruleLeft + contentWidth();
     2260            int ruleTop = style()->isHorizontalWritingMode() ? ty + borderTop() + paddingTop() : ty + ruleLogicalLeft - ruleWidth / 2 + ruleAdd;
     2261            int ruleBottom = style()->isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth;
     2262            drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom,
    22532263                               style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0);
    22542264        }
    22552265       
    2256         ruleX = currXOffset;
     2266        ruleLogicalLeft = currLogicalLeftOffset;
    22572267    }
    22582268}
     
    22622272    // We need to do multiple passes, breaking up our child painting into strips.
    22632273    GraphicsContext* context = paintInfo.context;
    2264     int colGap = columnGap();
    22652274    ColumnInfo* colInfo = columnInfo();
    22662275    unsigned colCount = columnCount(colInfo);
    22672276    if (!colCount)
    22682277        return;
    2269     int currXOffset = style()->isLeftToRightDirection() ? 0 : contentWidth() - columnRectAt(colInfo, 0).width();
    2270     int currYOffset = 0;
     2278    int currLogicalTopOffset = 0;
    22712279    for (unsigned i = 0; i < colCount; i++) {
    22722280        // For each rect, we clip to the rect, and then we adjust our coords.
    22732281        IntRect colRect = columnRectAt(colInfo, i);
     2282        flipForWritingMode(colRect);
     2283        int logicalLeftOffset = (style()->isHorizontalWritingMode() ? colRect.x() : colRect.y()) - logicalLeftOffsetForContent();
     2284        IntSize offset = style()->isHorizontalWritingMode() ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset);
    22742285        colRect.move(tx, ty);
    22752286        PaintInfo info(paintInfo);
     
    22822293            // like overflow:hidden.
    22832294            context->clip(colRect);
    2284            
     2295
    22852296            // Adjust our x and y when painting.
    2286             int finalX = tx + currXOffset;
    2287             int finalY = ty + currYOffset;
     2297            int finalX = tx + offset.width();
     2298            int finalY = ty + offset.height();
    22882299            if (paintingFloats)
    22892300                paintFloats(info, finalX, finalY, paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip);
     
    22932304            context->restore();
    22942305        }
    2295        
    2296         // Move to the next position.
    2297         if (style()->isLeftToRightDirection())
    2298             currXOffset += colRect.width() + colGap;
     2306
     2307        int blockDelta = (style()->isHorizontalWritingMode() ? colRect.height() : colRect.width());
     2308        if (style()->isFlippedBlocksWritingMode())
     2309            currLogicalTopOffset += blockDelta;
    22992310        else
    2300             currXOffset -= (colRect.width() + colGap);
    2301        
    2302         currYOffset -= colRect.height();
     2311            currLogicalTopOffset -= blockDelta;
    23032312    }
    23042313}
     
    24772486}
    24782487
     2488IntPoint RenderBlock::flipFloatForWritingMode(const FloatingObject* child, const IntPoint& point) const
     2489{
     2490    if (!style()->isFlippedBlocksWritingMode())
     2491        return point;
     2492   
     2493    // This is similar to the ParentToChildFlippingAdjustment in RenderBox::flipForWritingMode.  We have to subtract out our left/top offsets twice, since
     2494    // it's going to get added back in.  We hide this complication here so that the calling code looks normal for the unflipped
     2495    // case.
     2496    if (style()->isHorizontalWritingMode())
     2497        return IntPoint(point.x(), point.y() + height() - child->renderer()->height() - 2 * topForFloatIncludingMargin(child));
     2498    return IntPoint(point.x() + width() - child->width() - 2 * leftForFloatIncludingMargin(child), point.y());
     2499}
     2500
    24792501void RenderBlock::paintFloats(PaintInfo& paintInfo, int tx, int ty, bool preservePhase)
    24802502{
     
    24892511            PaintInfo currentPaintInfo(paintInfo);
    24902512            currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
    2491             IntPoint childPoint = flipForWritingMode(r->m_renderer, IntPoint(tx + r->left() + r->m_renderer->marginLeft() - r->m_renderer->x(), ty + r->top() + r->m_renderer->marginTop() - r->m_renderer->y()), ParentToChildFlippingAdjustment);
     2513            IntPoint childPoint = flipFloatForWritingMode(r, IntPoint(tx + leftForFloatIncludingMargin(r) - r->m_renderer->x(), ty + topForFloatIncludingMargin(r) - r->m_renderer->y()));
    24922514            r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
    24932515            if (!preservePhase) {
     
    27232745            for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) {
    27242746                FloatingObject* r = it.current();
    2725                 IntRect floatBox = IntRect(offsetFromRootBlock.width() + r->left() + r->m_renderer->marginLeft(),
    2726                                            offsetFromRootBlock.height() + r->top() + r->m_renderer->marginTop(),
     2747                IntRect floatBox = IntRect(offsetFromRootBlock.width() + leftForFloatIncludingMargin(r),
     2748                                           offsetFromRootBlock.height() + topForFloatIncludingMargin(r),
    27272749                                           r->m_renderer->width(), r->m_renderer->height());
    27282750                rootBlock->flipForWritingMode(floatBox);
     
    30943116}
    30953117
    3096 void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int y)
     3118void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int logicalOffset)
    30973119{
    30983120    if (!m_floatingObjects)
     
    31003122   
    31013123    FloatingObject* curr = m_floatingObjects->last();
    3102     while (curr != lastFloat && (!curr->isPlaced() || curr->top() >= y)) {
     3124    while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) >= logicalOffset)) {
    31033125        m_floatingObjects->removeLast();
    31043126        curr = m_floatingObjects->last();
     
    36123634            // child now.
    36133635            if (r->m_isDescendant)
    3614                 child->addOverflowFromChild(r->m_renderer, IntSize(r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop()));
     3636                child->addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r)));
    36153637        }
    36163638    }
     
    38503872    for (it.toLast(); (floatingObject = it.current()); --it) {
    38513873        if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) {
    3852             int xOffset = floatingObject->left() + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();
    3853             int yOffset = floatingObject->top() + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();
    3854             IntPoint childPoint = flipForWritingMode(floatingObject->m_renderer, IntPoint(tx + xOffset, ty + yOffset), ParentToChildFlippingAdjustment);
     3874            int xOffset = leftForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x();
     3875            int yOffset = topForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y();
     3876            IntPoint childPoint = flipFloatForWritingMode(floatingObject, IntPoint(tx + xOffset, ty + yOffset));
    38553877            if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), childPoint.x(), childPoint.y())) {
    38563878                updateHitTestResult(result, IntPoint(x - childPoint.x(), y - childPoint.y()));
     
    38703892    if (!colCount)
    38713893        return false;
    3872     int left = borderLeft() + paddingLeft();
    3873     int currYOffset = 0;
     3894    int logicalLeft = logicalLeftOffsetForContent();
     3895    int currLogicalTopOffset = 0;
    38743896    int i;
    3875     for (i = 0; i < colCount; i++)
    3876         currYOffset -= columnRectAt(colInfo, i).height();
     3897    bool isHorizontal = style()->isHorizontalWritingMode();
     3898    for (i = 0; i < colCount; i++) {
     3899        IntRect colRect = columnRectAt(colInfo, i);
     3900        int blockDelta =  (isHorizontal ? colRect.height() : colRect.width());
     3901        if (style()->isFlippedBlocksWritingMode())
     3902            currLogicalTopOffset += blockDelta;
     3903        else
     3904            currLogicalTopOffset -= blockDelta;
     3905    }
    38773906    for (i = colCount - 1; i >= 0; i--) {
    38783907        IntRect colRect = columnRectAt(colInfo, i);
    3879         int currXOffset = colRect.x() - left;
    3880         currYOffset += colRect.height();
     3908        flipForWritingMode(colRect);
     3909        int currLogicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - logicalLeft;
     3910        int blockDelta =  (isHorizontal ? colRect.height() : colRect.width());
     3911        if (style()->isFlippedBlocksWritingMode())
     3912            currLogicalTopOffset -= blockDelta;
     3913        else
     3914            currLogicalTopOffset += blockDelta;
    38813915        colRect.move(tx, ty);
    38823916       
     
    38853919            // Adjust tx and ty to change where we hit test.
    38863920       
    3887             int finalX = tx + currXOffset;
    3888             int finalY = ty + currYOffset;
     3921            IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset);
     3922            int finalX = tx + offset.width();
     3923            int finalY = ty + offset.height();
    38893924            if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(x, y)))
    38903925                hitTestContents(request, result, x, y, finalX, finalY, hitTestAction);
     
    41064141    // Calculate our column width and column count.
    41074142    unsigned desiredColumnCount = 1;
    4108     int desiredColumnWidth = contentWidth();
     4143    int desiredColumnWidth = contentLogicalWidth();
    41094144   
    41104145    // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination.
     
    41814216{
    41824217    if (!hasColumns())
    4183         return contentWidth();
     4218        return contentLogicalWidth();
    41844219    return gColumnInfoMap->get(this)->desiredColumnWidth();
    41854220}
     
    42104245
    42114246    // Compute the appropriate rect based off our information.
    4212     int colWidth = colInfo->desiredColumnWidth();
    4213     int colHeight = colInfo->columnHeight();
    4214     int colTop = borderTop() + paddingTop();
     4247    int colLogicalWidth = colInfo->desiredColumnWidth();
     4248    int colLogicalHeight = colInfo->columnHeight();
     4249    int colLogicalTop = borderBefore() + paddingBefore();
    42154250    int colGap = columnGap();
    4216     int colLeft = style()->isLeftToRightDirection() ?
    4217                       borderLeft() + paddingLeft() + (index * (colWidth + colGap))
    4218                       : borderLeft() + paddingLeft() + contentWidth() - colWidth - (index * (colWidth + colGap));
    4219     return IntRect(colLeft, colTop, colWidth, colHeight);
     4251    int colLogicalLeft = style()->isLeftToRightDirection() ?
     4252                          logicalLeftOffsetForContent() + (index * (colLogicalWidth + colGap))
     4253                        : logicalLeftOffsetForContent() + contentLogicalWidth() - colLogicalWidth - (index * (colLogicalWidth + colGap));
     4254    IntRect rect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight);
     4255    if (style()->isHorizontalWritingMode())
     4256        return IntRect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight);
     4257    return IntRect(colLogicalTop, colLogicalLeft, colLogicalHeight, colLogicalWidth);
    42204258}
    42214259
     
    42374275            if (!pageLogicalHeight) {
    42384276                int distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(),
    4239                                                 view()->layoutState()->pageLogicalOffset(borderTop() + paddingTop() + contentHeight()) - colInfo->forcedBreakOffset());
     4277                                                view()->layoutState()->pageLogicalOffset(borderBefore() + paddingBefore() + contentLogicalHeight()) - colInfo->forcedBreakOffset());
    42404278                columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
    42414279            }
    4242         } else if (contentHeight() > pageLogicalHeight * desiredColumnCount) {
     4280        } else if (contentLogicalHeight() > pageLogicalHeight * desiredColumnCount) {
    42434281            // Now that we know the intrinsic height of the columns, we have to rebalance them.
    4244             columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentHeight() / desiredColumnCount));
     4282            columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentLogicalHeight() / desiredColumnCount));
    42454283        }
    42464284       
     
    42544292   
    42554293    if (pageLogicalHeight)
    4256         colInfo->setColumnCountAndHeight(ceilf((float)contentHeight() / pageLogicalHeight), pageLogicalHeight);
     4294        colInfo->setColumnCountAndHeight(ceilf((float)contentLogicalHeight() / pageLogicalHeight), pageLogicalHeight);
    42574295
    42584296    if (columnCount(colInfo)) {
    4259         setLogicalHeight(borderTop() + paddingTop() + colInfo->columnHeight() + borderBottom() + paddingBottom() + horizontalScrollbarHeight());
     4297        setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight());
    42604298        m_overflow.clear();
    42614299    }
     
    42764314    // Determine which columns we intersect.
    42774315    int colGap = columnGap();
    4278     int leftGap = colGap / 2;
     4316    int halfColGap = colGap / 2;
    42794317    IntPoint columnPoint(columnRectAt(colInfo, 0).location());
    4280     int yOffset = 0;
     4318    int logicalOffset = 0;
    42814319    for (unsigned i = 0; i < colInfo->columnCount(); i++) {
    42824320        // Add in half the column gap to the left and right of the rect.
    42834321        IntRect colRect = columnRectAt(colInfo, i);
    4284         IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height());
    4285 
    4286         if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) {
    4287             // FIXME: The clamping that follows is not completely right for right-to-left
    4288             // content.
    4289             // Clamp everything above the column to its top left.
    4290             if (point.y() < gapAndColumnRect.y())
    4291                 point = gapAndColumnRect.location();
    4292             // Clamp everything below the column to the next column's top left. If there is
    4293             // no next column, this still maps to just after this column.
    4294             else if (point.y() >= gapAndColumnRect.bottom()) {
    4295                 point = gapAndColumnRect.location();
    4296                 point.move(0, gapAndColumnRect.height());
     4322        if (style()->isHorizontalWritingMode()) {
     4323            IntRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height());
     4324            if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) {
     4325                // FIXME: The clamping that follows is not completely right for right-to-left
     4326                // content.
     4327                // Clamp everything above the column to its top left.
     4328                if (point.y() < gapAndColumnRect.y())
     4329                    point = gapAndColumnRect.location();
     4330                // Clamp everything below the column to the next column's top left. If there is
     4331                // no next column, this still maps to just after this column.
     4332                else if (point.y() >= gapAndColumnRect.bottom()) {
     4333                    point = gapAndColumnRect.location();
     4334                    point.move(0, gapAndColumnRect.height());
     4335                }
     4336
     4337                // We're inside the column.  Translate the x and y into our column coordinate space.
     4338                point.move(columnPoint.x() - colRect.x(), logicalOffset);
     4339                return;
    42974340            }
    4298 
    4299             // We're inside the column.  Translate the x and y into our column coordinate space.
    4300             point.move(columnPoint.x() - colRect.x(), yOffset);
    4301             return;
    4302         }
    4303 
    4304         // Move to the next position.
    4305         yOffset += colRect.height();
     4341           
     4342            // Move to the next position.
     4343            logicalOffset += colRect.height();
     4344        } else {
     4345            IntRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap);
     4346            if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.bottom()) {
     4347                // FIXME: The clamping that follows is not completely right for right-to-left
     4348                // content.
     4349                // Clamp everything above the column to its top left.
     4350                if (point.x() < gapAndColumnRect.x())
     4351                    point = gapAndColumnRect.location();
     4352                // Clamp everything below the column to the next column's top left. If there is
     4353                // no next column, this still maps to just after this column.
     4354                else if (point.x() >= gapAndColumnRect.right()) {
     4355                    point = gapAndColumnRect.location();
     4356                    point.move(gapAndColumnRect.width(), 0);
     4357                }
     4358
     4359                // We're inside the column.  Translate the x and y into our column coordinate space.
     4360                point.move(logicalOffset, columnPoint.y() - colRect.y());
     4361                return;
     4362            }
     4363           
     4364            // Move to the next position.
     4365            logicalOffset += colRect.width();
     4366        }
    43064367    }
    43074368}
     
    43234384        return;
    43244385   
    4325     int left = borderLeft() + paddingLeft();
    4326    
    4327     int currYOffset = 0;
     4386    int logicalLeft = logicalLeftOffsetForContent();
     4387    int currLogicalOffset = 0;
     4388
    43284389    for (unsigned i = 0; i < colCount; i++) {
    43294390        IntRect colRect = columnRectAt(colInfo, i);
    4330         int currXOffset = colRect.x() - left;
    4331        
    43324391        IntRect repaintRect = r;
    4333         repaintRect.move(currXOffset, currYOffset);
    4334        
     4392        if (style()->isHorizontalWritingMode()) {
     4393            int currXOffset = colRect.x() - logicalLeft;
     4394            repaintRect.move(currXOffset, currLogicalOffset);
     4395            currLogicalOffset -= colRect.height();
     4396        } else {
     4397            int currYOffset = colRect.y() - logicalLeft;
     4398            repaintRect.move(currLogicalOffset, currYOffset);
     4399            currLogicalOffset -= colRect.width();
     4400        }
    43354401        repaintRect.intersect(colRect);
    4336        
    43374402        result.unite(repaintRect);
    4338 
    4339         // Move to the next position.
    4340         currYOffset -= colRect.height();
    43414403    }
    43424404
    43434405    r = result;
     4406}
     4407
     4408IntPoint RenderBlock::flipForWritingModeIncludingColumns(const IntPoint& point) const
     4409{
     4410    ASSERT(hasColumns());
     4411    if (!hasColumns() || !style()->isFlippedBlocksWritingMode())
     4412        return point;
     4413    ColumnInfo* colInfo = columnInfo();
     4414    int columnLogicalHeight = colInfo->columnHeight();
     4415    int expandedLogicalHeight = borderBefore() + paddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAfter() + paddingAfter() + scrollbarLogicalHeight();
     4416    if (style()->isHorizontalWritingMode())
     4417        return IntPoint(point.x(), expandedLogicalHeight - point.y());
     4418    return IntPoint(expandedLogicalHeight - point.x(), point.y());
     4419}
     4420
     4421void RenderBlock::flipForWritingModeIncludingColumns(IntRect& rect) const
     4422{
     4423    ASSERT(hasColumns());
     4424    if (!hasColumns() || !style()->isFlippedBlocksWritingMode())
     4425        return;
     4426   
     4427    ColumnInfo* colInfo = columnInfo();
     4428    int columnLogicalHeight = colInfo->columnHeight();
     4429    int expandedLogicalHeight = borderBefore() + paddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAfter() + paddingAfter() + scrollbarLogicalHeight();
     4430    if (style()->isHorizontalWritingMode())
     4431        rect.setY(expandedLogicalHeight - rect.bottom());
     4432    else
     4433        rect.setX(expandedLogicalHeight - rect.right());
    43444434}
    43454435
     
    43514441    ColumnInfo* colInfo = columnInfo();
    43524442
    4353     int left = borderLeft() + paddingLeft();
    4354     int yOffset = 0;
     4443    int logicalLeft = logicalLeftOffsetForContent();
    43554444    size_t colCount = columnCount(colInfo);
     4445    int colLogicalWidth = colInfo->desiredColumnWidth();
     4446    int colLogicalHeight = colInfo->columnHeight();
     4447
    43564448    for (size_t i = 0; i < colCount; ++i) {
    4357         IntRect columnRect = columnRectAt(colInfo, i);
    4358         int xOffset = columnRect.x() - left;
    4359         if (point.y() < columnRect.bottom() + yOffset) {
    4360             offset.expand(xOffset, -yOffset);
    4361             return;
    4362         }
    4363 
    4364         yOffset += columnRect.height();
     4449        // Compute the edges for a given column in the block progression direction.
     4450        IntRect sliceRect = IntRect(logicalLeft, borderBefore() + paddingBefore() + i * colLogicalHeight, colLogicalWidth, colLogicalHeight);
     4451        if (!style()->isHorizontalWritingMode())
     4452            sliceRect = sliceRect.transposedRect();
     4453       
     4454        // If we have a flipped blocks writing mode, then convert the column so that it's coming from the after edge (either top or left edge).
     4455        flipForWritingModeIncludingColumns(sliceRect);
     4456       
     4457        int logicalOffset = style()->isFlippedBlocksWritingMode() ? (colCount - 1 - i) * colLogicalHeight : i * colLogicalHeight;
     4458
     4459        // Now we're in the same coordinate space as the point.  See if it is inside the rectangle.
     4460        if (style()->isHorizontalWritingMode()) {
     4461            if (point.y() >= sliceRect.y() && point.y() < sliceRect.bottom()) {
     4462                offset.expand(columnRectAt(colInfo, i).x() - logicalLeft, -logicalOffset);
     4463                return;
     4464            }
     4465        } else {
     4466            if (point.x() >= sliceRect.x() && point.x() < sliceRect.right()) {
     4467                offset.expand(-logicalOffset, columnRectAt(colInfo, i).y() - logicalLeft);
     4468                return;
     4469            }
     4470        }
    43654471    }
    43664472}
     
    45024608{
    45034609    RenderStyle* cstyle = child->style();
    4504     int result = 0;
    4505     bool leftSide = (cstyle->isLeftToRightDirection()) ? !endOfInline : endOfInline;
    4506     result += getBPMWidth((leftSide ? child->marginLeft() : child->marginRight()),
    4507                           (leftSide ? cstyle->marginLeft() :
    4508                                       cstyle->marginRight()));
    4509     result += getBPMWidth((leftSide ? child->paddingLeft() : child->paddingRight()),
    4510                           (leftSide ? cstyle->paddingLeft() :
    4511                                       cstyle->paddingRight()));
    4512     result += leftSide ? child->borderLeft() : child->borderRight();
    4513     return result;
     4610    if (endOfInline)
     4611        return getBPMWidth(child->marginEnd(), cstyle->marginEnd()) +
     4612               getBPMWidth(child->paddingEnd(), cstyle->paddingEnd()) +
     4613               child->borderEnd();
     4614    return getBPMWidth(child->marginStart(), cstyle->marginStart()) +
     4615               getBPMWidth(child->paddingStart(), cstyle->paddingStart()) +
     4616               child->borderStart();
    45144617}
    45154618
     
    45344637    int inlineMin = 0;
    45354638
    4536     int cw = containingBlock()->contentWidth();
     4639    int cw = containingBlock()->contentLogicalWidth();
    45374640
    45384641    // If we are at the start of a line, we want to ignore all white-space.
     
    45444647    // very specific cirucumstances (in order to match common WinIE renderings).
    45454648    // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.)
    4546     bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->width().isIntrinsicOrAuto();
     4649    bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->logicalWidth().isIntrinsicOrAuto();
    45474650
    45484651    bool autoWrap, oldAutoWrap;
     
    46124715                    // Inline replaced elts add in their margins to their min/max values.
    46134716                    int margins = 0;
    4614                     Length leftMargin = cstyle->marginLeft();
    4615                     Length rightMargin = cstyle->marginRight();
    4616                     if (leftMargin.isFixed())
    4617                         margins += leftMargin.value();
    4618                     if (rightMargin.isFixed())
    4619                         margins += rightMargin.value();
     4717                    Length startMargin = cstyle->marginStart();
     4718                    Length endMargin = cstyle->marginEnd();
     4719                    if (startMargin.isFixed())
     4720                        margins += startMargin.value();
     4721                    if (endMargin.isFixed())
     4722                        margins += endMargin.value();
    46204723                    childMin += margins;
    46214724                    childMax += margins;
     
    46564759                    addedTextIndent = true;
    46574760                    ti = style()->textIndent().calcMinValue(cw);
    4658                     childMin+=ti;
    4659                     childMax+=ti;
     4761                    childMin += ti;
     4762                    childMax += ti;
    46604763                }
    46614764
     
    48194922        // Auto and percentage margins simply become 0 when computing min/max width.
    48204923        // Fixed margins can be added in as is.
    4821         Length ml = child->style()->marginLeft();
    4822         Length mr = child->style()->marginRight();
    4823         int margin = 0, marginLeft = 0, marginRight = 0;
    4824         if (ml.isFixed())
    4825             marginLeft += ml.value();
    4826         if (mr.isFixed())
    4827             marginRight += mr.value();
    4828         margin = marginLeft + marginRight;
     4924        Length startMarginLength = child->style()->marginStart();
     4925        Length endMarginLength = child->style()->marginEnd();
     4926        int margin = 0;
     4927        int marginStart = 0;
     4928        int marginEnd = 0;
     4929        if (startMarginLength.isFixed())
     4930            marginStart += startMarginLength.value();
     4931        if (endMarginLength.isFixed())
     4932            marginEnd += endMarginLength.value();
     4933        margin = marginStart + marginEnd;
    48294934
    48304935        int w = child->minPreferredLogicalWidth() + margin;
     
    48424947                // margins of the object.  For negative margins, we will attempt to overlap the float if the negative margin
    48434948                // is smaller than the float width.
    4844                 int maxLeft = marginLeft > 0 ? max(floatLeftWidth, marginLeft) : floatLeftWidth + marginLeft;
    4845                 int maxRight = marginRight > 0 ? max(floatRightWidth, marginRight) : floatRightWidth + marginRight;
     4949                bool ltr = containingBlock()->style()->isLeftToRightDirection();
     4950                int marginLogicalLeft = ltr ? marginStart : marginEnd;
     4951                int marginLogicalRight = ltr ? marginEnd : marginStart;
     4952                int maxLeft = marginLogicalLeft > 0 ? max(floatLeftWidth, marginLogicalLeft) : floatLeftWidth + marginLogicalLeft;
     4953                int maxRight = marginLogicalRight > 0 ? max(floatRightWidth, marginLogicalRight) : floatRightWidth + marginLogicalRight;
    48464954                w = child->maxPreferredLogicalWidth() + maxLeft + maxRight;
    48474955                w = max(w, floatLeftWidth + floatRightWidth);
     
    48734981        // We can achieve this effect by making the maxwidth of blocks that contain tables
    48744982        // with percentage widths be infinite (as long as they are not inside a table cell).
    4875         if (document()->inQuirksMode() && child->style()->width().isPercent() &&
     4983        if (document()->inQuirksMode() && child->style()->logicalWidth().isPercent() &&
    48764984            !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) {
    48774985            RenderBlock* cb = containingBlock();
     
    53715479                // Only examine the object if our m_shouldPaint flag is set.
    53725480                if (r->m_shouldPaint) {
    5373                     int floatLeft = r->left() - r->m_renderer->x() + r->m_renderer->marginLeft();
     5481                    int floatLeft = leftForFloatIncludingMargin(r) - r->m_renderer->x();
    53745482                    int floatRight = floatLeft + r->m_renderer->width();
    53755483                    left = min(left, floatLeft);
     
    57265834}
    57275835
    5728 int RenderBlock::nextPageTop(int yPos) const
     5836int RenderBlock::nextPageLogicalTop(int logicalOffset) const
    57295837{
    57305838    LayoutState* layoutState = view()->layoutState();
    57315839    if (!layoutState->m_pageLogicalHeight)
    5732         return yPos;
    5733    
    5734     // The yPos is in our coordinate space.  We can add in our pushed offset.
     5840        return logicalOffset;
     5841   
     5842    // The logicalOffset is in our coordinate space.  We can add in our pushed offset.
    57355843    int pageLogicalHeight = layoutState->m_pageLogicalHeight;
    5736     int remainingHeight = (pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight) % pageLogicalHeight;
    5737     return yPos + remainingHeight;
     5844    IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
     5845    int offset = style()->isHorizontalWritingMode() ? delta.height() : delta.width();
     5846    int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight;
     5847    return logicalOffset + remainingLogicalHeight;
    57385848}
    57395849
     
    57525862}
    57535863
    5754 int RenderBlock::applyBeforeBreak(RenderBox* child, int yPos)
     5864int RenderBlock::applyBeforeBreak(RenderBox* child, int logicalOffset)
    57555865{
    57565866    // FIXME: Add page break checking here when we support printing.
     
    57605870    if (checkBeforeAlways && inNormalFlow(child)) {
    57615871        if (checkColumnBreaks)
    5762             view()->layoutState()->addForcedColumnBreak(yPos);
    5763         return nextPageTop(yPos);
    5764     }
    5765     return yPos;
    5766 }
    5767 
    5768 int RenderBlock::applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo)
     5872            view()->layoutState()->addForcedColumnBreak(logicalOffset);
     5873        return nextPageLogicalTop(logicalOffset);
     5874    }
     5875    return logicalOffset;
     5876}
     5877
     5878int RenderBlock::applyAfterBreak(RenderBox* child, int logicalOffset, MarginInfo& marginInfo)
    57695879{
    57705880    // FIXME: Add page break checking here when we support printing.
     
    57755885        marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content.
    57765886        if (checkColumnBreaks)
    5777             view()->layoutState()->addForcedColumnBreak(yPos);
    5778         return nextPageTop(yPos);
    5779     }
    5780     return yPos;
    5781 }
    5782 
    5783 int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins)
     5887            view()->layoutState()->addForcedColumnBreak(logicalOffset);
     5888        return nextPageLogicalTop(logicalOffset);
     5889    }
     5890    return logicalOffset;
     5891}
     5892
     5893int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins)
    57845894{
    57855895    bool isUnsplittable = child->isReplaced() || child->scrollsOverflow();
    57865896    if (!isUnsplittable)
    5787         return yPos;
    5788     int childHeight = child->height() + (includeMargins ? child->marginTop() + child->marginBottom() : 0);
     5897        return logicalOffset;
     5898    int childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0);
    57895899    LayoutState* layoutState = view()->layoutState();
    57905900    if (layoutState->m_columnInfo)
    5791         layoutState->m_columnInfo->updateMinimumColumnHeight(childHeight);
     5901        layoutState->m_columnInfo->updateMinimumColumnHeight(childLogicalHeight);
    57925902    int pageLogicalHeight = layoutState->m_pageLogicalHeight;
    5793     if (!pageLogicalHeight || childHeight > pageLogicalHeight)
    5794         return yPos;
    5795     int remainingHeight = (pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight) % pageLogicalHeight;
    5796     if (remainingHeight < childHeight)
    5797         return yPos + remainingHeight;
    5798     return yPos;
     5903    if (!pageLogicalHeight || childLogicalHeight > pageLogicalHeight)
     5904        return logicalOffset;
     5905    IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
     5906    int offset = style()->isHorizontalWritingMode() ? delta.height() : delta.width();
     5907    int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight;
     5908    if (remainingLogicalHeight < childLogicalHeight)
     5909        return logicalOffset + remainingLogicalHeight;
     5910    return logicalOffset;
    57995911}
    58005912
     
    58195931    LayoutState* layoutState = view()->layoutState();
    58205932    int pageLogicalHeight = layoutState->m_pageLogicalHeight;
    5821     int yPos = lineBox->topVisualOverflow();
    5822     int lineHeight = lineBox->bottomVisualOverflow() - yPos;
     5933    int logicalOffset = lineBox->logicalTopVisualOverflow();
     5934    int lineHeight = lineBox->logicalBottomVisualOverflow() - logicalOffset;
    58235935    if (layoutState->m_columnInfo)
    58245936        layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight);
    5825     yPos += delta;
     5937    logicalOffset += delta;
    58265938    lineBox->setPaginationStrut(0);
    58275939    if (!pageLogicalHeight || lineHeight > pageLogicalHeight)
    58285940        return;
    5829     int remainingHeight = pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight;
    5830     if (remainingHeight < lineHeight) {
    5831         int totalHeight = lineHeight + max(0, yPos);
    5832         if (lineBox == firstRootBox() && totalHeight < pageLogicalHeight && !isPositioned() && !isTableCell())
    5833             setPaginationStrut(remainingHeight + max(0, yPos));
     5941    IntSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
     5942    int offset = style()->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
     5943    int remainingLogicalHeight = pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight;
     5944    if (remainingLogicalHeight < lineHeight) {
     5945        int totalLogicalHeight = lineHeight + max(0, logicalOffset);
     5946        if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight && !isPositioned() && !isTableCell())
     5947            setPaginationStrut(remainingLogicalHeight + max(0, logicalOffset));
    58345948        else {
    5835             delta += remainingHeight;
    5836             lineBox->setPaginationStrut(remainingHeight);
     5949            delta += remainingLogicalHeight;
     5950            lineBox->setPaginationStrut(remainingLogicalHeight);
    58375951        }
    58385952    } 
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r76438 r76726  
    107107    virtual int availableLogicalWidth() const;
    108108
     109    IntPoint flipForWritingModeIncludingColumns(const IntPoint&) const;
     110    void flipForWritingModeIncludingColumns(IntRect&) const;
     111
    109112    RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(firstLineBox()); }
    110113    RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(lastLineBox()); }
     
    213216    virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*verticalScrollbarChanged*/) { };
    214217
     218    int logicalRightOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() + availableLogicalWidth() : borderTop() + paddingTop() + availableLogicalWidth(); }
     219    int logicalLeftOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
     220
    215221protected:
    216222    // These functions are only used internally to manipulate the render tree structure via remove/insert/appendChildNode.
     
    262268    virtual void paintObject(PaintInfo&, int tx, int ty);
    263269
    264     int logicalRightOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() + availableLogicalWidth() : borderTop() + paddingTop() + availableLogicalWidth(); }
    265     int logicalLeftOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
    266270    int logicalRightOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
    267271    int logicalLeftOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
     
    400404        int width() const { return m_frameRect.width(); }
    401405        int height() const { return m_frameRect.height(); }
    402    
     406
    403407        void setLeft(int left) { m_frameRect.setX(left); }
    404408        void setTop(int top) { m_frameRect.setY(top); }
     
    418422    };
    419423
    420     int logicalTopForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->top() : child->left(); }
    421     int logicalBottomForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->bottom() : child->right(); }
    422     int logicalLeftForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->left() : child->top(); }
    423     int logicalRightForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->right() : child->bottom(); }
    424     int logicalWidthForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->width() : child->height(); }
     424    IntPoint flipFloatForWritingMode(const FloatingObject*, const IntPoint&) const;
     425
     426    int logicalTopForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->top() : child->left(); }
     427    int logicalBottomForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->bottom() : child->right(); }
     428    int logicalLeftForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->left() : child->top(); }
     429    int logicalRightForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->right() : child->bottom(); }
     430    int logicalWidthForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->width() : child->height(); }
    425431    void setLogicalTopForFloat(FloatingObject* child, int logicalTop)
    426432    {
     
    450456        else
    451457            child->setHeight(logicalWidth);
     458    }
     459
     460    int leftForFloatIncludingMargin(const FloatingObject* child) const
     461    {
     462        if (style()->isHorizontalWritingMode())
     463            return child->left() + child->renderer()->marginLeft();
     464        else
     465            return child->left() + marginBeforeForChild(child->renderer());
     466    }
     467       
     468    int topForFloatIncludingMargin(const FloatingObject* child) const
     469    {
     470        if (style()->isHorizontalWritingMode())
     471            return child->top() + marginBeforeForChild(child->renderer());
     472        else
     473            return child->top() + child->renderer()->marginTop();
    452474    }
    453475
     
    489511    FloatingObject* insertFloatingObject(RenderBox*);
    490512    void removeFloatingObject(RenderBox*);
    491     void removeFloatingObjectsBelow(FloatingObject*, int y);
     513    void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset);
    492514   
    493515    // Called from lineWidth, to position the floats added in the last line.
     
    668690
    669691    // Pagination routines.
    670     int nextPageTop(int yPos) const; // Returns the top of the next page following yPos.
    671     int applyBeforeBreak(RenderBox* child, int yPos); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
    672     int applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo); // If the child has an after break, then return a new yPos that shifts to the top of the next page/column.
    673     int adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins = false); // If the child is unsplittable and can't fit on the current page, return the top of the next page/column.
    674     void adjustLinePositionForPagination(RootInlineBox*, int& deltaY); // Computes a deltaY value that put a line at the top of the next page if it doesn't fit on the current page.
     692    int nextPageLogicalTop(int logicalOffset) const; // Returns the top of the next page following logicalOffset.
     693    int applyBeforeBreak(RenderBox* child, int logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
     694    int applyAfterBreak(RenderBox* child, int logicalOffset, MarginInfo& marginInfo); // If the child has an after break, then return a new offset that shifts to the top of the next page/column.
     695    int adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins = false); // If the child is unsplittable and can't fit on the current page, return the top of the next page/column.
     696    void adjustLinePositionForPagination(RootInlineBox*, int& deltaOffset); // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page.
    675697
    676698    typedef PositionedObjectsListHashSet::const_iterator Iterator;
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r76414 r76726  
    791791                        if (adjustment) {
    792792                            int oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, firstLine);
    793                             lineBox->adjustPosition(0, adjustment);
     793                            lineBox->adjustBlockDirectionPosition(adjustment);
    794794                            if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop.
    795795                                repaintLogicalBottom = max(repaintLogicalBottom, afterSideVisualOverflowForLine(lineBox));
     
    849849                        repaintLogicalTop = min(repaintLogicalTop, beforeSideVisualOverflowForLine(line) + min(delta, 0));
    850850                        repaintLogicalBottom = max(repaintLogicalBottom, afterSideVisualOverflowForLine(line) + max(delta, 0));
    851                         line->adjustPosition(0, delta);
     851                        line->adjustBlockDirectionPosition(delta);
    852852                    }
    853853                    if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) {
     
    966966                    repaintLogicalTop = min(repaintLogicalTop, beforeSideVisualOverflowForLine(curr) + min(paginationDelta, 0));
    967967                    repaintLogicalBottom = max(repaintLogicalBottom, afterSideVisualOverflowForLine(curr) + max(paginationDelta, 0));
    968                     curr->adjustPosition(0, paginationDelta);
     968                    curr->adjustBlockDirectionPosition(paginationDelta);
    969969                }               
    970970            }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r76633 r76726  
    12691269    if (!isInline() || isReplaced()) {
    12701270        if (style()->position() != AbsolutePosition && style()->position() != FixedPosition) {
    1271             o->adjustForColumns(offset, IntPoint(point.x() + x(), point.y() + y()));
    1272             offset += locationOffsetIncludingFlipping();
     1271            if (o->hasColumns()) {
     1272                IntRect columnRect(frameRect());
     1273                toRenderBlock(o)->flipForWritingModeIncludingColumns(columnRect);
     1274                offset += IntSize(columnRect.location().x(), columnRect.location().y());
     1275                columnRect.move(point.x(), point.y());
     1276                o->adjustForColumns(offset, columnRect.location());
     1277            } else
     1278                offset += locationOffsetIncludingFlipping();
    12731279        } else
    12741280            offset += locationOffset();
     
    33293335}
    33303336
     3337IntPoint RenderBox::flipForWritingModeIncludingColumns(const IntPoint& point) const
     3338{
     3339    if (!hasColumns() || !style()->isFlippedBlocksWritingMode())
     3340        return flipForWritingMode(point);
     3341    return toRenderBlock(this)->flipForWritingModeIncludingColumns(point);
     3342}
     3343
    33313344IntSize RenderBox::flipForWritingMode(const IntSize& offset) const
    33323345{
  • trunk/Source/WebCore/rendering/RenderBox.h

    r76141 r76726  
    173173    int clientWidth() const;
    174174    int clientHeight() const;
    175     int clientLogicalBottom() const { return style()->isHorizontalWritingMode() ? clientTop() + clientHeight() : clientLeft() + clientWidth(); }
     175    int clientLogicalBottom() const { return borderBefore() + (style()->isHorizontalWritingMode() ? clientHeight() : clientWidth()); }
    176176    IntRect clientBoxRect() const { return IntRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }
    177177
     
    379379    int flipForWritingMode(int position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes).
    380380    IntPoint flipForWritingMode(const IntPoint&) const;
     381    IntPoint flipForWritingModeIncludingColumns(const IntPoint&) const;
    381382    IntSize flipForWritingMode(const IntSize&) const;
    382383    void flipForWritingMode(IntRect&) const;
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r76170 r76726  
    281281
    282282    if (view()->layoutState()->pageLogicalHeight())
    283         setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(y()));
     283        setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop()));
    284284
    285285    // Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r76442 r76726  
    750750{
    751751    ASSERT(container == this->container());
    752 
     752   
    753753    IntSize offset;   
    754754    if (isRelPositioned())
     
    783783    if (!o)
    784784        return;
     785
     786    IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
     787    if (o->isBox() && o->style()->isFlippedBlocksWritingMode())
     788        transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedIntPoint(transformState.mappedPoint())) - centerPoint);
    785789
    786790    IntSize containerOffset = offsetFromContainer(o, roundedIntPoint(transformState.mappedPoint()));
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r76669 r76726  
    25702570    columnBlock->layer()->convertToLayerCoords(rootLayer, layerX, layerY);
    25712571   
     2572    bool isHorizontal = columnBlock->style()->isHorizontalWritingMode();
     2573
    25722574    ColumnInfo* colInfo = columnBlock->columnInfo();
    25732575    unsigned colCount = columnBlock->columnCount(colInfo);
    2574     int currYOffset = 0;
     2576    int currLogicalTopOffset = 0;
    25752577    for (unsigned i = 0; i < colCount; i++) {
    25762578        // For each rect, we clip to the rect, and then we adjust our coords.
    25772579        IntRect colRect = columnBlock->columnRectAt(colInfo, i);
    2578         int currXOffset = colRect.x() - (columnBlock->borderLeft() + columnBlock->paddingLeft());
     2580        columnBlock->flipForWritingMode(colRect);
     2581        int logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent();
     2582        IntSize offset = isHorizontal ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset);
     2583
    25792584        colRect.move(layerX, layerY);
    25802585
     
    25962601                    oldTransform = *childLayer->transform();
    25972602                TransformationMatrix newTransform(oldTransform);
    2598                 newTransform.translateRight(currXOffset, currYOffset);
     2603                newTransform.translateRight(offset.width(), offset.height());
    25992604               
    26002605                childLayer->m_transform.set(new TransformationMatrix(newTransform));
     
    26112616                columnLayers[colIndex - 1]->convertToLayerCoords(rootLayer, childX, childY);
    26122617                TransformationMatrix transform;
    2613                 transform.translateRight(childX + currXOffset, childY + currYOffset);
     2618                transform.translateRight(childX + offset.width(), childY + offset.height());
    26142619               
    26152620                // Apply the transform.
     
    26262631
    26272632        // Move to the next position.
    2628         currYOffset -= colRect.height();
     2633        int blockDelta = isHorizontal ? colRect.height() : colRect.width();
     2634        if (columnBlock->style()->isFlippedBlocksWritingMode())
     2635            currLogicalTopOffset += blockDelta;
     2636        else
     2637            currLogicalTopOffset -= blockDelta;
    26292638    }
    26302639}
     
    30393048   
    30403049    // We have to go backwards from the last column to the first.
    3041     int left = columnBlock->borderLeft() + columnBlock->paddingLeft();
    3042     int currYOffset = 0;
     3050    bool isHorizontal = columnBlock->style()->isHorizontalWritingMode();
     3051    int logicalLeft = columnBlock->logicalLeftOffsetForContent();
     3052    int currLogicalTopOffset = 0;
    30433053    int i;
    3044     for (i = 0; i < colCount; i++)
    3045         currYOffset -= columnBlock->columnRectAt(colInfo, i).height();
     3054    for (i = 0; i < colCount; i++) {
     3055        IntRect colRect = columnBlock->columnRectAt(colInfo, i);
     3056        int blockDelta =  (isHorizontal ? colRect.height() : colRect.width());
     3057        if (columnBlock->style()->isFlippedBlocksWritingMode())
     3058            currLogicalTopOffset += blockDelta;
     3059        else
     3060            currLogicalTopOffset -= blockDelta;
     3061    }
    30463062    for (i = colCount - 1; i >= 0; i--) {
    30473063        // For each rect, we clip to the rect, and then we adjust our coords.
    30483064        IntRect colRect = columnBlock->columnRectAt(colInfo, i);
    3049         int currXOffset = colRect.x() - left;
    3050         currYOffset += colRect.height();
     3065        columnBlock->flipForWritingMode(colRect);
     3066        int currLogicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - logicalLeft;
     3067        int blockDelta =  (isHorizontal ? colRect.height() : colRect.width());
     3068        if (columnBlock->style()->isFlippedBlocksWritingMode())
     3069            currLogicalTopOffset -= blockDelta;
     3070        else
     3071            currLogicalTopOffset += blockDelta;
    30513072        colRect.move(layerX, layerY);
    30523073
     
    30543075        localClipRect.intersect(colRect);
    30553076       
     3077        IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset);
     3078
    30563079        if (!localClipRect.isEmpty() && localClipRect.intersects(result.rectForPoint(hitTestPoint))) {
    30573080            RenderLayer* hitLayer = 0;
     
    30633086                    oldTransform = *childLayer->transform();
    30643087                TransformationMatrix newTransform(oldTransform);
    3065                 newTransform.translateRight(currXOffset, currYOffset);
     3088                newTransform.translateRight(offset.width(), offset.height());
    30663089               
    30673090                childLayer->m_transform.set(new TransformationMatrix(newTransform));
     
    30763099                RenderLayer* nextLayer = columnLayers[columnIndex - 1];
    30773100                RefPtr<HitTestingTransformState> newTransformState = nextLayer->createLocalTransformState(rootLayer, nextLayer, localClipRect, hitTestPoint, transformState);
    3078                 newTransformState->translate(currXOffset, currYOffset, HitTestingTransformState::AccumulateTransform);
     3101                newTransformState->translate(offset.width(), offset.height(), HitTestingTransformState::AccumulateTransform);
    30793102                IntPoint localPoint = roundedIntPoint(newTransformState->mappedPoint());
    30803103                IntRect localHitTestRect = newTransformState->mappedQuad().enclosingBoundingBox();
     
    33463369    // floats.
    33473370    IntRect result;
    3348     if (renderer()->isRenderInline()) {
    3349         // Go from our first line box to our last line box.
    3350         RenderInline* inlineFlow = toRenderInline(renderer());
    3351         InlineFlowBox* firstBox = inlineFlow->firstLineBox();
    3352         if (!firstBox)
    3353             return result;
    3354         int top = firstBox->topVisualOverflow();
    3355         int bottom = inlineFlow->lastLineBox()->bottomVisualOverflow();
    3356         int left = firstBox->x();
    3357         for (InlineFlowBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
    3358             left = min(left, curr->x());
    3359         result = IntRect(left, top, width(), bottom - top);
    3360     } else if (renderer()->isTableRow()) {
     3371    if (renderer()->isRenderInline())
     3372        result = toRenderInline(renderer())->linesVisualOverflowBoundingBox();
     3373    else if (renderer()->isTableRow()) {
    33613374        // Our bounding box is just the union of all of our cells' border/overflow rects.
    33623375        for (RenderObject* child = renderer()->firstChild(); child; child = child->nextSibling()) {
     
    33943407{   
    33953408    IntRect result = localBoundingBox();
    3396 
     3409    if (renderer()->isBox())
     3410        renderBox()->flipForWritingMode(result);
     3411    else
     3412        renderer()->containingBlock()->flipForWritingMode(result);
    33973413    int deltaX = 0, deltaY = 0;
    33983414    convertToLayerCoords(ancestorLayer, deltaX, deltaY);
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r76537 r76726  
    19481948        return;
    19491949
     1950    IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
     1951    if (o->isBox() && o->style()->isFlippedBlocksWritingMode())
     1952        transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedIntPoint(transformState.mappedPoint())) - centerPoint);
     1953
    19501954    IntSize columnOffset;
    19511955    o->adjustForColumns(columnOffset, roundedIntPoint(transformState.mappedPoint()));
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r75837 r76726  
    395395
    396396    if (view()->layoutState()->pageLogicalHeight())
    397         setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(y()));
     397        setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop()));
    398398
    399399    bool didFullRepaint = repainter.repaintAfterLayout();
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r75837 r76726  
    126126        if (child->isTableCell()) {
    127127            RenderTableCell* cell = toRenderTableCell(child);
    128             if (!cell->needsLayout() && paginated && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell->y()) != cell->pageLogicalOffset())
     128            if (!cell->needsLayout() && paginated && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell->logicalTop()) != cell->pageLogicalOffset())
    129129                cell->setChildNeedsLayout(true, false);
    130130
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r76276 r76726  
    618618                cell->setNeedsLayout(true, false);
    619619
    620             if (!cell->needsLayout() && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell->y()) != cell->pageLogicalOffset())
     620            if (!cell->needsLayout() && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell->logicalTop()) != cell->pageLogicalOffset())
    621621                cell->setChildNeedsLayout(true, false);
    622622
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r76202 r76726  
    346346        // Shorten the width of this text box if it ends in an ellipsis.
    347347        IntRect ellipsisRect = (option == ClipToEllipsis) ? ellipsisRectForBox(box, 0, textLength()) : IntRect();
    348         if (!ellipsisRect.isEmpty())
    349             boundaries.setWidth(ellipsisRect.right() - boundaries.x());
     348        if (!ellipsisRect.isEmpty()) {
     349            if (style()->isHorizontalWritingMode())
     350                boundaries.setWidth(ellipsisRect.right() - boundaries.x());
     351            else
     352                boundaries.setHeight(ellipsisRect.bottom() - boundaries.y());
     353        }
    350354        quads.append(localToAbsoluteQuad(FloatRect(boundaries)));
    351355    }
     
    375379            if (useSelectionHeight) {
    376380                IntRect selectionRect = box->selectionRect(0, 0, start, end);
    377                 r.setHeight(selectionRect.height());
    378                 r.setY(selectionRect.y());
     381                if (box->isHorizontal()) {
     382                    r.setHeight(selectionRect.height());
     383                    r.setY(selectionRect.y());
     384                } else {
     385                    r.setWidth(selectionRect.width());
     386                    r.setX(selectionRect.x());
     387                }
    379388            }
    380389            quads.append(localToAbsoluteQuad(FloatRect(r)));
     
    385394                if (!useSelectionHeight) {
    386395                    // change the height and y position because selectionRect uses selection-specific values
    387                     r.setHeight(box->logicalHeight());
    388                     r.setY(box->y());
     396                    if (box->isHorizontal()) {
     397                        r.setHeight(box->logicalHeight());
     398                        r.setY(box->y());
     399                    } else {
     400                        r.setWidth(box->logicalHeight());
     401                        r.setX(box->x());
     402                    }
    389403                }
    390404                quads.append(localToAbsoluteQuad(FloatRect(r)));
Note: See TracChangeset for help on using the changeset viewer.