| 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 15 matching lines...) Expand all Loading... |
| 26 #ifndef SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ | 26 #ifndef SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ |
| 27 #define SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ | 27 #define SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ |
| 28 | 28 |
| 29 #include "sky/engine/core/dom/Document.h" | 29 #include "sky/engine/core/dom/Document.h" |
| 30 #include "sky/engine/core/dom/DocumentLifecycle.h" | 30 #include "sky/engine/core/dom/DocumentLifecycle.h" |
| 31 #include "sky/engine/core/dom/Element.h" | 31 #include "sky/engine/core/dom/Element.h" |
| 32 #include "sky/engine/core/editing/TextAffinity.h" | 32 #include "sky/engine/core/editing/TextAffinity.h" |
| 33 #include "sky/engine/core/fetch/ImageResourceClient.h" | 33 #include "sky/engine/core/fetch/ImageResourceClient.h" |
| 34 #include "sky/engine/core/html/HTMLElement.h" | 34 #include "sky/engine/core/html/HTMLElement.h" |
| 35 #include "sky/engine/core/rendering/HitTestRequest.h" | 35 #include "sky/engine/core/rendering/HitTestRequest.h" |
| 36 #include "sky/engine/core/rendering/PaintInvalidationState.h" | |
| 37 #include "sky/engine/core/rendering/PaintPhase.h" | 36 #include "sky/engine/core/rendering/PaintPhase.h" |
| 38 #include "sky/engine/core/rendering/RenderObjectChildList.h" | 37 #include "sky/engine/core/rendering/RenderObjectChildList.h" |
| 39 #include "sky/engine/core/rendering/ScrollAlignment.h" | 38 #include "sky/engine/core/rendering/ScrollAlignment.h" |
| 40 #include "sky/engine/core/rendering/SubtreeLayoutScope.h" | 39 #include "sky/engine/core/rendering/SubtreeLayoutScope.h" |
| 41 #include "sky/engine/core/rendering/style/RenderStyle.h" | 40 #include "sky/engine/core/rendering/style/RenderStyle.h" |
| 42 #include "sky/engine/core/rendering/style/StyleInheritedData.h" | 41 #include "sky/engine/core/rendering/style/StyleInheritedData.h" |
| 43 #include "sky/engine/platform/geometry/FloatQuad.h" | 42 #include "sky/engine/platform/geometry/FloatQuad.h" |
| 44 #include "sky/engine/platform/geometry/LayoutRect.h" | 43 #include "sky/engine/platform/geometry/LayoutRect.h" |
| 45 #include "sky/engine/platform/transforms/TransformationMatrix.h" | 44 #include "sky/engine/platform/transforms/TransformationMatrix.h" |
| 46 | 45 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 // Convert a local quad to absolute coordinates, taking transforms into acco
unt. | 506 // Convert a local quad to absolute coordinates, taking transforms into acco
unt. |
| 508 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0) const | 507 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0) const |
| 509 { | 508 { |
| 510 return localToContainerQuad(quad, 0, mode); | 509 return localToContainerQuad(quad, 0, mode); |
| 511 } | 510 } |
| 512 // Convert an absolute quad to local coordinates. | 511 // Convert an absolute quad to local coordinates. |
| 513 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0
) const; | 512 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0
) const; |
| 514 | 513 |
| 515 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. | 514 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. |
| 516 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec
t* paintInvalidatinoContainer, MapCoordinatesFlags = 0) const; | 515 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec
t* paintInvalidatinoContainer, MapCoordinatesFlags = 0) const; |
| 517 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb
ject* paintInvalidationContainer, MapCoordinatesFlags = 0, const PaintInvalidati
onState* = 0) const; | 516 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb
ject* paintInvalidationContainer, MapCoordinatesFlags = 0) const; |
| 518 | 517 |
| 519 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, | 518 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, |
| 520 // different offsets apply at different points, so return the offset that ap
plies to the given point. | 519 // different offsets apply at different points, so return the offset that ap
plies to the given point. |
| 521 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; | 520 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; |
| 522 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. | 521 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. |
| 523 LayoutSize offsetFromAncestorContainer(const RenderObject*) const; | 522 LayoutSize offsetFromAncestorContainer(const RenderObject*) const; |
| 524 | 523 |
| 525 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } | 524 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } |
| 526 | 525 |
| 527 // Computes the position of the given render object in the space of |paintIn
validationContainer|. | |
| 528 LayoutPoint positionFromPaintInvalidationContainer(const RenderLayerModelObj
ect* paintInvalidationContainer, const PaintInvalidationState* = 0) const; | |
| 529 | |
| 530 IntRect absoluteBoundingBoxRect() const; | 526 IntRect absoluteBoundingBoxRect() const; |
| 531 // FIXME: This function should go away eventually | 527 // FIXME: This function should go away eventually |
| 532 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; | 528 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; |
| 533 | 529 |
| 534 // Build an array of quads in absolute coords for line boxes | 530 // Build an array of quads in absolute coords for line boxes |
| 535 virtual void absoluteQuads(Vector<FloatQuad>&) const { } | 531 virtual void absoluteQuads(Vector<FloatQuad>&) const { } |
| 536 | 532 |
| 537 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); | 533 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); |
| 538 | 534 |
| 539 static FloatRect absoluteBoundingBoxRectForRange(const Range*); | 535 static FloatRect absoluteBoundingBoxRectForRange(const Range*); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 void remove() { if (parent()) parent()->removeChild(this); } | 641 void remove() { if (parent()) parent()->removeChild(this); } |
| 646 | 642 |
| 647 bool supportsTouchAction() const; | 643 bool supportsTouchAction() const; |
| 648 | 644 |
| 649 bool visibleToHitTestRequest(const HitTestRequest& request) const { return (
request.ignorePointerEventsNone() || style()->pointerEvents() != PE_NONE); } | 645 bool visibleToHitTestRequest(const HitTestRequest& request) const { return (
request.ignorePointerEventsNone() || style()->pointerEvents() != PE_NONE); } |
| 650 | 646 |
| 651 bool visibleToHitTesting() const { return style()->pointerEvents() != PE_NON
E; } | 647 bool visibleToHitTesting() const { return style()->pointerEvents() != PE_NON
E; } |
| 652 | 648 |
| 653 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use | 649 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use |
| 654 // localToAbsolute/absoluteToLocal methods instead. | 650 // localToAbsolute/absoluteToLocal methods instead. |
| 655 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, const
PaintInvalidationState* = 0) const; | 651 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida
tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip) const; |
| 656 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; | 652 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; |
| 657 | 653 |
| 658 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). | 654 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). |
| 659 // Returns the renderer which was mapped to (container or ancestorToStopAt). | 655 // Returns the renderer which was mapped to (container or ancestorToStopAt). |
| 660 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; | 656 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; |
| 661 | 657 |
| 662 bool shouldUseTransformFromContainer(const RenderObject* container) const; | 658 bool shouldUseTransformFromContainer(const RenderObject* container) const; |
| 663 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; | 659 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; |
| 664 | 660 |
| 665 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
(); } | 661 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
(); } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 679 void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& lo
cation) { m_previousPositionFromPaintInvalidationContainer = location; } | 675 void setPreviousPositionFromPaintInvalidationContainer(const LayoutPoint& lo
cation) { m_previousPositionFromPaintInvalidationContainer = location; } |
| 680 | 676 |
| 681 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv
alidateOverflowForPaint(); } | 677 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv
alidateOverflowForPaint(); } |
| 682 | 678 |
| 683 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee
dedPositionedMovementLayout(); } | 679 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee
dedPositionedMovementLayout(); } |
| 684 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed
edPositionedMovementLayout(b); } | 680 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed
edPositionedMovementLayout(b); } |
| 685 | 681 |
| 686 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout
BecauseOfChildren(); } | 682 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout
BecauseOfChildren(); } |
| 687 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB
ecauseOfChildren(b); } | 683 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB
ecauseOfChildren(b); } |
| 688 | 684 |
| 689 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasTransf
orm(); } | |
| 690 | |
| 691 void setNeedsOverflowRecalcAfterStyleChange(); | 685 void setNeedsOverflowRecalcAfterStyleChange(); |
| 692 void markContainingBlocksForOverflowRecalc(); | 686 void markContainingBlocksForOverflowRecalc(); |
| 693 | 687 |
| 694 protected: | 688 protected: |
| 695 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time | 689 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time |
| 696 // this function will be called. | 690 // this function will be called. |
| 697 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); | 691 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); |
| 698 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first | 692 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first |
| 699 // time this function is called. | 693 // time this function is called. |
| 700 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 694 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 void showTree(const blink::RenderObject*); | 999 void showTree(const blink::RenderObject*); |
| 1006 void showLineTree(const blink::RenderObject*); | 1000 void showLineTree(const blink::RenderObject*); |
| 1007 void showRenderTree(const blink::RenderObject* object1); | 1001 void showRenderTree(const blink::RenderObject* object1); |
| 1008 // We don't make object2 an optional parameter so that showRenderTree | 1002 // We don't make object2 an optional parameter so that showRenderTree |
| 1009 // can be called from gdb easily. | 1003 // can be called from gdb easily. |
| 1010 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); | 1004 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); |
| 1011 | 1005 |
| 1012 #endif | 1006 #endif |
| 1013 | 1007 |
| 1014 #endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ | 1008 #endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ |
| OLD | NEW |