Changeset 123146 in webkit


Ignore:
Timestamp:
Jul 19, 2012 1:46:03 PM (12 years ago)
Author:
mitz@apple.com
Message:

In flipped blocks writing modes, no flipping occurs when mapping RenderText’s local coordinates to absolute
https://bugs.webkit.org/show_bug.cgi?id=91780

Reviewed by Anders Carlsson.

Source/WebCore:

Test: fast/writing-mode/flipped-blocks-text-map-local-to-container.html

When RenderObject::mapLocalToContainer() was called on a RenderText with ApplyContainerFlip,
it would not flip (if the container was not a box) but it would always pass
DoNotApplyContainerFlip when recurring to the parent. This meant that no one applied the flip.

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::mapLocalToContainer): Made the setting of applyContainerFlip to
false unconditional on the container actually being flipped.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::mapLocalToContainer): Rather than always passing
DoNotApplyContainerFlip when recurring to the parent, changed this function to pass through
the value of applyContainerFlip it was called with, unless it applied the flip itself.

LayoutTests:

  • fast/writing-mode/flipped-blocks-text-map-local-to-container-expected.txt: Added.
  • fast/writing-mode/flipped-blocks-text-map-local-to-container.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123145 r123146  
     12012-07-19  Dan Bernstein  <mitz@apple.com>
     2
     3        In flipped blocks writing modes, no flipping occurs when mapping RenderText’s local coordinates to absolute
     4        https://bugs.webkit.org/show_bug.cgi?id=91780
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/writing-mode/flipped-blocks-text-map-local-to-container-expected.txt: Added.
     9        * fast/writing-mode/flipped-blocks-text-map-local-to-container.html: Added.
     10
    1112012-07-19  Erik Arvidsson  <arv@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r123145 r123146  
     12012-07-19  Dan Bernstein  <mitz@apple.com>
     2
     3        In flipped blocks writing modes, no flipping occurs when mapping RenderText’s local coordinates to absolute
     4        https://bugs.webkit.org/show_bug.cgi?id=91780
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Test: fast/writing-mode/flipped-blocks-text-map-local-to-container.html
     9
     10        When RenderObject::mapLocalToContainer() was called on a RenderText with ApplyContainerFlip,
     11        it would not flip (if the container was not a box) but it would always pass
     12        DoNotApplyContainerFlip when recurring to the parent. This meant that no one applied the flip.
     13
     14        * rendering/RenderInline.cpp:
     15        (WebCore::RenderInline::mapLocalToContainer): Made the setting of applyContainerFlip to
     16        false unconditional on the container actually being flipped.
     17        * rendering/RenderObject.cpp:
     18        (WebCore::RenderObject::mapLocalToContainer): Rather than always passing
     19        DoNotApplyContainerFlip when recurring to the parent, changed this function to pass through
     20        the value of applyContainerFlip it was called with, unless it applied the flip itself.
     21
    1222012-07-19  Erik Arvidsson  <arv@chromium.org>
    223
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r123025 r123146  
    11361136        return;
    11371137
    1138     if (applyContainerFlip && o->isBox() && o->style()->isFlippedBlocksWritingMode()) {
    1139         IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
    1140         transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(centerPoint) - centerPoint);
     1138    if (applyContainerFlip && o->isBox()) {
     1139        if (o->style()->isFlippedBlocksWritingMode()) {
     1140            IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
     1141            transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(centerPoint) - centerPoint);
     1142        }
    11411143        applyContainerFlip = DoNotApplyContainerFlip;
    11421144    }
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r123061 r123146  
    19941994}
    19951995
    1996 void RenderObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const
     1996void RenderObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot applyContainerFlip, bool* wasFixed) const
    19971997{
    19981998    if (repaintContainer == this)
     
    20052005    // FIXME: this should call offsetFromContainer to share code, but I'm not sure it's ever called.
    20062006    LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint());
    2007     if (o->isBox() && o->style()->isFlippedBlocksWritingMode())
    2008         transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint);
     2007    if (applyContainerFlip && o->isBox()) {
     2008        if (o->style()->isFlippedBlocksWritingMode())
     2009            transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint);
     2010        applyContainerFlip = DoNotApplyContainerFlip;
     2011    }
    20092012
    20102013    LayoutSize columnOffset;
     
    20162019        transformState.move(-toRenderBox(o)->scrolledContentOffset());
    20172020
    2018     o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, DoNotApplyContainerFlip, wasFixed);
     2021    o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, applyContainerFlip, wasFixed);
    20192022}
    20202023
Note: See TracChangeset for help on using the changeset viewer.