| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 LayoutObject* parent() const { return m_parent; } | 152 LayoutObject* parent() const { return m_parent; } |
| 153 bool isDescendantOf(const LayoutObject*) const; | 153 bool isDescendantOf(const LayoutObject*) const; |
| 154 | 154 |
| 155 LayoutObject* previousSibling() const { return m_previous; } | 155 LayoutObject* previousSibling() const { return m_previous; } |
| 156 LayoutObject* nextSibling() const { return m_next; } | 156 LayoutObject* nextSibling() const { return m_next; } |
| 157 | 157 |
| 158 LayoutObject* slowFirstChild() const | 158 LayoutObject* slowFirstChild() const |
| 159 { | 159 { |
| 160 if (const LayoutObjectChildList* children = virtualChildren()) | 160 if (const LayoutObjectChildList* children = virtualChildren()) |
| 161 return children->firstChild(); | 161 return children->firstChild(); |
| 162 return 0; | 162 return nullptr; |
| 163 } | 163 } |
| 164 LayoutObject* slowLastChild() const | 164 LayoutObject* slowLastChild() const |
| 165 { | 165 { |
| 166 if (const LayoutObjectChildList* children = virtualChildren()) | 166 if (const LayoutObjectChildList* children = virtualChildren()) |
| 167 return children->lastChild(); | 167 return children->lastChild(); |
| 168 return 0; | 168 return nullptr; |
| 169 } | 169 } |
| 170 | 170 |
| 171 virtual LayoutObjectChildList* virtualChildren() { return 0; } | 171 virtual LayoutObjectChildList* virtualChildren() { return nullptr; } |
| 172 virtual const LayoutObjectChildList* virtualChildren() const { return 0; } | 172 virtual const LayoutObjectChildList* virtualChildren() const { return nullpt
r; } |
| 173 | 173 |
| 174 LayoutObject* nextInPreOrder() const; | 174 LayoutObject* nextInPreOrder() const; |
| 175 LayoutObject* nextInPreOrder(const LayoutObject* stayWithin) const; | 175 LayoutObject* nextInPreOrder(const LayoutObject* stayWithin) const; |
| 176 LayoutObject* nextInPreOrderAfterChildren() const; | 176 LayoutObject* nextInPreOrderAfterChildren() const; |
| 177 LayoutObject* nextInPreOrderAfterChildren(const LayoutObject* stayWithin) co
nst; | 177 LayoutObject* nextInPreOrderAfterChildren(const LayoutObject* stayWithin) co
nst; |
| 178 LayoutObject* previousInPreOrder() const; | 178 LayoutObject* previousInPreOrder() const; |
| 179 LayoutObject* previousInPreOrder(const LayoutObject* stayWithin) const; | 179 LayoutObject* previousInPreOrder(const LayoutObject* stayWithin) const; |
| 180 LayoutObject* childAt(unsigned) const; | 180 LayoutObject* childAt(unsigned) const; |
| 181 | 181 |
| 182 LayoutObject* lastLeafChild() const; | 182 LayoutObject* lastLeafChild() const; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 197 LayoutBox* enclosingBox() const; | 197 LayoutBox* enclosingBox() const; |
| 198 LayoutBoxModelObject* enclosingBoxModelObject() const; | 198 LayoutBoxModelObject* enclosingBoxModelObject() const; |
| 199 | 199 |
| 200 LayoutBox* enclosingScrollableBox() const; | 200 LayoutBox* enclosingScrollableBox() const; |
| 201 | 201 |
| 202 // Function to return our enclosing flow thread if we are contained inside o
ne. This | 202 // Function to return our enclosing flow thread if we are contained inside o
ne. This |
| 203 // function follows the containing block chain. | 203 // function follows the containing block chain. |
| 204 LayoutFlowThread* flowThreadContainingBlock() const | 204 LayoutFlowThread* flowThreadContainingBlock() const |
| 205 { | 205 { |
| 206 if (!isInsideFlowThread()) | 206 if (!isInsideFlowThread()) |
| 207 return 0; | 207 return nullptr; |
| 208 return locateFlowThreadContainingBlock(); | 208 return locateFlowThreadContainingBlock(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 #if ENABLE(ASSERT) | 211 #if ENABLE(ASSERT) |
| 212 void setHasAXObject(bool flag) { m_hasAXObject = flag; } | 212 void setHasAXObject(bool flag) { m_hasAXObject = flag; } |
| 213 bool hasAXObject() const { return m_hasAXObject; } | 213 bool hasAXObject() const { return m_hasAXObject; } |
| 214 | 214 |
| 215 // Helper class forbidding calls to setNeedsLayout() during its lifetime. | 215 // Helper class forbidding calls to setNeedsLayout() during its lifetime. |
| 216 class SetLayoutNeededForbiddenScope { | 216 class SetLayoutNeededForbiddenScope { |
| 217 public: | 217 public: |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 | 263 |
| 264 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 264 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
| 265 // children. | 265 // children. |
| 266 virtual LayoutBlock* firstLineBlock() const; | 266 virtual LayoutBlock* firstLineBlock() const; |
| 267 | 267 |
| 268 // LayoutObject tree manipulation | 268 // LayoutObject tree manipulation |
| 269 ////////////////////////////////////////// | 269 ////////////////////////////////////////// |
| 270 virtual bool canHaveChildren() const { return virtualChildren(); } | 270 virtual bool canHaveChildren() const { return virtualChildren(); } |
| 271 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const { ret
urn true; } | 271 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const { ret
urn true; } |
| 272 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0)
; | 272 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nu
llptr); |
| 273 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } | 273 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild = nullptr) { return addChild(newChild, beforeChild); } |
| 274 virtual void removeChild(LayoutObject*); | 274 virtual void removeChild(LayoutObject*); |
| 275 virtual bool createsAnonymousWrapper() const { return false; } | 275 virtual bool createsAnonymousWrapper() const { return false; } |
| 276 ////////////////////////////////////////// | 276 ////////////////////////////////////////// |
| 277 | 277 |
| 278 protected: | 278 protected: |
| 279 ////////////////////////////////////////// | 279 ////////////////////////////////////////// |
| 280 // Helper functions. Dangerous to use! | 280 // Helper functions. Dangerous to use! |
| 281 void setPreviousSibling(LayoutObject* previous) { m_previous = previous; } | 281 void setPreviousSibling(LayoutObject* previous) { m_previous = previous; } |
| 282 void setNextSibling(LayoutObject* next) { m_next = next; } | 282 void setNextSibling(LayoutObject* next) { m_next = next; } |
| 283 void setParent(LayoutObject* parent) | 283 void setParent(LayoutObject* parent) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 311 public: | 311 public: |
| 312 #ifndef NDEBUG | 312 #ifndef NDEBUG |
| 313 void showTreeForThis() const; | 313 void showTreeForThis() const; |
| 314 void showLayoutTreeForThis() const; | 314 void showLayoutTreeForThis() const; |
| 315 void showLineTreeForThis() const; | 315 void showLineTreeForThis() const; |
| 316 | 316 |
| 317 void showLayoutObject() const; | 317 void showLayoutObject() const; |
| 318 // We don't make printedCharacters an optional parameter so that | 318 // We don't make printedCharacters an optional parameter so that |
| 319 // showLayoutObject can be called from gdb easily. | 319 // showLayoutObject can be called from gdb easily. |
| 320 void showLayoutObject(int printedCharacters) const; | 320 void showLayoutObject(int printedCharacters) const; |
| 321 void showLayoutTreeAndMark(const LayoutObject* markedObject1 = 0, const char
* markedLabel1 = 0, const LayoutObject* markedObject2 = 0, const char* markedLab
el2 = 0, int depth = 0) const; | 321 void showLayoutTreeAndMark(const LayoutObject* markedObject1 = nullptr, cons
t char* markedLabel1 = nullptr, const LayoutObject* markedObject2 = nullptr, con
st char* markedLabel2 = nullptr, int depth = 0) const; |
| 322 #endif | 322 #endif |
| 323 | 323 |
| 324 static LayoutObject* createObject(Element*, const ComputedStyle&); | 324 static LayoutObject* createObject(Element*, const ComputedStyle&); |
| 325 static unsigned instanceCount() { return s_instanceCount; } | 325 static unsigned instanceCount() { return s_instanceCount; } |
| 326 | 326 |
| 327 // LayoutObjects are allocated out of the rendering partition. | 327 // LayoutObjects are allocated out of the rendering partition. |
| 328 void* operator new(size_t); | 328 void* operator new(size_t); |
| 329 void operator delete(void*); | 329 void operator delete(void*); |
| 330 | 330 |
| 331 public: | 331 public: |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 // This function is kept in sync with anonymous block creation condition
s in | 498 // This function is kept in sync with anonymous block creation condition
s in |
| 499 // LayoutBlock::createAnonymousBlock(). This includes creating an anonym
ous | 499 // LayoutBlock::createAnonymousBlock(). This includes creating an anonym
ous |
| 500 // LayoutBlock having a BLOCK or BOX display. Other classes such as Layo
utTextFragment | 500 // LayoutBlock having a BLOCK or BOX display. Other classes such as Layo
utTextFragment |
| 501 // are not LayoutBlocks and will return false. See https://bugs.webkit.o
rg/show_bug.cgi?id=56709. | 501 // are not LayoutBlocks and will return false. See https://bugs.webkit.o
rg/show_bug.cgi?id=56709. |
| 502 return isAnonymous() && (style()->display() == BLOCK || style()->display
() == BOX) && style()->styleType() == NOPSEUDO && isLayoutBlock() && !isListMark
er() && !isLayoutFlowThread() && !isLayoutMultiColumnSet() | 502 return isAnonymous() && (style()->display() == BLOCK || style()->display
() == BOX) && style()->styleType() == NOPSEUDO && isLayoutBlock() && !isListMark
er() && !isLayoutFlowThread() && !isLayoutMultiColumnSet() |
| 503 && !isLayoutFullScreen() | 503 && !isLayoutFullScreen() |
| 504 && !isLayoutFullScreenPlaceholder(); | 504 && !isLayoutFullScreenPlaceholder(); |
| 505 } | 505 } |
| 506 bool isElementContinuation() const { return node() && node()->layoutObject()
!= this; } | 506 bool isElementContinuation() const { return node() && node()->layoutObject()
!= this; } |
| 507 bool isInlineElementContinuation() const { return isElementContinuation() &&
isInline(); } | 507 bool isInlineElementContinuation() const { return isElementContinuation() &&
isInline(); } |
| 508 virtual LayoutBoxModelObject* virtualContinuation() const { return 0; } | 508 virtual LayoutBoxModelObject* virtualContinuation() const { return nullptr;
} |
| 509 | 509 |
| 510 bool isFloating() const { return m_bitfields.floating(); } | 510 bool isFloating() const { return m_bitfields.floating(); } |
| 511 | 511 |
| 512 bool isOutOfFlowPositioned() const { return m_bitfields.isOutOfFlowPositione
d(); } // absolute or fixed positioning | 512 bool isOutOfFlowPositioned() const { return m_bitfields.isOutOfFlowPositione
d(); } // absolute or fixed positioning |
| 513 bool isRelPositioned() const { return m_bitfields.isRelPositioned(); } // re
lative positioning | 513 bool isRelPositioned() const { return m_bitfields.isRelPositioned(); } // re
lative positioning |
| 514 bool isPositioned() const { return m_bitfields.isPositioned(); } | 514 bool isPositioned() const { return m_bitfields.isPositioned(); } |
| 515 | 515 |
| 516 bool isText() const { return m_bitfields.isText(); } | 516 bool isText() const { return m_bitfields.isText(); } |
| 517 bool isBox() const { return m_bitfields.isBox(); } | 517 bool isBox() const { return m_bitfields.isBox(); } |
| 518 bool isInline() const { return m_bitfields.isInline(); } // inline object | 518 bool isInline() const { return m_bitfields.isInline(); } // inline object |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili
ty() == BackfaceVisibilityHidden; } | 578 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili
ty() == BackfaceVisibilityHidden; } |
| 579 | 579 |
| 580 bool hasFilter() const { return style() && style()->hasFilter(); } | 580 bool hasFilter() const { return style() && style()->hasFilter(); } |
| 581 | 581 |
| 582 bool hasShapeOutside() const { return style() && style()->shapeOutside(); } | 582 bool hasShapeOutside() const { return style() && style()->shapeOutside(); } |
| 583 | 583 |
| 584 inline bool preservesNewline() const; | 584 inline bool preservesNewline() const; |
| 585 | 585 |
| 586 // The pseudo element style can be cached or uncached. Use the cached metho
d if the pseudo element doesn't respect | 586 // The pseudo element style can be cached or uncached. Use the cached metho
d if the pseudo element doesn't respect |
| 587 // any pseudo classes (and therefore has no concept of changing state). | 587 // any pseudo classes (and therefore has no concept of changing state). |
| 588 ComputedStyle* getCachedPseudoStyle(PseudoId, const ComputedStyle* parentSty
le = 0) const; | 588 ComputedStyle* getCachedPseudoStyle(PseudoId, const ComputedStyle* parentSty
le = nullptr) const; |
| 589 PassRefPtr<ComputedStyle> getUncachedPseudoStyle(const PseudoStyleRequest&,
const ComputedStyle* parentStyle = 0, const ComputedStyle* ownStyle = 0) const; | 589 PassRefPtr<ComputedStyle> getUncachedPseudoStyle(const PseudoStyleRequest&,
const ComputedStyle* parentStyle = nullptr, const ComputedStyle* ownStyle = null
ptr) const; |
| 590 | 590 |
| 591 virtual void updateDragState(bool dragOn); | 591 virtual void updateDragState(bool dragOn); |
| 592 | 592 |
| 593 LayoutView* view() const { return document().layoutView(); }; | 593 LayoutView* view() const { return document().layoutView(); }; |
| 594 FrameView* frameView() const { return document().view(); }; | 594 FrameView* frameView() const { return document().view(); }; |
| 595 | 595 |
| 596 bool isRooted() const; | 596 bool isRooted() const; |
| 597 | 597 |
| 598 Node* node() const | 598 Node* node() const |
| 599 { | 599 { |
| 600 return isAnonymous() ? 0 : m_node; | 600 return isAnonymous() ? 0 : m_node; |
| 601 } | 601 } |
| 602 | 602 |
| 603 Node* nonPseudoNode() const | 603 Node* nonPseudoNode() const |
| 604 { | 604 { |
| 605 return isPseudoElement() ? 0 : node(); | 605 return isPseudoElement() ? 0 : node(); |
| 606 } | 606 } |
| 607 | 607 |
| 608 void clearNode() { m_node = nullptr; } | 608 void clearNode() { m_node = nullptr; } |
| 609 | 609 |
| 610 // Returns the styled node that caused the generation of this layoutObject. | 610 // Returns the styled node that caused the generation of this layoutObject. |
| 611 // This is the same as node() except for layoutObjects of :before, :after an
d | 611 // This is the same as node() except for layoutObjects of :before, :after an
d |
| 612 // :first-letter pseudo elements for which their parent node is returned. | 612 // :first-letter pseudo elements for which their parent node is returned. |
| 613 Node* generatingNode() const { return isPseudoElement() ? node()->parentOrSh
adowHostNode() : node(); } | 613 Node* generatingNode() const { return isPseudoElement() ? node()->parentOrSh
adowHostNode() : node(); } |
| 614 | 614 |
| 615 Document& document() const { return m_node->document(); } | 615 Document& document() const { return m_node->document(); } |
| 616 LocalFrame* frame() const { return document().frame(); } | 616 LocalFrame* frame() const { return document().frame(); } |
| 617 | 617 |
| 618 virtual LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re
turn 0; } | 618 virtual LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re
turn nullptr; } |
| 619 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll
&& spannerPlaceholder(); } | 619 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll
&& spannerPlaceholder(); } |
| 620 | 620 |
| 621 // Returns the object containing this one. Can be different from parent for
positioned elements. | 621 // Returns the object containing this one. Can be different from parent for
positioned elements. |
| 622 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped | 622 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped |
| 623 // is true if the layoutObject returned is an ancestor of paintInvalidationC
ontainer. | 623 // is true if the layoutObject returned is an ancestor of paintInvalidationC
ontainer. |
| 624 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain
er = 0, bool* paintInvalidationContainerSkipped = 0) const; | 624 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain
er = nullptr, bool* paintInvalidationContainerSkipped = nullptr) const; |
| 625 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva
lidationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const; | 625 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva
lidationContainer = nullptr, bool* paintInvalidationContainerSkipped = nullptr)
const; |
| 626 | 626 |
| 627 virtual LayoutObject* hoverAncestor() const { return parent(); } | 627 virtual LayoutObject* hoverAncestor() const { return parent(); } |
| 628 | 628 |
| 629 Element* offsetParent() const; | 629 Element* offsetParent() const; |
| 630 | 630 |
| 631 void markContainerChainForLayout(bool scheduleRelayout = true, LayoutObject*
newRoot = 0, SubtreeLayoutScope* = 0); | 631 void markContainerChainForLayout(bool scheduleRelayout = true, LayoutObject*
newRoot = nullptr, SubtreeLayoutScope* = nullptr); |
| 632 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma
rkContainerChain, SubtreeLayoutScope* = 0); | 632 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma
rkContainerChain, SubtreeLayoutScope* = nullptr); |
| 633 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci
ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = 0); | 633 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci
ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = nullptr); |
| 634 void clearNeedsLayout(); | 634 void clearNeedsLayout(); |
| 635 void setChildNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayout
Scope* = 0); | 635 void setChildNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayout
Scope* = nullptr); |
| 636 void setNeedsPositionedMovementLayout(); | 636 void setNeedsPositionedMovementLayout(); |
| 637 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainerChain); | 637 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainerChain); |
| 638 void clearPreferredLogicalWidthsDirty(); | 638 void clearPreferredLogicalWidthsDirty(); |
| 639 | 639 |
| 640 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re
ason) | 640 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re
ason) |
| 641 { | 641 { |
| 642 setNeedsLayout(reason); | 642 setNeedsLayout(reason); |
| 643 setPreferredLogicalWidthsDirty(); | 643 setPreferredLogicalWidthsDirty(); |
| 644 } | 644 } |
| 645 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalid
ationReasonForTracing reason) | 645 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalid
ationReasonForTracing reason) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 { | 744 { |
| 745 return isLayoutView() || (hasTransformRelatedProperty() && isLayoutBlock
()) || isSVGForeignObject(); | 745 return isLayoutView() || (hasTransformRelatedProperty() && isLayoutBlock
()) || isSVGForeignObject(); |
| 746 } | 746 } |
| 747 | 747 |
| 748 // Convert the given local point to absolute coordinates | 748 // Convert the given local point to absolute coordinates |
| 749 // FIXME: Temporary. If UseTransforms is true, take transforms into account.
Eventually localToAbsolute() will always be transform-aware. | 749 // FIXME: Temporary. If UseTransforms is true, take transforms into account.
Eventually localToAbsolute() will always be transform-aware. |
| 750 FloatPoint localToAbsolute(const FloatPoint& localPoint = FloatPoint(), MapC
oordinatesFlags = 0) const; | 750 FloatPoint localToAbsolute(const FloatPoint& localPoint = FloatPoint(), MapC
oordinatesFlags = 0) const; |
| 751 FloatPoint absoluteToLocal(const FloatPoint&, MapCoordinatesFlags = 0) const
; | 751 FloatPoint absoluteToLocal(const FloatPoint&, MapCoordinatesFlags = 0) const
; |
| 752 | 752 |
| 753 // Convert a local quad to absolute coordinates, taking transforms into acco
unt. | 753 // Convert a local quad to absolute coordinates, taking transforms into acco
unt. |
| 754 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0, bool* wasFixed = 0) const | 754 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod
e = 0, bool* wasFixed = nullptr) const |
| 755 { | 755 { |
| 756 return localToContainerQuad(quad, 0, mode, wasFixed); | 756 return localToContainerQuad(quad, 0, mode, wasFixed); |
| 757 } | 757 } |
| 758 // Convert an absolute quad to local coordinates. | 758 // Convert an absolute quad to local coordinates. |
| 759 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0
) const; | 759 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0
) const; |
| 760 | 760 |
| 761 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. | 761 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. |
| 762 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutBoxModelObject*
paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const; | 762 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutBoxModelObject*
paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = nullptr)
const; |
| 763 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutBoxModelObje
ct* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, con
st PaintInvalidationState* = 0) const; | 763 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutBoxModelObje
ct* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = nullpt
r, const PaintInvalidationState* = nullptr) const; |
| 764 | 764 |
| 765 // Convert a local point into the coordinate system of backing coordinates.
Also returns the backing layer if needed. | 765 // Convert a local point into the coordinate system of backing coordinates.
Also returns the backing layer if needed. |
| 766 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, DeprecatedPai
ntLayer** backingLayer = nullptr); | 766 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, DeprecatedPai
ntLayer** backingLayer = nullptr); |
| 767 | 767 |
| 768 // Return the offset from the container() layoutObject (excluding transforms
). In multi-column layout, | 768 // Return the offset from the container() layoutObject (excluding transforms
). In multi-column layout, |
| 769 // different offsets apply at different points, so return the offset that ap
plies to the given point. | 769 // different offsets apply at different points, so return the offset that ap
plies to the given point. |
| 770 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const; | 770 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = nullptr) const; |
| 771 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. | 771 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. |
| 772 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const; | 772 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const; |
| 773 | 773 |
| 774 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } | 774 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } |
| 775 | 775 |
| 776 FloatRect absoluteBoundingBoxFloatRect() const; | 776 FloatRect absoluteBoundingBoxFloatRect() const; |
| 777 // This returns an IntRect enclosing this object. If this object has an | 777 // This returns an IntRect enclosing this object. If this object has an |
| 778 // integral size and the position has fractional values, the resultant | 778 // integral size and the position has fractional values, the resultant |
| 779 // IntRect can be larger than the integral size. | 779 // IntRect can be larger than the integral size. |
| 780 IntRect absoluteBoundingBoxRect() const; | 780 IntRect absoluteBoundingBoxRect() const; |
| 781 // FIXME: This function should go away eventually | 781 // FIXME: This function should go away eventually |
| 782 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; | 782 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; |
| 783 | 783 |
| 784 // Build an array of quads in absolute coords for line boxes | 784 // Build an array of quads in absolute coords for line boxes |
| 785 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } | 785 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /* wasFixed */ = nullpt
r) const { } |
| 786 | 786 |
| 787 virtual IntRect absoluteFocusRingBoundingBoxRect() const; | 787 virtual IntRect absoluteFocusRingBoundingBoxRect() const; |
| 788 | 788 |
| 789 static FloatRect absoluteBoundingBoxRectForRange(const Range*); | 789 static FloatRect absoluteBoundingBoxRectForRange(const Range*); |
| 790 | 790 |
| 791 // the rect that will be painted if this object is passed as the paintingRoo
t | 791 // the rect that will be painted if this object is passed as the paintingRoo
t |
| 792 IntRect paintingRootRect(IntRect& topLevelRect); | 792 IntRect paintingRootRect(IntRect& topLevelRect); |
| 793 | 793 |
| 794 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } | 794 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } |
| 795 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } | 795 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 | 843 |
| 844 const LayoutBoxModelObject* adjustCompositedContainerForSpecialAncestors(con
st LayoutBoxModelObject* paintInvalidationContainer) const; | 844 const LayoutBoxModelObject* adjustCompositedContainerForSpecialAncestors(con
st LayoutBoxModelObject* paintInvalidationContainer) const; |
| 845 bool isPaintInvalidationContainer() const; | 845 bool isPaintInvalidationContainer() const; |
| 846 | 846 |
| 847 LayoutRect computePaintInvalidationRect() | 847 LayoutRect computePaintInvalidationRect() |
| 848 { | 848 { |
| 849 return computePaintInvalidationRect(containerForPaintInvalidation()); | 849 return computePaintInvalidationRect(containerForPaintInvalidation()); |
| 850 } | 850 } |
| 851 | 851 |
| 852 // Returns the paint invalidation rect for this LayoutObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. | 852 // Returns the paint invalidation rect for this LayoutObject in the coordina
te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation
Container|. |
| 853 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv
alidationContainer, const PaintInvalidationState* = 0) const; | 853 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv
alidationContainer, const PaintInvalidationState* = nullptr) const; |
| 854 | 854 |
| 855 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the layoutObject backing of |paintInvalidationContainer
| | 855 // Returns the rect bounds needed to invalidate the paint of this object, in
the coordinate space of the layoutObject backing of |paintInvalidationContainer
| |
| 856 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = 0) const; | 856 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI
nvalidationContainer, const PaintInvalidationState* = nullptr) const; |
| 857 | 857 |
| 858 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space | 858 // Actually do the paint invalidate of rect r for this object which has been
computed in the coordinate space |
| 859 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same | 859 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t
his coordinaten space is not the same |
| 860 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. | 860 // as the local coordinate space of |paintInvalidationContainer| in the pres
ence of layer squashing. |
| 861 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida
tionContainer, const LayoutRect&, PaintInvalidationReason) const; | 861 void invalidatePaintUsingContainer(const LayoutBoxModelObject& paintInvalida
tionContainer, const LayoutRect&, PaintInvalidationReason) const; |
| 862 | 862 |
| 863 // Invalidate the paint of a specific subrectangle within a given object. Th
e rect |r| is in the object's coordinate space. | 863 // Invalidate the paint of a specific subrectangle within a given object. Th
e rect |r| is in the object's coordinate space. |
| 864 void invalidatePaintRectangle(const LayoutRect&) const; | 864 void invalidatePaintRectangle(const LayoutRect&) const; |
| 865 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR
ect& r) const { invalidatePaintRectangleInternal(r); } | 865 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR
ect& r) const { invalidatePaintRectangleInternal(r); } |
| 866 | 866 |
| 867 // Walk the tree after layout issuing paint invalidations for layoutObjects
that have changed or moved, updating bounds that have changed, and clearing pain
t invalidation state. | 867 // Walk the tree after layout issuing paint invalidations for layoutObjects
that have changed or moved, updating bounds that have changed, and clearing pain
t invalidation state. |
| 868 virtual void invalidateTreeIfNeeded(PaintInvalidationState&); | 868 virtual void invalidateTreeIfNeeded(PaintInvalidationState&); |
| 869 | 869 |
| 870 virtual void invalidatePaintForOverflow(); | 870 virtual void invalidatePaintForOverflow(); |
| 871 void invalidatePaintForOverflowIfNeeded(); | 871 void invalidatePaintForOverflowIfNeeded(); |
| 872 | 872 |
| 873 void invalidatePaintIncludingNonCompositingDescendants(); | 873 void invalidatePaintIncludingNonCompositingDescendants(); |
| 874 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); | 874 void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(); |
| 875 | 875 |
| 876 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's | 876 // Returns the rect that should have paint invalidated whenever this object
changes. The rect is in the view's |
| 877 // coordinate space. This method deals with outlines and overflow. | 877 // coordinate space. This method deals with outlines and overflow. |
| 878 virtual LayoutRect absoluteClippedOverflowRect() const; | 878 virtual LayoutRect absoluteClippedOverflowRect() const; |
| 879 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo
delObject* paintInvalidationContainer, const PaintInvalidationState* = 0) const; | 879 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxMo
delObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr)
const; |
| 880 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO
bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat
ionState* = 0) const; | 880 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO
bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat
ionState* = nullptr) const; |
| 881 | 881 |
| 882 // Given a rect in the object's coordinate space, compute a rect suitable fo
r invalidating paints of | 882 // Given a rect in the object's coordinate space, compute a rect suitable fo
r invalidating paints of |
| 883 // that rect in the coordinate space of paintInvalidationContainer. | 883 // that rect in the coordinate space of paintInvalidationContainer. |
| 884 virtual void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* p
aintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const; | 884 virtual void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* p
aintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const; |
| 885 | 885 |
| 886 // Return the offset to the column in which the specified point (in flow-thr
ead coordinates) | 886 // Return the offset to the column in which the specified point (in flow-thr
ead coordinates) |
| 887 // lives. This is used to convert a flow-thread point to a visual point. | 887 // lives. This is used to convert a flow-thread point to a visual point. |
| 888 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz
e(); } | 888 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz
e(); } |
| 889 | 889 |
| 890 virtual unsigned length() const { return 1; } | 890 virtual unsigned length() const { return 1; } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 | 929 |
| 930 // Whether or not a given block needs to paint selection gaps. | 930 // Whether or not a given block needs to paint selection gaps. |
| 931 virtual bool shouldPaintSelectionGaps() const { return false; } | 931 virtual bool shouldPaintSelectionGaps() const { return false; } |
| 932 | 932 |
| 933 /** | 933 /** |
| 934 * Returns the local coordinates of the caret within this layout object. | 934 * Returns the local coordinates of the caret within this layout object. |
| 935 * @param caretOffset zero-based offset determining position within the layo
ut object. | 935 * @param caretOffset zero-based offset determining position within the layo
ut object. |
| 936 * @param extraWidthToEndOfLine optional out arg to give extra width to end
of line - | 936 * @param extraWidthToEndOfLine optional out arg to give extra width to end
of line - |
| 937 * useful for character range rect computations | 937 * useful for character range rect computations |
| 938 */ | 938 */ |
| 939 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0); | 939 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = nullptr); |
| 940 | 940 |
| 941 // When performing a global document tear-down, the layoutObject of the docu
ment is cleared. We use this | 941 // When performing a global document tear-down, the layoutObject of the docu
ment is cleared. We use this |
| 942 // as a hook to detect the case of document destruction and don't waste time
doing unnecessary work. | 942 // as a hook to detect the case of document destruction and don't waste time
doing unnecessary work. |
| 943 bool documentBeingDestroyed() const; | 943 bool documentBeingDestroyed() const; |
| 944 | 944 |
| 945 void destroyAndCleanupAnonymousWrappers(); | 945 void destroyAndCleanupAnonymousWrappers(); |
| 946 | 946 |
| 947 // While the destroy() method is virtual, this should only be overriden in v
ery rare circumstances. | 947 // While the destroy() method is virtual, this should only be overriden in v
ery rare circumstances. |
| 948 // You want to override willBeDestroyed() instead unless you explicitly need
to stop this object | 948 // You want to override willBeDestroyed() instead unless you explicitly need
to stop this object |
| 949 // from being destroyed (for example, LayoutPart overrides destroy() for thi
s purpose). | 949 // from being destroyed (for example, LayoutPart overrides destroy() for thi
s purpose). |
| (...skipping 12 matching lines...) Expand all Loading... |
| 962 | 962 |
| 963 virtual bool isCombineText() const { return false; } | 963 virtual bool isCombineText() const { return false; } |
| 964 | 964 |
| 965 virtual int caretMinOffset() const; | 965 virtual int caretMinOffset() const; |
| 966 virtual int caretMaxOffset() const; | 966 virtual int caretMaxOffset() const; |
| 967 | 967 |
| 968 virtual int previousOffset(int current) const; | 968 virtual int previousOffset(int current) const; |
| 969 virtual int previousOffsetForBackwardDeletion(int current) const; | 969 virtual int previousOffsetForBackwardDeletion(int current) const; |
| 970 virtual int nextOffset(int current) const; | 970 virtual int nextOffset(int current) const; |
| 971 | 971 |
| 972 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; | 972 virtual void imageChanged(ImageResource*, const IntRect* = nullptr) override
final; |
| 973 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } | 973 virtual void imageChanged(WrappedImagePtr, const IntRect* = nullptr) { } |
| 974 virtual bool willRenderImage(ImageResource*) override final; | 974 virtual bool willRenderImage(ImageResource*) override final; |
| 975 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; | 975 virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&)
override final; |
| 976 | 976 |
| 977 void selectionStartEnd(int& spos, int& epos) const; | 977 void selectionStartEnd(int& spos, int& epos) const; |
| 978 | 978 |
| 979 void remove() | 979 void remove() |
| 980 { | 980 { |
| 981 if (parent()) | 981 if (parent()) |
| 982 parent()->removeChild(this); | 982 parent()->removeChild(this); |
| 983 } | 983 } |
| 984 | 984 |
| 985 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } | 985 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } |
| 986 | 986 |
| 987 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } | 987 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } |
| 988 | 988 |
| 989 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use | 989 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use |
| 990 // localToAbsolute/absoluteToLocal methods instead. | 990 // localToAbsolute/absoluteToLocal methods instead. |
| 991 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati
onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa
sFixed = 0, const PaintInvalidationState* = 0) const; | 991 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati
onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa
sFixed = nullptr, const PaintInvalidationState* = nullptr) const; |
| 992 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; | 992 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; |
| 993 | 993 |
| 994 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi
s layoutObject to its container, or ancestorToStopAt (whichever is encountered f
irst). | 994 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi
s layoutObject to its container, or ancestorToStopAt (whichever is encountered f
irst). |
| 995 // Returns the layoutObject which was mapped to (container or ancestorToStop
At). | 995 // Returns the layoutObject which was mapped to (container or ancestorToStop
At). |
| 996 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap&) const; | 996 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec
t* ancestorToStopAt, LayoutGeometryMap&) const; |
| 997 | 997 |
| 998 bool shouldUseTransformFromContainer(const LayoutObject* container) const; | 998 bool shouldUseTransformFromContainer(const LayoutObject* container) const; |
| 999 void getTransformFromContainer(const LayoutObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; | 999 void getTransformFromContainer(const LayoutObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; |
| 1000 | 1000 |
| 1001 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || style()->hasBlendMode(); } | 1001 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || style()->hasBlendMode(); } |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 void showTree(const blink::LayoutObject*); | 1663 void showTree(const blink::LayoutObject*); |
| 1664 void showLineTree(const blink::LayoutObject*); | 1664 void showLineTree(const blink::LayoutObject*); |
| 1665 void showLayoutTree(const blink::LayoutObject* object1); | 1665 void showLayoutTree(const blink::LayoutObject* object1); |
| 1666 // We don't make object2 an optional parameter so that showLayoutTree | 1666 // We don't make object2 an optional parameter so that showLayoutTree |
| 1667 // can be called from gdb easily. | 1667 // can be called from gdb easily. |
| 1668 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); | 1668 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
| 1669 | 1669 |
| 1670 #endif | 1670 #endif |
| 1671 | 1671 |
| 1672 #endif // LayoutObject_h | 1672 #endif // LayoutObject_h |
| OLD | NEW |