Changeset 115981 in webkit
- Timestamp:
- May 3, 2012, 9:32:33 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r115980 r115981 1 2012-05-03 Dan Bernstein <mitz@apple.com> 2 3 highlight for Ruby text is mispositioned in the Web Inspector 4 https://bugs.webkit.org/show_bug.cgi?id=82684 5 6 Reviewed by Simon Fraser. 7 8 * fast/writing-mode/flipped-blocks-inline-map-local-to-container-expected.html: Added. 9 * fast/writing-mode/flipped-blocks-inline-map-local-to-container.html: Added. 10 1 11 2012-05-03 Andrey Kosyakov <caseq@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r115979 r115981 1 2012-05-03 Dan Bernstein <mitz@apple.com> 2 3 highlight for Ruby text is mispositioned in the Web Inspector 4 https://bugs.webkit.org/show_bug.cgi?id=82684 5 6 Reviewed by Simon Fraser. 7 8 Tests: fast/writing-mode/flipped-blocks-inline-map-local-to-container-expected.html 9 fast/writing-mode/flipped-blocks-inline-map-local-to-container.html 10 11 In flipped blocks writing modes, flipping was being applied twice to box descendants of 12 inline children of the flipped block, once during RenderBox::mapLocalToContainer, and then 13 again by RenderInline::mapLocalToContainer. The fix is to make the latter only apply the 14 flip to local coordinates originating in the inline or a descendant inline. This is done 15 by adding a parameter of type ApplyContainerFlipOrNot, which defaults to ApplyContainerFlip 16 but is reset to DoNotApplyContainerFlip in recursive calls into mapLocalToContainer(). 17 18 * rendering/RenderBox.cpp: 19 (WebCore::RenderBox::mapLocalToContainer): Added ApplyContainerFlipOrNot parameter, passing 20 DoNotApplyContainerFlip when recursing into the container. 21 * rendering/RenderBox.h: 22 23 * rendering/RenderInline.cpp: 24 (WebCore::RenderInline::mapLocalToContainer): Added ApplyContainerFlipOrNot paramerer, and 25 made the flipping conditional on its value. 26 27 * rendering/RenderInline.h: 28 29 * rendering/RenderObject.cpp: 30 (WebCore::RenderObject::mapLocalToContainer): Added ApplyContainerFlipOrNot parameter, 31 passing DoNotApplyContainerFlip when recursing into the container. 32 (WebCore::RenderObject::localToContainerQuad): Pass ApplyContainerFlip. 33 (WebCore::RenderObject::localToContainerPoint): Ditto. 34 * rendering/RenderObject.h: 35 36 * rendering/RenderView.cpp: 37 (WebCore::RenderView::mapLocalToContainer): Added ApplyContainerFlipOrNot parameter. 38 * rendering/RenderView.h: 39 40 * rendering/svg/RenderSVGForeignObject.cpp: 41 (WebCore::RenderSVGForeignObject::mapLocalToContainer): Ditto. 42 * rendering/svg/RenderSVGForeignObject.h: 43 44 * rendering/svg/RenderSVGInline.cpp: 45 (WebCore::RenderSVGInline::mapLocalToContainer): Ditto. 46 * rendering/svg/RenderSVGInline.h: 47 48 * rendering/svg/RenderSVGModelObject.cpp: 49 (WebCore::RenderSVGModelObject::mapLocalToContainer): Ditto. 50 * rendering/svg/RenderSVGModelObject.h: 51 52 * rendering/svg/RenderSVGRoot.cpp: 53 (WebCore::RenderSVGRoot::mapLocalToContainer): Ditto. 54 * rendering/svg/RenderSVGRoot.h: 55 56 * rendering/svg/RenderSVGText.cpp: 57 (WebCore::RenderSVGText::mapLocalToContainer): Ditto. 58 * rendering/svg/RenderSVGText.h: 59 60 * rendering/svg/SVGRenderSupport.cpp: 61 (WebCore::SVGRenderSupport::mapLocalToContainer): Pass DoNotApplyContainerFlip when 62 recursing into the parent. 63 1 64 2012-05-03 Pavel Feldman <pfeldman@chromium.org> 2 65 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r115846 r115981 1376 1376 } 1377 1377 1378 void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, bool* wasFixed) const1378 void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 1379 1379 { 1380 1380 if (repaintContainer == this) … … 1430 1430 RenderRegion* region = toRenderFlowThread(o)->mapFromFlowToRegion(transformState); 1431 1431 if (region) 1432 region->mapLocalToContainer(region->containerForRepaint(), fixed, useTransforms, transformState, wasFixed);1432 region->mapLocalToContainer(region->containerForRepaint(), fixed, useTransforms, transformState, DoNotApplyContainerFlip, wasFixed); 1433 1433 return; 1434 1434 } 1435 1435 1436 o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, wasFixed);1436 o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, DoNotApplyContainerFlip, wasFixed); 1437 1437 } 1438 1438 -
trunk/Source/WebCore/rendering/RenderBox.h
r115846 r115981 517 517 virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); } 518 518 519 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, bool* wasFixed = 0) const;519 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 520 520 virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const; 521 521 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r115458 r115981 1165 1165 } 1166 1166 1167 void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, bool* wasFixed) const1167 void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot applyContainerFlip, bool* wasFixed) const 1168 1168 { 1169 1169 if (repaintContainer == this) … … 1186 1186 return; 1187 1187 1188 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 1189 if (o->isBox() && o->style()->isFlippedBlocksWritingMode()) 1190 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedIntPoint(transformState.mappedPoint())) - centerPoint); 1188 if (applyContainerFlip && o->isBox() && o->style()->isFlippedBlocksWritingMode()) { 1189 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 1190 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(centerPoint) - centerPoint); 1191 applyContainerFlip = DoNotApplyContainerFlip; 1192 } 1191 1193 1192 1194 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint())); … … 1208 1210 } 1209 1211 1210 o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, wasFixed);1212 o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, applyContainerFlip, wasFixed); 1211 1213 } 1212 1214 -
trunk/Source/WebCore/rendering/RenderInline.h
r112756 r115981 131 131 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed) const; 132 132 133 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, bool* wasFixed = 0) const;133 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 134 134 135 135 virtual VisiblePosition positionForPoint(const LayoutPoint&); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r115701 r115981 2025 2025 } 2026 2026 2027 void RenderObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, bool* wasFixed) const2027 void RenderObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 2028 2028 { 2029 2029 if (repaintContainer == this) … … 2046 2046 transformState.move(-toRenderBox(o)->scrolledContentOffset()); 2047 2047 2048 o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, wasFixed);2048 o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, DoNotApplyContainerFlip, wasFixed); 2049 2049 } 2050 2050 … … 2102 2102 // it will use that point as the reference point to decide which column's transform to apply in multiple-column blocks. 2103 2103 TransformState transformState(TransformState::ApplyTransformDirection, localQuad.boundingBox().center(), localQuad); 2104 mapLocalToContainer(repaintContainer, fixed, true, transformState, wasFixed);2104 mapLocalToContainer(repaintContainer, fixed, true, transformState, ApplyContainerFlip, wasFixed); 2105 2105 transformState.flatten(); 2106 2106 … … 2111 2111 { 2112 2112 TransformState transformState(TransformState::ApplyTransformDirection, localPoint); 2113 mapLocalToContainer(repaintContainer, fixed, true, transformState, wasFixed);2113 mapLocalToContainer(repaintContainer, fixed, true, transformState, ApplyContainerFlip, wasFixed); 2114 2114 transformState.flatten(); 2115 2115 -
trunk/Source/WebCore/rendering/RenderObject.h
r115908 r115981 866 866 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use 867 867 // localToAbsolute/absoluteToLocal methods instead. 868 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const; 868 enum ApplyContainerFlipOrNot { DoNotApplyContainerFlip, ApplyContainerFlip }; 869 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 869 870 virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const; 870 871 -
trunk/Source/WebCore/rendering/RenderView.cpp
r115779 r115981 151 151 } 152 152 153 void RenderView::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, bool* wasFixed) const153 void RenderView::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 154 154 { 155 155 // If a container was specified, and was not 0 or the RenderView, -
trunk/Source/WebCore/rendering/RenderView.h
r115779 r115981 188 188 189 189 protected: 190 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;190 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 191 191 virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const; 192 192 virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE; -
trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
r112438 r115981 189 189 } 190 190 191 void RenderSVGForeignObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* fixed */, bool /* useTransforms */, TransformState& transformState, bool* wasFixed) const191 void RenderSVGForeignObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* fixed */, bool /* useTransforms */, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 192 192 { 193 193 SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed); -
trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.h
r103465 r115981 55 55 virtual bool isSVGForeignObject() const { return true; } 56 56 57 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, bool* wasFixed = 0) const;57 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 58 58 virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; } 59 59 -
trunk/Source/WebCore/rendering/svg/RenderSVGInline.cpp
r105549 r115981 80 80 } 81 81 82 void RenderSVGInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* useTransforms */, bool /* fixed */, TransformState& transformState, bool* wasFixed) const82 void RenderSVGInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* useTransforms */, bool /* fixed */, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 83 83 { 84 84 SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed); -
trunk/Source/WebCore/rendering/svg/RenderSVGInline.h
r105549 r115981 48 48 virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; 49 49 virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect&, bool fixed = false) const; 50 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;50 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 51 51 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const; 52 52 -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
r110224 r115981 56 56 } 57 57 58 void RenderSVGModelObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* fixed */, bool /* useTransforms */, TransformState& transformState, bool* wasFixed) const58 void RenderSVGModelObject::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* fixed */, bool /* useTransforms */, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 59 59 { 60 60 SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed); -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.h
r110224 r115981 59 59 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const; 60 60 61 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;61 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 62 62 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); 63 63 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r114315 r115981 383 383 // Callers with local SVG viewport coordinates should first apply the localToBorderBoxTransform 384 384 // to convert from SVG viewport coordinates to local CSS box coordinates. 385 void RenderSVGRoot::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, bool* wasFixed) const385 void RenderSVGRoot::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 386 386 { 387 387 ASSERT(!fixed); // We should have no fixed content in the SVG rendering tree. 388 388 ASSERT(useTransforms); // mapping a point through SVG w/o respecting trasnforms is useless. 389 389 390 RenderReplaced::mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, wasFixed);390 RenderReplaced::mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, ApplyContainerFlip, wasFixed); 391 391 } 392 392 -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r112091 r115981 95 95 virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect& repaintRect, bool fixed) const; 96 96 97 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;97 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 98 98 virtual bool canBeSelectionLeaf() const { return false; } 99 99 virtual bool canHaveChildren() const { return true; } -
trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp
r112284 r115981 106 106 } 107 107 108 void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* fixed */, bool /* useTransforms */, TransformState& transformState, bool* wasFixed) const108 void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool /* fixed */, bool /* useTransforms */, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const 109 109 { 110 110 SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState, wasFixed); -
trunk/Source/WebCore/rendering/svg/RenderSVGText.h
r112119 r115981 79 79 virtual void computeFloatRectForRepaint(RenderBoxModelObject* repaintContainer, FloatRect&, bool fixed = false) const; 80 80 81 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const;81 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; 82 82 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); 83 83 -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
r115097 r115981 83 83 transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxTransform()); 84 84 85 parent->mapLocalToContainer(repaintContainer, false, true, transformState, wasFixed);85 parent->mapLocalToContainer(repaintContainer, false, true, transformState, RenderObject::DoNotApplyContainerFlip, wasFixed); 86 86 } 87 87
Note:
See TracChangeset
for help on using the changeset viewer.