| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 namespace WebCore { | 48 namespace WebCore { |
| 49 | 49 |
| 50 class AffineTransform; | 50 class AffineTransform; |
| 51 class Cursor; | 51 class Cursor; |
| 52 class Document; | 52 class Document; |
| 53 class HitTestLocation; | 53 class HitTestLocation; |
| 54 class HitTestResult; | 54 class HitTestResult; |
| 55 class InlineBox; | 55 class InlineBox; |
| 56 class InlineFlowBox; | 56 class InlineFlowBox; |
| 57 class InvalidationTreeWalkState; |
| 57 class Position; | 58 class Position; |
| 58 class PositionWithAffinity; | 59 class PositionWithAffinity; |
| 59 class PseudoStyleRequest; | 60 class PseudoStyleRequest; |
| 60 class RenderBoxModelObject; | 61 class RenderBoxModelObject; |
| 61 class RenderBlock; | 62 class RenderBlock; |
| 62 class RenderFlowThread; | 63 class RenderFlowThread; |
| 63 class RenderGeometryMap; | 64 class RenderGeometryMap; |
| 64 class RenderLayer; | 65 class RenderLayer; |
| 65 class RenderLayerModelObject; | 66 class RenderLayerModelObject; |
| 66 class RenderView; | 67 class RenderView; |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 // Convert a local quad to absolute coordinates, taking transforms into acco
unt. | 727 // Convert a local quad to absolute coordinates, taking transforms into acco
unt. |
| 727 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0, bool* wasFixed = 0) const | 728 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0, bool* wasFixed = 0) const |
| 728 { | 729 { |
| 729 return localToContainerQuad(quad, 0, mode, wasFixed); | 730 return localToContainerQuad(quad, 0, mode, wasFixed); |
| 730 } | 731 } |
| 731 // Convert an absolute quad to local coordinates. | 732 // Convert an absolute quad to local coordinates. |
| 732 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0
) const; | 733 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0
) const; |
| 733 | 734 |
| 734 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. | 735 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. |
| 735 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec
t* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) cons
t; | 736 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec
t* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) cons
t; |
| 736 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb
ject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) c
onst; | 737 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb
ject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, c
onst InvalidationTreeWalkState* = 0) const; |
| 737 | 738 |
| 738 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, | 739 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, |
| 739 // different offsets apply at different points, so return the offset that ap
plies to the given point. | 740 // different offsets apply at different points, so return the offset that ap
plies to the given point. |
| 740 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; | 741 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; |
| 741 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. | 742 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. |
| 742 LayoutSize offsetFromAncestorContainer(const RenderObject*) const; | 743 LayoutSize offsetFromAncestorContainer(const RenderObject*) const; |
| 743 | 744 |
| 744 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } | 745 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } |
| 745 | 746 |
| 746 // Computes the position of the given render object in the space of |repaint
Container|. | 747 // Computes the position of the given render object in the space of |repaint
Container|. |
| 747 LayoutPoint positionFromPaintInvalidationContainer(const RenderLayerModelObj
ect* paintInvalidationContainer) const; | 748 LayoutPoint positionFromPaintInvalidationContainer(const RenderLayerModelObj
ect* paintInvalidationContainer, const InvalidationTreeWalkState* = 0) const; |
| 748 | 749 |
| 749 IntRect absoluteBoundingBoxRect() const; | 750 IntRect absoluteBoundingBoxRect() const; |
| 750 // FIXME: This function should go away eventually | 751 // FIXME: This function should go away eventually |
| 751 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; | 752 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; |
| 752 | 753 |
| 753 // Build an array of quads in absolute coords for line boxes | 754 // Build an array of quads in absolute coords for line boxes |
| 754 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } | 755 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } |
| 755 | 756 |
| 756 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); | 757 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); |
| 757 | 758 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 const RenderLayerModelObject* containerForPaintInvalidation() const; | 802 const RenderLayerModelObject* containerForPaintInvalidation() const; |
| 802 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst RenderLayerModelObject* paintInvalidationContainer) const; | 803 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c
onst RenderLayerModelObject* paintInvalidationContainer) const; |
| 803 bool isPaintInvalidationContainer() const; | 804 bool isPaintInvalidationContainer() const; |
| 804 | 805 |
| 805 LayoutRect computePaintInvalidationRect() | 806 LayoutRect computePaintInvalidationRect() |
| 806 { | 807 { |
| 807 return computePaintInvalidationRect(containerForPaintInvalidation()); | 808 return computePaintInvalidationRect(containerForPaintInvalidation()); |
| 808 } | 809 } |
| 809 | 810 |
| 810 // Returns the paint invalidation rect for this RenderObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. | 811 // Returns the paint invalidation rect for this RenderObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. |
| 811 LayoutRect computePaintInvalidationRect(const RenderLayerModelObject* paintI
nvalidationContainer) const; | 812 LayoutRect computePaintInvalidationRect(const RenderLayerModelObject* paintI
nvalidationContainer, const InvalidationTreeWalkState* = 0) const; |
| 812 | 813 |
| 813 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| | 814 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the rendering backing of |paintInvalidationContainer| |
| 814 LayoutRect boundsRectForPaintInvalidation(const RenderLayerModelObject* pain
tInvalidationContainer) const; | 815 LayoutRect boundsRectForPaintInvalidation(const RenderLayerModelObject* pain
tInvalidationContainer, const InvalidationTreeWalkState* = 0) const; |
| 815 | 816 |
| 816 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space | 817 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space |
| 817 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same | 818 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same |
| 818 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. | 819 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. |
| 819 // If |paintInvalidationContainer| is 0, invalidate paints via the view. | 820 // If |paintInvalidationContainer| is 0, invalidate paints via the view. |
| 820 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636
99. | 821 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636
99. |
| 821 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali
dationContainer, const IntRect&, InvalidationReason) const; | 822 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali
dationContainer, const IntRect&, InvalidationReason) const; |
| 822 | 823 |
| 823 // Invalidate the paint of the entire object. Called when, e.g., the color o
f a border changes, or when a border | 824 // Invalidate the paint of the entire object. Called when, e.g., the color o
f a border changes, or when a border |
| 824 // style changes. | 825 // style changes. |
| 825 void paintInvalidationForWholeRenderer() const; | 826 void paintInvalidationForWholeRenderer() const; |
| 826 | 827 |
| 827 // Invalidate the paint of a specific subrectangle within a given object. Th
e rect |r| is in the object's coordinate space. | 828 // Invalidate the paint of a specific subrectangle within a given object. Th
e rect |r| is in the object's coordinate space. |
| 828 void invalidatePaintRectangle(const LayoutRect&) const; | 829 void invalidatePaintRectangle(const LayoutRect&) const; |
| 829 | 830 |
| 830 bool invalidatePaintIfNeeded(const RenderLayerModelObject* paintInvalidation
Container, | 831 bool invalidatePaintIfNeeded(const RenderLayerModelObject* paintInvalidation
Container, |
| 831 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva
lidationContainer); | 832 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva
lidationContainer); |
| 832 | 833 |
| 833 // Walk the tree after layout issuing paint invalidations for renderers that
have changed or moved, updating bounds that have changed, and clearing paint in
validation state. | 834 // Walk the tree after layout issuing paint invalidations for renderers that
have changed or moved, updating bounds that have changed, and clearing paint in
validation state. |
| 834 virtual void invalidateTreeAfterLayout(const RenderLayerModelObject&); | 835 virtual void invalidateTreeAfterLayout(const InvalidationTreeWalkState&); |
| 835 | 836 |
| 836 virtual void invalidatePaintForOverflow(); | 837 virtual void invalidatePaintForOverflow(); |
| 837 void invalidatePaintForOverflowIfNeeded(); | 838 void invalidatePaintForOverflowIfNeeded(); |
| 838 | 839 |
| 839 bool checkForPaintInvalidation() const; | 840 bool checkForPaintInvalidation() const; |
| 840 | 841 |
| 841 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's | 842 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's |
| 842 // coordinate space. This method deals with outlines and overflow. | 843 // coordinate space. This method deals with outlines and overflow. |
| 843 LayoutRect absoluteClippedOverflowRect() const | 844 LayoutRect absoluteClippedOverflowRect() const |
| 844 { | 845 { |
| 845 return clippedOverflowRectForPaintInvalidation(0); | 846 return clippedOverflowRectForPaintInvalidation(0); |
| 846 } | 847 } |
| 847 IntRect pixelSnappedAbsoluteClippedOverflowRect() const; | 848 IntRect pixelSnappedAbsoluteClippedOverflowRect() const; |
| 848 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer) const; | 849 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer
ModelObject* paintInvalidationContainer, const InvalidationTreeWalkState* = 0) c
onst; |
| 849 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth) const; | 850 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const Invalidation
TreeWalkState* = 0) const; |
| 850 | 851 |
| 851 // Given a rect in the object's coordinate space, compute a rect suitable fo
r invalidating paints of | 852 // Given a rect in the object's coordinate space, compute a rect suitable fo
r invalidating paints of |
| 852 // that rect in the coordinate space of paintInvalidationContainer. | 853 // that rect in the coordinate space of paintInvalidationContainer. |
| 853 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, bool fixed = false) const; | 854 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect&, bool fixed = false, const Invalidation
TreeWalkState* = 0) const; |
| 854 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje
ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, bool fixed = f
alse) const; | 855 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje
ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, bool fixed = f
alse, const InvalidationTreeWalkState* = 0) const; |
| 855 | 856 |
| 856 // Return the offset to the column in which the specified point (in flow-thr
ead coordinates) | 857 // Return the offset to the column in which the specified point (in flow-thr
ead coordinates) |
| 857 // lives. This is used to convert a flow-thread point to a visual point. | 858 // lives. This is used to convert a flow-thread point to a visual point. |
| 858 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz
e(); } | 859 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz
e(); } |
| 859 | 860 |
| 860 virtual unsigned length() const { return 1; } | 861 virtual unsigned length() const { return 1; } |
| 861 | 862 |
| 862 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut
OfFlowPositioned()); } | 863 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut
OfFlowPositioned()); } |
| 863 | 864 |
| 864 bool isTransparent() const { return style()->opacity() < 1.0f; } | 865 bool isTransparent() const { return style()->opacity() < 1.0f; } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 bool isInert() const; | 945 bool isInert() const; |
| 945 | 946 |
| 946 bool supportsTouchAction() const; | 947 bool supportsTouchAction() const; |
| 947 | 948 |
| 948 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } | 949 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } |
| 949 | 950 |
| 950 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } | 951 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } |
| 951 | 952 |
| 952 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use | 953 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use |
| 953 // localToAbsolute/absoluteToLocal methods instead. | 954 // localToAbsolute/absoluteToLocal methods instead. |
| 954 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0) const; | 955 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool*
wasFixed = 0, const InvalidationTreeWalkState* = 0) const; |
| 955 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; | 956 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; |
| 956 | 957 |
| 957 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). | 958 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). |
| 958 // Returns the renderer which was mapped to (container or ancestorToStopAt). | 959 // Returns the renderer which was mapped to (container or ancestorToStopAt). |
| 959 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; | 960 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; |
| 960 | 961 |
| 961 bool shouldUseTransformFromContainer(const RenderObject* container) const; | 962 bool shouldUseTransformFromContainer(const RenderObject* container) const; |
| 962 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; | 963 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; |
| 963 | 964 |
| 964 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || hasBlendMode(); } | 965 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || hasBlendMode(); } |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 void showTree(const WebCore::RenderObject*); | 1475 void showTree(const WebCore::RenderObject*); |
| 1475 void showLineTree(const WebCore::RenderObject*); | 1476 void showLineTree(const WebCore::RenderObject*); |
| 1476 void showRenderTree(const WebCore::RenderObject* object1); | 1477 void showRenderTree(const WebCore::RenderObject* object1); |
| 1477 // We don't make object2 an optional parameter so that showRenderTree | 1478 // We don't make object2 an optional parameter so that showRenderTree |
| 1478 // can be called from gdb easily. | 1479 // can be called from gdb easily. |
| 1479 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO
bject* object2); | 1480 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO
bject* object2); |
| 1480 | 1481 |
| 1481 #endif | 1482 #endif |
| 1482 | 1483 |
| 1483 #endif // RenderObject_h | 1484 #endif // RenderObject_h |
| OLD | NEW |