Changeset 70664 in webkit


Ignore:
Timestamp:
Oct 27, 2010 10:16:07 AM (14 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=48381

Reviewed by Dan Bernstein.

Make basic layer positioning work with vertical-lr writing-mode.

WebCore:

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::paintChildren):
(WebCore::RenderBlock::paintFloats):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
(WebCore::RenderBox::locationOffsetIncludingFlipping):

  • rendering/RenderBox.h:
  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateLayerPosition):

LayoutTests:

  • fast/blockflow/japanese-lr-text.html: Added.
  • fast/blockflow/japanese-rl-text.html: Added.
Location:
trunk
Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70660 r70664  
     12010-10-27  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48381
     6
     7        Make basic layer positioning work with vertical-lr writing-mode.
     8
     9        * fast/blockflow/japanese-lr-text.html: Added.
     10        * fast/blockflow/japanese-rl-text.html: Added.
     11
    1122010-10-27  Dimitri Glazkov  <dglazkov@chromium.org>
    213
  • trunk/WebCore/ChangeLog

    r70663 r70664  
     12010-10-27  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=48381
     6
     7        Make basic layer positioning work with vertical-lr writing-mode.
     8
     9        * rendering/RenderBlock.cpp:
     10        (WebCore::RenderBlock::paintChildren):
     11        (WebCore::RenderBlock::paintFloats):
     12        * rendering/RenderBox.cpp:
     13        (WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
     14        (WebCore::RenderBox::locationOffsetIncludingFlipping):
     15        * rendering/RenderBox.h:
     16        * rendering/RenderLayer.cpp:
     17        (WebCore::RenderLayer::updateLayerPosition):
     18
    1192010-10-27  Zhenyao Mo  <zmo@google.com>
    220
  • trunk/WebCore/rendering/RenderBlock.cpp

    r70619 r70664  
    22712271
    22722272        IntPoint childPoint(tx, ty);
    2273         adjustForFlippedBlocksWritingMode(child, childPoint);
     2273        adjustForFlippedBlocksWritingMode(child, childPoint, ParentToChildFlippingAdjustment);
    22742274        if (!child->hasSelfPaintingLayer() && !child->isFloating())
    22752275            child->paint(info, childPoint.x(), childPoint.y());
     
    24082408            IntPoint childPoint(tx + r->left() + r->m_renderer->marginLeft() - r->m_renderer->x(),
    24092409                                ty + r->top() + r->m_renderer->marginTop() - r->m_renderer->y());
    2410             adjustForFlippedBlocksWritingMode(r->m_renderer, childPoint);
     2410            adjustForFlippedBlocksWritingMode(r->m_renderer, childPoint, ParentToChildFlippingAdjustment);
    24112411            r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y());
    24122412            if (!preservePhase) {
  • trunk/WebCore/rendering/RenderBox.cpp

    r70546 r70664  
    31993199}
    32003200
    3201 void RenderBox::adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint& point)
     3201void RenderBox::adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint& point, FlippingAdjustment adjustment)
    32023202{
    32033203    if (!style()->isFlippedBlocksWritingMode())
     
    32073207    // the right place.
    32083208    if (style()->isHorizontalWritingMode())
    3209         point.move(0, height() - child->height() - child->y() - child->y());
     3209        point.move(0, height() - child->height() - child->y() - (adjustment == ParentToChildFlippingAdjustment ? child->y() : 0));
    32103210    else
    3211         point.move(width() - child->width() - child->x() - child->x(), 0);
     3211        point.move(width() - child->width() - child->x() - (adjustment == ParentToChildFlippingAdjustment ? child->x() : 0), 0);
     3212}
     3213
     3214IntSize RenderBox::locationOffsetIncludingFlipping()
     3215{
     3216    if (!parent() || !parent()->isBox())
     3217        return locationOffset();
     3218   
     3219    RenderBox* parent = parentBox();
     3220    IntPoint localPoint(x(), y());
     3221    parent->adjustForFlippedBlocksWritingMode(this, localPoint, ChildToParentFlippingAdjustment);
     3222    return IntSize(localPoint.x(), localPoint.y());
    32123223}
    32133224
  • trunk/WebCore/rendering/RenderBox.h

    r70546 r70664  
    378378    virtual int baselinePosition(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    379379
    380     void adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint&);
     380    enum FlippingAdjustment { ChildToParentFlippingAdjustment, ParentToChildFlippingAdjustment };
     381    void adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint&, FlippingAdjustment);
     382    IntSize locationOffsetIncludingFlipping();
    381383
    382384protected:
  • trunk/WebCore/rendering/RenderLayer.cpp

    r70497 r70664  
    678678        }
    679679       
    680         localPoint += box->locationOffset();
     680        localPoint += box->locationOffsetIncludingFlipping();
    681681    }
    682682
     
    692692                // Rows and cells share the same coordinate space (that of the section).
    693693                // Omit them when computing our xpos/ypos.
    694                 localPoint += toRenderBox(curr)->locationOffset();
     694                localPoint += toRenderBox(curr)->locationOffsetIncludingFlipping();
    695695            }
    696696            curr = curr->parent();
     
    698698        if (curr->isBox() && curr->isTableRow()) {
    699699            // Put ourselves into the row coordinate space.
    700             localPoint -= toRenderBox(curr)->locationOffset();
     700            localPoint -= toRenderBox(curr)->locationOffsetIncludingFlipping();
    701701        }
    702702    }
Note: See TracChangeset for help on using the changeset viewer.