| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 if (container->hasOverflowClip()) | 609 if (container->hasOverflowClip()) |
| 610 offset -= toRenderBox(container)->scrolledContentOffset(); | 610 offset -= toRenderBox(container)->scrolledContentOffset(); |
| 611 | 611 |
| 612 // FIXME(sky): Remove now that it's always false? | 612 // FIXME(sky): Remove now that it's always false? |
| 613 if (offsetDependsOnPoint) | 613 if (offsetDependsOnPoint) |
| 614 *offsetDependsOnPoint = false; | 614 *offsetDependsOnPoint = false; |
| 615 | 615 |
| 616 return offset; | 616 return offset; |
| 617 } | 617 } |
| 618 | 618 |
| 619 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode, const
PaintInvalidationState* paintInvalidationState) const | 619 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode) const |
| 620 { | 620 { |
| 621 if (paintInvalidationContainer == this) | 621 if (paintInvalidationContainer == this) |
| 622 return; | 622 return; |
| 623 | 623 |
| 624 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | |
| 625 LayoutSize offset = paintInvalidationState->paintOffset(); | |
| 626 if (style()->hasInFlowPosition() && layer()) | |
| 627 offset += layer()->offsetForInFlowPosition(); | |
| 628 transformState.move(offset); | |
| 629 return; | |
| 630 } | |
| 631 | |
| 632 bool containerSkipped; | 624 bool containerSkipped; |
| 633 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); | 625 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); |
| 634 if (!o) | 626 if (!o) |
| 635 return; | 627 return; |
| 636 | 628 |
| 637 if (mode & ApplyContainerFlip && o->isBox()) { | 629 if (mode & ApplyContainerFlip && o->isBox()) { |
| 638 mode &= ~ApplyContainerFlip; | 630 mode &= ~ApplyContainerFlip; |
| 639 } | 631 } |
| 640 | 632 |
| 641 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans
formState.mappedPoint())); | 633 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans
formState.mappedPoint())); |
| 642 | 634 |
| 643 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl
e()->preserves3D()); | 635 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl
e()->preserves3D()); |
| 644 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { | 636 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { |
| 645 TransformationMatrix t; | 637 TransformationMatrix t; |
| 646 getTransformFromContainer(o, containerOffset, t); | 638 getTransformFromContainer(o, containerOffset, t); |
| 647 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); | 639 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate
Transform : TransformState::FlattenTransform); |
| 648 } else | 640 } else |
| 649 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); | 641 transformState.move(containerOffset.width(), containerOffset.height(), p
reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo
rm); |
| 650 | 642 |
| 651 if (containerSkipped) { | 643 if (containerSkipped) { |
| 652 // There can't be a transform between paintInvalidationContainer and o,
because transforms create containers, so it should be safe | 644 // There can't be a transform between paintInvalidationContainer and o,
because transforms create containers, so it should be safe |
| 653 // to just subtract the delta between the paintInvalidationContainer and
o. | 645 // to just subtract the delta between the paintInvalidationContainer and
o. |
| 654 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces
torContainer(o); | 646 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces
torContainer(o); |
| 655 transformState.move(-containerOffset.width(), -containerOffset.height(),
preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans
form); | 647 transformState.move(-containerOffset.width(), -containerOffset.height(),
preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans
form); |
| 656 return; | 648 return; |
| 657 } | 649 } |
| 658 | 650 |
| 659 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, pai
ntInvalidationState); | 651 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode); |
| 660 } | 652 } |
| 661 | 653 |
| 662 void RenderInline::updateHitTestResult(HitTestResult& result, const LayoutPoint&
point) | 654 void RenderInline::updateHitTestResult(HitTestResult& result, const LayoutPoint&
point) |
| 663 { | 655 { |
| 664 if (result.innerNode()) | 656 if (result.innerNode()) |
| 665 return; | 657 return; |
| 666 | 658 |
| 667 Node* n = node(); | 659 Node* n = node(); |
| 668 LayoutPoint localPoint(point); | 660 LayoutPoint localPoint(point); |
| 669 if (n) { | 661 if (n) { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 pixelSnappedBox.maxY(), | 955 pixelSnappedBox.maxY(), |
| 964 pixelSnappedBox.maxX() + outlineWidth, | 956 pixelSnappedBox.maxX() + outlineWidth, |
| 965 pixelSnappedBox.maxY() + outlineWidth, | 957 pixelSnappedBox.maxY() + outlineWidth, |
| 966 BSBottom, outlineColor, outlineStyle, | 958 BSBottom, outlineColor, outlineStyle, |
| 967 outlineWidth, | 959 outlineWidth, |
| 968 outlineWidth, | 960 outlineWidth, |
| 969 antialias); | 961 antialias); |
| 970 } | 962 } |
| 971 | 963 |
| 972 } // namespace blink | 964 } // namespace blink |
| OLD | NEW |