Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: Source/core/layout/LayoutObject.h

Issue 1095043003: Convert LayoutObject renderer names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutMenuList.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 LayoutRect bounds; 117 LayoutRect bounds;
118 bool draggable; 118 bool draggable;
119 }; 119 };
120 120
121 typedef WTF::HashMap<const DeprecatedPaintLayer*, Vector<LayoutRect>> LayerHitTe stRects; 121 typedef WTF::HashMap<const DeprecatedPaintLayer*, Vector<LayoutRect>> LayerHitTe stRects;
122 122
123 #ifndef NDEBUG 123 #ifndef NDEBUG
124 const int showTreeCharacterOffset = 39; 124 const int showTreeCharacterOffset = 39;
125 #endif 125 #endif
126 126
127 // Base class for all rendering tree objects. 127 // Base class for all layout tree objects.
128 class CORE_EXPORT LayoutObject : public ImageResourceClient { 128 class CORE_EXPORT LayoutObject : public ImageResourceClient {
129 friend class LayoutBlock; 129 friend class LayoutBlock;
130 friend class LayoutBlockFlow; 130 friend class LayoutBlockFlow;
131 friend class DeprecatedPaintLayerReflectionInfo; // For setParent 131 friend class DeprecatedPaintLayerReflectionInfo; // For setParent
132 friend class DeprecatedPaintLayerScrollableArea; // For setParent. 132 friend class DeprecatedPaintLayerScrollableArea; // For setParent.
133 friend class LayoutObjectChildList; 133 friend class LayoutObjectChildList;
134 WTF_MAKE_NONCOPYABLE(LayoutObject); 134 WTF_MAKE_NONCOPYABLE(LayoutObject);
135 public: 135 public:
136 // Anonymous objects should pass the document as their node, and they will t hen automatically be 136 // Anonymous objects should pass the document as their node, and they will t hen automatically be
137 // marked as anonymous in the constructor. 137 // marked as anonymous in the constructor.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 LayoutObject* nextInPreOrder() const; 175 LayoutObject* nextInPreOrder() const;
176 LayoutObject* nextInPreOrder(const LayoutObject* stayWithin) const; 176 LayoutObject* nextInPreOrder(const LayoutObject* stayWithin) const;
177 LayoutObject* nextInPreOrderAfterChildren() const; 177 LayoutObject* nextInPreOrderAfterChildren() const;
178 LayoutObject* nextInPreOrderAfterChildren(const LayoutObject* stayWithin) co nst; 178 LayoutObject* nextInPreOrderAfterChildren(const LayoutObject* stayWithin) co nst;
179 LayoutObject* previousInPreOrder() const; 179 LayoutObject* previousInPreOrder() const;
180 LayoutObject* previousInPreOrder(const LayoutObject* stayWithin) const; 180 LayoutObject* previousInPreOrder(const LayoutObject* stayWithin) const;
181 LayoutObject* childAt(unsigned) const; 181 LayoutObject* childAt(unsigned) const;
182 182
183 LayoutObject* lastLeafChild() const; 183 LayoutObject* lastLeafChild() const;
184 184
185 // The following six functions are used when the render tree hierarchy chang es to make sure layers get 185 // The following six functions are used when the layout tree hierarchy chang es to make sure layers get
186 // properly added and removed. Since containership can be implemented by an y subclass, and since a hierarchy 186 // properly added and removed. Since containership can be implemented by an y subclass, and since a hierarchy
187 // can contain a mixture of boxes and other object types, these functions ne ed to be in the base class. 187 // can contain a mixture of boxes and other object types, these functions ne ed to be in the base class.
188 DeprecatedPaintLayer* enclosingLayer() const; 188 DeprecatedPaintLayer* enclosingLayer() const;
189 void addLayers(DeprecatedPaintLayer* parentLayer); 189 void addLayers(DeprecatedPaintLayer* parentLayer);
190 void removeLayers(DeprecatedPaintLayer* parentLayer); 190 void removeLayers(DeprecatedPaintLayer* parentLayer);
191 void moveLayers(DeprecatedPaintLayer* oldParent, DeprecatedPaintLayer* newPa rent); 191 void moveLayers(DeprecatedPaintLayer* oldParent, DeprecatedPaintLayer* newPa rent);
192 DeprecatedPaintLayer* findNextLayer(DeprecatedPaintLayer* parentLayer, Layou tObject* startPoint, bool checkParent = true); 192 DeprecatedPaintLayer* findNextLayer(DeprecatedPaintLayer* parentLayer, Layou tObject* startPoint, bool checkParent = true);
193 193
194 // Scrolling is a LayoutBox concept, however some code just cares about recu rsively scrolling our enclosing ScrollableArea(s). 194 // Scrolling is a LayoutBox concept, however some code just cares about recu rsively scrolling our enclosing ScrollableArea(s).
195 bool scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlig nment::alignCenterIfNeeded); 195 bool scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlig nment::alignCenterIfNeeded);
(...skipping 20 matching lines...) Expand all
216 // Helper class forbidding calls to setNeedsLayout() during its lifetime. 216 // Helper class forbidding calls to setNeedsLayout() during its lifetime.
217 class SetLayoutNeededForbiddenScope { 217 class SetLayoutNeededForbiddenScope {
218 public: 218 public:
219 explicit SetLayoutNeededForbiddenScope(LayoutObject&); 219 explicit SetLayoutNeededForbiddenScope(LayoutObject&);
220 ~SetLayoutNeededForbiddenScope(); 220 ~SetLayoutNeededForbiddenScope();
221 private: 221 private:
222 LayoutObject& m_layoutObject; 222 LayoutObject& m_layoutObject;
223 bool m_preexistingForbidden; 223 bool m_preexistingForbidden;
224 }; 224 };
225 225
226 void assertRendererLaidOut() const 226 void assertLaidOut() const
227 { 227 {
228 #ifndef NDEBUG 228 #ifndef NDEBUG
229 if (needsLayout()) 229 if (needsLayout())
230 showLayoutTreeForThis(); 230 showLayoutTreeForThis();
231 #endif 231 #endif
232 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); 232 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout());
233 } 233 }
234 234
235 void assertSubtreeIsLaidOut() const 235 void assertSubtreeIsLaidOut() const
236 { 236 {
237 for (const LayoutObject* renderer = this; renderer; renderer = renderer- >nextInPreOrder()) 237 for (const LayoutObject* layoutObject = this; layoutObject; layoutObject = layoutObject->nextInPreOrder())
238 renderer->assertRendererLaidOut(); 238 layoutObject->assertLaidOut();
239 } 239 }
240 240
241 void assertRendererClearedPaintInvalidationState() const 241 void assertClearedPaintInvalidationState() const
242 { 242 {
243 #ifndef NDEBUG 243 #ifndef NDEBUG
244 if (paintInvalidationStateIsDirty()) { 244 if (paintInvalidationStateIsDirty()) {
245 showLayoutTreeForThis(); 245 showLayoutTreeForThis();
246 ASSERT_NOT_REACHED(); 246 ASSERT_NOT_REACHED();
247 } 247 }
248 #endif 248 #endif
249 } 249 }
250 250
251 void assertSubtreeClearedPaintInvalidationState() const 251 void assertSubtreeClearedPaintInvalidationState() const
252 { 252 {
253 for (const LayoutObject* renderer = this; renderer; renderer = renderer- >nextInPreOrder()) 253 for (const LayoutObject* layoutObject = this; layoutObject; layoutObject = layoutObject->nextInPreOrder())
254 renderer->assertRendererClearedPaintInvalidationState(); 254 layoutObject->assertClearedPaintInvalidationState();
255 } 255 }
256 256
257 #endif 257 #endif
258 258
259 // Correct version of !rendererHasNoBoxEffectObsolete(). 259 // Correct version of !layoutObjectHasNoBoxEffectObsolete().
260 bool hasBoxEffect() const 260 bool hasBoxEffect() const
261 { 261 {
262 return hasBoxDecorationBackground() || style()->hasVisualOverflowingEffe ct(); 262 return hasBoxDecorationBackground() || style()->hasVisualOverflowingEffe ct();
263 } 263 }
264 264
265 // Obtains the nearest enclosing block (including this block) that contribut es a first-line style to our inline 265 // Obtains the nearest enclosing block (including this block) that contribut es a first-line style to our inline
266 // children. 266 // children.
267 virtual LayoutBlock* firstLineBlock() const; 267 virtual LayoutBlock* firstLineBlock() const;
268 268
269 // LayoutObject tree manipulation 269 // LayoutObject tree manipulation
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 NotInsideFlowThread = 0, 435 NotInsideFlowThread = 0,
436 InsideOutOfFlowThread = 1, 436 InsideOutOfFlowThread = 1,
437 InsideInFlowThread = 2, 437 InsideInFlowThread = 2,
438 }; 438 };
439 439
440 void setFlowThreadStateIncludingDescendants(FlowThreadState); 440 void setFlowThreadStateIncludingDescendants(FlowThreadState);
441 441
442 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState (); } 442 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState (); }
443 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt ate(state); } 443 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt ate(state); }
444 444
445 // FIXME: Until all SVG renders can be subclasses of LayoutSVGModelObject we have 445 // FIXME: Until all SVG layoutObjects can be subclasses of LayoutSVGModelObj ect we have
446 // to add SVG renderer methods to LayoutObject with an ASSERT_NOT_REACHED() default implementation. 446 // to add SVG layoutObject methods to LayoutObject with an ASSERT_NOT_REACHE D() default implementation.
447 bool isSVG() const { return isOfType(LayoutObjectSVG); } 447 bool isSVG() const { return isOfType(LayoutObjectSVG); }
448 bool isSVGRoot() const { return isOfType(LayoutObjectSVGRoot); } 448 bool isSVGRoot() const { return isOfType(LayoutObjectSVGRoot); }
449 bool isSVGContainer() const { return isOfType(LayoutObjectSVGContainer); } 449 bool isSVGContainer() const { return isOfType(LayoutObjectSVGContainer); }
450 bool isSVGTransformableContainer() const { return isOfType(LayoutObjectSVGTr ansformableContainer); } 450 bool isSVGTransformableContainer() const { return isOfType(LayoutObjectSVGTr ansformableContainer); }
451 bool isSVGViewportContainer() const { return isOfType(LayoutObjectSVGViewpor tContainer); } 451 bool isSVGViewportContainer() const { return isOfType(LayoutObjectSVGViewpor tContainer); }
452 bool isSVGGradientStop() const { return isOfType(LayoutObjectSVGGradientStop ); } 452 bool isSVGGradientStop() const { return isOfType(LayoutObjectSVGGradientStop ); }
453 bool isSVGHiddenContainer() const { return isOfType(LayoutObjectSVGHiddenCon tainer); } 453 bool isSVGHiddenContainer() const { return isOfType(LayoutObjectSVGHiddenCon tainer); }
454 bool isSVGShape() const { return isOfType(LayoutObjectSVGShape); } 454 bool isSVGShape() const { return isOfType(LayoutObjectSVGShape); }
455 bool isSVGText() const { return isOfType(LayoutObjectSVGText); } 455 bool isSVGText() const { return isOfType(LayoutObjectSVGText); }
456 bool isSVGTextPath() const { return isOfType(LayoutObjectSVGTextPath); } 456 bool isSVGTextPath() const { return isOfType(LayoutObjectSVGTextPath); }
457 bool isSVGInline() const { return isOfType(LayoutObjectSVGInline); } 457 bool isSVGInline() const { return isOfType(LayoutObjectSVGInline); }
458 bool isSVGInlineText() const { return isOfType(LayoutObjectSVGInlineText); } 458 bool isSVGInlineText() const { return isOfType(LayoutObjectSVGInlineText); }
459 bool isSVGImage() const { return isOfType(LayoutObjectSVGImage); } 459 bool isSVGImage() const { return isOfType(LayoutObjectSVGImage); }
460 bool isSVGForeignObject() const { return isOfType(LayoutObjectSVGForeignObje ct); } 460 bool isSVGForeignObject() const { return isOfType(LayoutObjectSVGForeignObje ct); }
461 bool isSVGResourceContainer() const { return isOfType(LayoutObjectSVGResourc eContainer); } 461 bool isSVGResourceContainer() const { return isOfType(LayoutObjectSVGResourc eContainer); }
462 bool isSVGResourceFilter() const { return isOfType(LayoutObjectSVGResourceFi lter); } 462 bool isSVGResourceFilter() const { return isOfType(LayoutObjectSVGResourceFi lter); }
463 bool isSVGResourceFilterPrimitive() const { return isOfType(LayoutObjectSVGR esourceFilterPrimitive); } 463 bool isSVGResourceFilterPrimitive() const { return isOfType(LayoutObjectSVGR esourceFilterPrimitive); }
464 464
465 // FIXME: Those belong into a SVG specific base-class for all renderers (see above) 465 // FIXME: Those belong into a SVG specific base-class for all layoutObjects (see above)
466 // Unfortunately we don't have such a class yet, because it's not possible f or all renderers 466 // Unfortunately we don't have such a class yet, because it's not possible f or all layoutObjects
467 // to inherit from LayoutSVGObject -> LayoutObject (some need LayoutBlock in heritance for instance) 467 // to inherit from LayoutSVGObject -> LayoutObject (some need LayoutBlock in heritance for instance)
468 virtual void setNeedsTransformUpdate() { } 468 virtual void setNeedsTransformUpdate() { }
469 virtual void setNeedsBoundariesUpdate(); 469 virtual void setNeedsBoundariesUpdate();
470 470
471 bool isBlendingAllowed() const { return !isSVG() || (isSVGContainer() && !is SVGHiddenContainer()) || isSVGShape() || isSVGImage() || isSVGText(); } 471 bool isBlendingAllowed() const { return !isSVG() || (isSVGContainer() && !is SVGHiddenContainer()) || isSVGShape() || isSVGImage() || isSVGText(); }
472 virtual bool hasNonIsolatedBlendingDescendants() const { return false; } 472 virtual bool hasNonIsolatedBlendingDescendants() const { return false; }
473 enum DescendantIsolationState { 473 enum DescendantIsolationState {
474 DescendantIsolationRequired, 474 DescendantIsolationRequired,
475 DescendantIsolationNeedsUpdate, 475 DescendantIsolationNeedsUpdate,
476 }; 476 };
477 virtual void descendantIsolationRequirementsChanged(DescendantIsolationState ) { } 477 virtual void descendantIsolationRequirementsChanged(DescendantIsolationState ) { }
478 478
479 // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects, opacity and stroke-width. 479 // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects, opacity and stroke-width.
480 // This is used for all computation of objectBoundingBox relative units and by SVGLocatable::getBBox(). 480 // This is used for all computation of objectBoundingBox relative units and by SVGLocatable::getBBox().
481 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we i gnore them 481 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we i gnore them
482 // since stroke-width is ignored (and marker size can depend on stroke-width ). 482 // since stroke-width is ignored (and marker size can depend on stroke-width ).
483 // objectBoundingBox is returned local coordinates. 483 // objectBoundingBox is returned local coordinates.
484 // The name objectBoundingBox is taken from the SVG 1.1 spec. 484 // The name objectBoundingBox is taken from the SVG 1.1 spec.
485 virtual FloatRect objectBoundingBox() const; 485 virtual FloatRect objectBoundingBox() const;
486 virtual FloatRect strokeBoundingBox() const; 486 virtual FloatRect strokeBoundingBox() const;
487 487
488 // Returns the smallest rectangle enclosing all of the painted content 488 // Returns the smallest rectangle enclosing all of the painted content
489 // respecting clipping, masking, filters, opacity, stroke-width and markers 489 // respecting clipping, masking, filters, opacity, stroke-width and markers
490 virtual FloatRect paintInvalidationRectInLocalCoordinates() const; 490 virtual FloatRect paintInvalidationRectInLocalCoordinates() const;
491 491
492 // This only returns the transform="" value from the element 492 // This only returns the transform="" value from the element
493 // most callsites want localToParentTransform() instead. 493 // most callsites want localToParentTransform() instead.
494 virtual AffineTransform localTransform() const; 494 virtual AffineTransform localTransform() const;
495 495
496 // Returns the full transform mapping from local coordinates to local coords for the parent SVG renderer 496 // Returns the full transform mapping from local coordinates to local coords for the parent SVG layoutObject
497 // This includes any viewport transforms and x/y offsets as well as the tran sform="" value off the element. 497 // This includes any viewport transforms and x/y offsets as well as the tran sform="" value off the element.
498 virtual const AffineTransform& localToParentTransform() const; 498 virtual const AffineTransform& localToParentTransform() const;
499 499
500 // SVG uses FloatPoint precise hit testing, and passes the point in parent 500 // SVG uses FloatPoint precise hit testing, and passes the point in parent
501 // coordinates instead of in paint invalidaiton container coordinates. Event ually the 501 // coordinates instead of in paint invalidaiton container coordinates. Event ually the
502 // rest of the rendering tree will move to a similar model. 502 // rest of the layout tree will move to a similar model.
503 virtual bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParen t, HitTestAction); 503 virtual bool nodeAtFloatPoint(HitTestResult&, const FloatPoint& pointInParen t, HitTestAction);
504 504
505 bool isAnonymous() const { return m_bitfields.isAnonymous(); } 505 bool isAnonymous() const { return m_bitfields.isAnonymous(); }
506 bool isAnonymousBlock() const 506 bool isAnonymousBlock() const
507 { 507 {
508 // This function is kept in sync with anonymous block creation condition s in 508 // This function is kept in sync with anonymous block creation condition s in
509 // LayoutBlock::createAnonymousBlock(). This includes creating an anonym ous 509 // LayoutBlock::createAnonymousBlock(). This includes creating an anonym ous
510 // LayoutBlock having a BLOCK or BOX display. Other classes such as Layo utTextFragment 510 // LayoutBlock having a BLOCK or BOX display. Other classes such as Layo utTextFragment
511 // are not LayoutBlocks and will return false. See https://bugs.webkit.o rg/show_bug.cgi?id=56709. 511 // are not LayoutBlocks and will return false. See https://bugs.webkit.o rg/show_bug.cgi?id=56709.
512 return isAnonymous() && (style()->display() == BLOCK || style()->display () == BOX) && style()->styleType() == NOPSEUDO && isLayoutBlock() && !isListMark er() && !isLayoutFlowThread() && !isLayoutMultiColumnSet() 512 return isAnonymous() && (style()->display() == BLOCK || style()->display () == BOX) && style()->styleType() == NOPSEUDO && isLayoutBlock() && !isListMark er() && !isLayoutFlowThread() && !isLayoutMultiColumnSet()
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 } 617 }
618 618
619 Node* nonPseudoNode() const 619 Node* nonPseudoNode() const
620 { 620 {
621 return isPseudoElement() ? 0 : node(); 621 return isPseudoElement() ? 0 : node();
622 } 622 }
623 623
624 // FIXME: Why does LayoutPart need this? crbug.com/422457 624 // FIXME: Why does LayoutPart need this? crbug.com/422457
625 void clearNode() { m_node = nullptr; } 625 void clearNode() { m_node = nullptr; }
626 626
627 // Returns the styled node that caused the generation of this renderer. 627 // Returns the styled node that caused the generation of this layoutObject.
628 // This is the same as node() except for renderers of :before, :after and 628 // This is the same as node() except for layoutObjects of :before, :after an d
629 // :first-letter pseudo elements for which their parent node is returned. 629 // :first-letter pseudo elements for which their parent node is returned.
630 Node* generatingNode() const { return isPseudoElement() ? node()->parentOrSh adowHostNode() : node(); } 630 Node* generatingNode() const { return isPseudoElement() ? node()->parentOrSh adowHostNode() : node(); }
631 631
632 Document& document() const { return m_node->document(); } 632 Document& document() const { return m_node->document(); }
633 LocalFrame* frame() const { return document().frame(); } 633 LocalFrame* frame() const { return document().frame(); }
634 634
635 virtual LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re turn 0; } 635 virtual LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const { re turn 0; }
636 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll && spannerPlaceholder(); } 636 bool isColumnSpanAll() const { return style()->columnSpan() == ColumnSpanAll && spannerPlaceholder(); }
637 637
638 // Returns the object containing this one. Can be different from parent for positioned elements. 638 // Returns the object containing this one. Can be different from parent for positioned elements.
639 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n ot null, on return *paintInvalidationContainerSkipped 639 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n ot null, on return *paintInvalidationContainerSkipped
640 // is true if the renderer returned is an ancestor of paintInvalidationConta iner. 640 // is true if the layoutObject returned is an ancestor of paintInvalidationC ontainer.
641 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain er = 0, bool* paintInvalidationContainerSkipped = 0) const; 641 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain er = 0, bool* paintInvalidationContainerSkipped = 0) const;
642 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva lidationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const; 642 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva lidationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const;
643 643
644 virtual LayoutObject* hoverAncestor() const { return parent(); } 644 virtual LayoutObject* hoverAncestor() const { return parent(); }
645 645
646 Element* offsetParent() const; 646 Element* offsetParent() const;
647 647
648 void markContainerChainForLayout(bool scheduleRelayout = true, LayoutObject* newRoot = 0, SubtreeLayoutScope* = 0); 648 void markContainerChainForLayout(bool scheduleRelayout = true, LayoutObject* newRoot = 0, SubtreeLayoutScope* = 0);
649 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma rkContainerChain, SubtreeLayoutScope* = 0); 649 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma rkContainerChain, SubtreeLayoutScope* = 0);
650 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = 0); 650 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = 0);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 // Convert an absolute quad to local coordinates. 766 // Convert an absolute quad to local coordinates.
767 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0 ) const; 767 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0 ) const;
768 768
769 // Convert a local quad into the coordinate system of container, taking tran sforms into account. 769 // Convert a local quad into the coordinate system of container, taking tran sforms into account.
770 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutBoxModelObject* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const; 770 FloatQuad localToContainerQuad(const FloatQuad&, const LayoutBoxModelObject* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const;
771 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutBoxModelObje ct* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, con st PaintInvalidationState* = 0) const; 771 FloatPoint localToContainerPoint(const FloatPoint&, const LayoutBoxModelObje ct* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, con st PaintInvalidationState* = 0) const;
772 772
773 // Convert a local point into the coordinate system of backing coordinates. Also returns the backing layer if needed. 773 // Convert a local point into the coordinate system of backing coordinates. Also returns the backing layer if needed.
774 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, DeprecatedPai ntLayer** backingLayer = nullptr); 774 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, DeprecatedPai ntLayer** backingLayer = nullptr);
775 775
776 // Return the offset from the container() renderer (excluding transforms). I n multi-column layout, 776 // Return the offset from the container() layoutObject (excluding transforms ). In multi-column layout,
777 // different offsets apply at different points, so return the offset that ap plies to the given point. 777 // different offsets apply at different points, so return the offset that ap plies to the given point.
778 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = 0) const; 778 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = 0) const;
779 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms. 779 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms.
780 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const; 780 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const;
781 781
782 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } 782 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { }
783 783
784 FloatRect absoluteBoundingBoxFloatRect() const; 784 FloatRect absoluteBoundingBoxFloatRect() const;
785 // This returns an IntRect enclosing this object. If this object has an 785 // This returns an IntRect enclosing this object. If this object has an
786 // integral size and the position has fractional values, the resultant 786 // integral size and the position has fractional values, the resultant
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 bool isPaintInvalidationContainer() const; 849 bool isPaintInvalidationContainer() const;
850 850
851 LayoutRect computePaintInvalidationRect() 851 LayoutRect computePaintInvalidationRect()
852 { 852 {
853 return computePaintInvalidationRect(containerForPaintInvalidation()); 853 return computePaintInvalidationRect(containerForPaintInvalidation());
854 } 854 }
855 855
856 // Returns the paint invalidation rect for this LayoutObject in the coordina te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation Container|. 856 // Returns the paint invalidation rect for this LayoutObject in the coordina te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation Container|.
857 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv alidationContainer, const PaintInvalidationState* = 0) const; 857 LayoutRect computePaintInvalidationRect(const LayoutBoxModelObject* paintInv alidationContainer, const PaintInvalidationState* = 0) const;
858 858
859 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the rendering backing of |paintInvalidationContainer| 859 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the layoutObject backing of |paintInvalidationContainer |
860 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI nvalidationContainer, const PaintInvalidationState* = 0) const; 860 LayoutRect boundsRectForPaintInvalidation(const LayoutBoxModelObject* paintI nvalidationContainer, const PaintInvalidationState* = 0) const;
861 861
862 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space 862 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
863 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same 863 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same
864 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing. 864 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing.
865 // If |paintInvalidationContainer| is 0, invalidate paints via the view. 865 // If |paintInvalidationContainer| is 0, invalidate paints via the view.
866 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99. 866 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99.
867 void invalidatePaintUsingContainer(const LayoutBoxModelObject* paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const; 867 void invalidatePaintUsingContainer(const LayoutBoxModelObject* paintInvalida tionContainer, const LayoutRect&, PaintInvalidationReason) const;
868 868
869 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space. 869 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space.
870 void invalidatePaintRectangle(const LayoutRect&) const; 870 void invalidatePaintRectangle(const LayoutRect&) const;
871 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR ect& r) const { invalidatePaintRectangleInternal(r); } 871 void invalidatePaintRectangleNotInvalidatingDisplayItemClients(const LayoutR ect& r) const { invalidatePaintRectangleInternal(r); }
872 872
873 // 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. 873 // 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.
874 virtual void invalidateTreeIfNeeded(PaintInvalidationState&); 874 virtual void invalidateTreeIfNeeded(PaintInvalidationState&);
875 875
876 virtual void invalidatePaintForOverflow(); 876 virtual void invalidatePaintForOverflow();
877 void invalidatePaintForOverflowIfNeeded(); 877 void invalidatePaintForOverflowIfNeeded();
878 878
879 void invalidatePaintIncludingNonCompositingDescendants(); 879 void invalidatePaintIncludingNonCompositingDescendants();
880 880
881 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's 881 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's
882 // coordinate space. This method deals with outlines and overflow. 882 // coordinate space. This method deals with outlines and overflow.
883 virtual LayoutRect absoluteClippedOverflowRect() const; 883 virtual LayoutRect absoluteClippedOverflowRect() const;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 bool isSelectable() const; 929 bool isSelectable() const;
930 // Obtains the selection colors that should be used when painting a selectio n. 930 // Obtains the selection colors that should be used when painting a selectio n.
931 Color selectionBackgroundColor() const; 931 Color selectionBackgroundColor() const;
932 Color selectionForegroundColor() const; 932 Color selectionForegroundColor() const;
933 Color selectionEmphasisMarkColor() const; 933 Color selectionEmphasisMarkColor() const;
934 934
935 // Whether or not a given block needs to paint selection gaps. 935 // Whether or not a given block needs to paint selection gaps.
936 virtual bool shouldPaintSelectionGaps() const { return false; } 936 virtual bool shouldPaintSelectionGaps() const { return false; }
937 937
938 /** 938 /**
939 * Returns the local coordinates of the caret within this render object. 939 * Returns the local coordinates of the caret within this layout object.
940 * @param caretOffset zero-based offset determining position within the rend er object. 940 * @param caretOffset zero-based offset determining position within the layo ut object.
941 * @param extraWidthToEndOfLine optional out arg to give extra width to end of line - 941 * @param extraWidthToEndOfLine optional out arg to give extra width to end of line -
942 * useful for character range rect computations 942 * useful for character range rect computations
943 */ 943 */
944 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0); 944 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e xtraWidthToEndOfLine = 0);
945 945
946 // When performing a global document tear-down, the renderer of the document is cleared. We use this 946 // When performing a global document tear-down, the layoutObject of the docu ment is cleared. We use this
947 // as a hook to detect the case of document destruction and don't waste time doing unnecessary work. 947 // as a hook to detect the case of document destruction and don't waste time doing unnecessary work.
948 bool documentBeingDestroyed() const; 948 bool documentBeingDestroyed() const;
949 949
950 void destroyAndCleanupAnonymousWrappers(); 950 void destroyAndCleanupAnonymousWrappers();
951 virtual void destroy(); 951 virtual void destroy();
952 952
953 // Virtual function helpers for the deprecated Flexible Box Layout (display: -webkit-box). 953 // Virtual function helpers for the deprecated Flexible Box Layout (display: -webkit-box).
954 virtual bool isDeprecatedFlexibleBox() const { return false; } 954 virtual bool isDeprecatedFlexibleBox() const { return false; }
955 955
956 // Virtual function helper for the new FlexibleBox Layout (display: -webkit- flex). 956 // Virtual function helper for the new FlexibleBox Layout (display: -webkit- flex).
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 989
990 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style() ->pointerEvents() != PE_NONE) && !isInert(); } 990 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style() ->pointerEvents() != PE_NONE) && !isInert(); }
991 991
992 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE & & style()->pointerEvents() != PE_NONE && !isInert(); } 992 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE & & style()->pointerEvents() != PE_NONE && !isInert(); }
993 993
994 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use 994 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use
995 // localToAbsolute/absoluteToLocal methods instead. 995 // localToAbsolute/absoluteToLocal methods instead.
996 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const; 996 virtual void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidati onContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wa sFixed = 0, const PaintInvalidationState* = 0) const;
997 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst; 997 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst;
998 998
999 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi s renderer to its container, or ancestorToStopAt (whichever is encountered first ). 999 // Pushes state onto LayoutGeometryMap about how to map coordinates from thi s layoutObject to its container, or ancestorToStopAt (whichever is encountered f irst).
1000 // Returns the renderer which was mapped to (container or ancestorToStopAt). 1000 // Returns the layoutObject which was mapped to (container or ancestorToStop At).
1001 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const; 1001 virtual const LayoutObject* pushMappingToContainer(const LayoutBoxModelObjec t* ancestorToStopAt, LayoutGeometryMap&) const;
1002 1002
1003 bool shouldUseTransformFromContainer(const LayoutObject* container) const; 1003 bool shouldUseTransformFromContainer(const LayoutObject* container) const;
1004 void getTransformFromContainer(const LayoutObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const; 1004 void getTransformFromContainer(const LayoutObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const;
1005 1005
1006 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || style()->hasBlendMode(); } 1006 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || style()->hasBlendMode(); }
1007 1007
1008 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset) const { } 1008 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit ionalOffset) const { }
1009 1009
1010 // Compute a list of hit-test rectangles per layer rooted at this renderer. 1010 // Compute a list of hit-test rectangles per layer rooted at this layoutObje ct.
1011 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; 1011 virtual void computeLayerHitTestRects(LayerHitTestRects&) const;
1012 1012
1013 // Return the renderer whose background style is used to paint the root back ground. Should only be called on the renderer for which isDocumentElement() is t rue. 1013 // Return the layoutObject whose background style is used to paint the root background. Should only be called on the layoutObject for which isDocumentElemen t() is true.
1014 LayoutObject* rendererForRootBackground(); 1014 LayoutObject* layoutObjectForRootBackground();
1015 1015
1016 RespectImageOrientationEnum shouldRespectImageOrientation() const; 1016 RespectImageOrientationEnum shouldRespectImageOrientation() const;
1017 1017
1018 bool isRelayoutBoundaryForInspector() const; 1018 bool isRelayoutBoundaryForInspector() const;
1019 1019
1020 // The previous paint invalidation rect in the object's previous paint backi ng. 1020 // The previous paint invalidation rect in the object's previous paint backi ng.
1021 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; } 1021 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP aintInvalidationRect; }
1022 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; } 1022 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa intInvalidationRect = rect; }
1023 1023
1024 // The previous position of the top-left corner of the object in its previou s paint backing. 1024 // The previous position of the top-left corner of the object in its previou s paint backing.
1025 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; } 1025 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re turn m_previousPositionFromPaintInvalidationBacking; }
1026 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; } 1026 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki ng = positionFromPaintInvalidationBacking; }
1027 1027
1028 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; } 1028 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv alidationReason() != PaintInvalidationNone; }
1029 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull); 1029 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid ationFull);
1030 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); } 1030 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida tionReason(PaintInvalidationNone); }
1031 1031
1032 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); } 1032 bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInv alidateOverflowForPaint(); }
1033 1033
1034 virtual void clearPaintInvalidationState(const PaintInvalidationState&); 1034 virtual void clearPaintInvalidationState(const PaintInvalidationState&);
1035 1035
1036 // Indicates whether this render object was re-laid-out since the last frame . 1036 // Indicates whether this layout object was re-laid-out since the last frame .
1037 // The flag will be cleared during invalidateTreeIfNeeded. 1037 // The flag will be cleared during invalidateTreeIfNeeded.
1038 bool layoutDidGetCalledSinceLastFrame() const { return m_bitfields.layoutDid GetCalledSinceLastFrame(); } 1038 bool layoutDidGetCalledSinceLastFrame() const { return m_bitfields.layoutDid GetCalledSinceLastFrame(); }
1039 1039
1040 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } 1040 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); }
1041 void setMayNeedPaintInvalidation(); 1041 void setMayNeedPaintInvalidation();
1042 1042
1043 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate Selection(); } 1043 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate Selection(); }
1044 void setShouldInvalidateSelection(); 1044 void setShouldInvalidateSelection();
1045 void clearShouldInvalidateSelection() { m_bitfields.setShouldInvalidateSelec tion(false); } 1045 void clearShouldInvalidateSelection() { m_bitfields.setShouldInvalidateSelec tion(false); }
1046 1046
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 1155
1156 void clearLayoutRootIfNeeded() const; 1156 void clearLayoutRootIfNeeded() const;
1157 virtual void willBeDestroyed(); 1157 virtual void willBeDestroyed();
1158 void postDestroy(); 1158 void postDestroy();
1159 1159
1160 virtual void insertedIntoTree(); 1160 virtual void insertedIntoTree();
1161 virtual void willBeRemovedFromTree(); 1161 virtual void willBeRemovedFromTree();
1162 1162
1163 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_ node = document; } 1163 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_ node = document; }
1164 1164
1165 // Add hit-test rects for the render tree rooted at this node to the provide d collection on a 1165 // Add hit-test rects for the layout tree rooted at this node to the provide d collection on a
1166 // per-Layer basis. 1166 // per-Layer basis.
1167 // currentLayer must be the enclosing layer, and layerOffset is the current offset within 1167 // currentLayer must be the enclosing layer, and layerOffset is the current offset within
1168 // this layer. Subclass implementations will add any offset for this rendere r within it's 1168 // this layer. Subclass implementations will add any offset for this layoutO bject within it's
1169 // container, so callers should provide only the offset of the container wit hin it's layer. 1169 // container, so callers should provide only the offset of the container wit hin it's layer.
1170 // containerRect is a rect that has already been added for the currentLayer which is likely to 1170 // containerRect is a rect that has already been added for the currentLayer which is likely to
1171 // be a container for child elements. Any rect wholly contained by container Rect can be 1171 // be a container for child elements. Any rect wholly contained by container Rect can be
1172 // skipped. 1172 // skipped.
1173 virtual void addLayerHitTestRects(LayerHitTestRects&, const DeprecatedPaintL ayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerR ect) const; 1173 virtual void addLayerHitTestRects(LayerHitTestRects&, const DeprecatedPaintL ayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerR ect) const;
1174 1174
1175 // Add hit-test rects for this renderer only to the provided list. layerOffs et is the offset 1175 // Add hit-test rects for this layoutObject only to the provided list. layer Offset is the offset
1176 // of this renderer within the current layer that should be used for each re sult. 1176 // of this layoutObject within the current layer that should be used for eac h result.
1177 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { }; 1177 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const { };
1178 1178
1179 virtual PaintInvalidationReason paintInvalidationReason(const LayoutBoxModel Object& paintInvalidationContainer, 1179 virtual PaintInvalidationReason paintInvalidationReason(const LayoutBoxModel Object& paintInvalidationContainer,
1180 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking, 1180 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi onFromPaintInvalidationBacking,
1181 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const; 1181 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi onFromPaintInvalidationBacking) const;
1182 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking); 1182 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking);
1183 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds); 1183 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne wBounds);
1184 1184
1185 virtual bool hasNonCompositedScrollbars() const { return false; } 1185 virtual bool hasNonCompositedScrollbars() const { return false; }
1186 1186
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 Color selectionColor(int colorProperty) const; 1235 Color selectionColor(int colorProperty) const;
1236 1236
1237 void removeShapeImageClient(ShapeValue*); 1237 void removeShapeImageClient(ShapeValue*);
1238 1238
1239 #if ENABLE(ASSERT) 1239 #if ENABLE(ASSERT)
1240 void checkBlockPositionedObjectsNeedLayout(); 1240 void checkBlockPositionedObjectsNeedLayout();
1241 #endif 1241 #endif
1242 1242
1243 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; } 1243 bool isTextOrSVGChild() const { return isText() || (isSVG() && !isSVGRoot()) ; }
1244 1244
1245 static bool isAllowedToModifyRenderTreeStructure(Document&); 1245 static bool isAllowedToModifyLayoutTreeStructure(Document&);
1246 1246
1247 const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRec t&) const; 1247 const LayoutBoxModelObject* invalidatePaintRectangleInternal(const LayoutRec t&) const;
1248 1248
1249 RefPtr<ComputedStyle> m_style; 1249 RefPtr<ComputedStyle> m_style;
1250 1250
1251 // Oilpan: raw pointer back to the owning Node is considered safe. 1251 // Oilpan: raw pointer back to the owning Node is considered safe.
1252 Node* m_node; 1252 Node* m_node;
1253 1253
1254 LayoutObject* m_parent; 1254 LayoutObject* m_parent;
1255 LayoutObject* m_previous; 1255 LayoutObject* m_previous;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setCh ildNeedsOverflowRecalcAfterStyleChange(b); } 1413 void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { m_bitfields.setCh ildNeedsOverflowRecalcAfterStyleChange(b); }
1414 1414
1415 private: 1415 private:
1416 // Store state between styleWillChange and styleDidChange 1416 // Store state between styleWillChange and styleDidChange
1417 static bool s_affectsParentBlock; 1417 static bool s_affectsParentBlock;
1418 1418
1419 // This stores the paint invalidation rect from the previous frame. 1419 // This stores the paint invalidation rect from the previous frame.
1420 LayoutRect m_previousPaintInvalidationRect; 1420 LayoutRect m_previousPaintInvalidationRect;
1421 1421
1422 // This stores the position in the paint invalidation backing's coordinate. 1422 // This stores the position in the paint invalidation backing's coordinate.
1423 // It is used to detect renderer shifts that forces a full invalidation. 1423 // It is used to detect layoutObject shifts that forces a full invalidation.
1424 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 1424 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
1425 1425
1426 static unsigned s_instanceCount; 1426 static unsigned s_instanceCount;
1427 }; 1427 };
1428 1428
1429 // FIXME: remove this once the render object lifecycle ASSERTS are no longer hit . 1429 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer hit .
1430 class DeprecatedDisableModifyRenderTreeStructureAsserts { 1430 class DeprecatedDisableModifyLayoutTreeStructureAsserts {
1431 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); 1431 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyLayoutTreeStructureAsserts);
1432 public: 1432 public:
1433 DeprecatedDisableModifyRenderTreeStructureAsserts(); 1433 DeprecatedDisableModifyLayoutTreeStructureAsserts();
1434 1434
1435 static bool canModifyRenderTreeStateInAnyState(); 1435 static bool canModifyLayoutTreeStateInAnyState();
1436 1436
1437 private: 1437 private:
1438 TemporaryChange<bool> m_disabler; 1438 TemporaryChange<bool> m_disabler;
1439 }; 1439 };
1440 1440
1441 // FIXME: We should not allow paint invalidation out of paint invalidation state . crbug.com/457415 1441 // FIXME: We should not allow paint invalidation out of paint invalidation state . crbug.com/457415
1442 // Remove this once we fix the bug. 1442 // Remove this once we fix the bug.
1443 class DisablePaintInvalidationStateAsserts { 1443 class DisablePaintInvalidationStateAsserts {
1444 WTF_MAKE_NONCOPYABLE(DisablePaintInvalidationStateAsserts); 1444 WTF_MAKE_NONCOPYABLE(DisablePaintInvalidationStateAsserts);
1445 public: 1445 public:
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 inline bool LayoutObject::preservesNewline() const 1544 inline bool LayoutObject::preservesNewline() const
1545 { 1545 {
1546 if (isSVGInlineText()) 1546 if (isSVGInlineText())
1547 return false; 1547 return false;
1548 1548
1549 return style()->preserveNewline(); 1549 return style()->preserveNewline();
1550 } 1550 }
1551 1551
1552 inline bool LayoutObject::layerCreationAllowedForSubtree() const 1552 inline bool LayoutObject::layerCreationAllowedForSubtree() const
1553 { 1553 {
1554 LayoutObject* parentRenderer = parent(); 1554 LayoutObject* parentLayoutObject = parent();
1555 while (parentRenderer) { 1555 while (parentLayoutObject) {
1556 if (parentRenderer->isSVGHiddenContainer()) 1556 if (parentLayoutObject->isSVGHiddenContainer())
1557 return false; 1557 return false;
1558 parentRenderer = parentRenderer->parent(); 1558 parentLayoutObject = parentLayoutObject->parent();
1559 } 1559 }
1560 1560
1561 return true; 1561 return true;
1562 } 1562 }
1563 1563
1564 inline void LayoutObject::setSelectionStateIfNeeded(SelectionState state) 1564 inline void LayoutObject::setSelectionStateIfNeeded(SelectionState state)
1565 { 1565 {
1566 if (selectionState() == state) 1566 if (selectionState() == state)
1567 return; 1567 return;
1568 1568
(...skipping 26 matching lines...) Expand all
1595 } 1595 }
1596 return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgro undKnownToBeObscured; 1596 return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgro undKnownToBeObscured;
1597 } 1597 }
1598 1598
1599 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi ng) 1599 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi ng)
1600 { 1600 {
1601 if (!has3DRendering) 1601 if (!has3DRendering)
1602 matrix.makeAffine(); 1602 matrix.makeAffine();
1603 } 1603 }
1604 1604
1605 inline int adjustForAbsoluteZoom(int value, LayoutObject* renderer) 1605 inline int adjustForAbsoluteZoom(int value, LayoutObject* layoutObject)
1606 { 1606 {
1607 return adjustForAbsoluteZoom(value, renderer->style()); 1607 return adjustForAbsoluteZoom(value, layoutObject->style());
1608 } 1608 }
1609 1609
1610 inline double adjustDoubleForAbsoluteZoom(double value, LayoutObject& renderer) 1610 inline double adjustDoubleForAbsoluteZoom(double value, LayoutObject& layoutObje ct)
1611 { 1611 {
1612 ASSERT(renderer.style()); 1612 ASSERT(layoutObject.style());
1613 return adjustDoubleForAbsoluteZoom(value, *renderer.style()); 1613 return adjustDoubleForAbsoluteZoom(value, *layoutObject.style());
1614 } 1614 }
1615 1615
1616 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, LayoutObject & renderer) 1616 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, LayoutObject & layoutObject)
1617 { 1617 {
1618 ASSERT(renderer.style()); 1618 ASSERT(layoutObject.style());
1619 return adjustLayoutUnitForAbsoluteZoom(value, *renderer.style()); 1619 return adjustLayoutUnitForAbsoluteZoom(value, *layoutObject.style());
1620 } 1620 }
1621 1621
1622 inline void adjustFloatQuadForAbsoluteZoom(FloatQuad& quad, LayoutObject& render er) 1622 inline void adjustFloatQuadForAbsoluteZoom(FloatQuad& quad, LayoutObject& layout Object)
1623 { 1623 {
1624 float zoom = renderer.style()->effectiveZoom(); 1624 float zoom = layoutObject.style()->effectiveZoom();
1625 if (zoom != 1) 1625 if (zoom != 1)
1626 quad.scale(1 / zoom, 1 / zoom); 1626 quad.scale(1 / zoom, 1 / zoom);
1627 } 1627 }
1628 1628
1629 inline void adjustFloatRectForAbsoluteZoom(FloatRect& rect, LayoutObject& render er) 1629 inline void adjustFloatRectForAbsoluteZoom(FloatRect& rect, LayoutObject& layout Object)
1630 { 1630 {
1631 float zoom = renderer.style()->effectiveZoom(); 1631 float zoom = layoutObject.style()->effectiveZoom();
1632 if (zoom != 1) 1632 if (zoom != 1)
1633 rect.scale(1 / zoom, 1 / zoom); 1633 rect.scale(1 / zoom, 1 / zoom);
1634 } 1634 }
1635 1635
1636 inline double adjustScrollForAbsoluteZoom(double value, LayoutObject& renderer) 1636 inline double adjustScrollForAbsoluteZoom(double value, LayoutObject& layoutObje ct)
1637 { 1637 {
1638 ASSERT(renderer.style()); 1638 ASSERT(layoutObject.style());
1639 return adjustScrollForAbsoluteZoom(value, *renderer.style()); 1639 return adjustScrollForAbsoluteZoom(value, *layoutObject.style());
1640 } 1640 }
1641 1641
1642 #define DEFINE_LAYOUT_OBJECT_TYPE_CASTS(thisType, predicate) \ 1642 #define DEFINE_LAYOUT_OBJECT_TYPE_CASTS(thisType, predicate) \
1643 DEFINE_TYPE_CASTS(thisType, LayoutObject, object, object->predicate, object. predicate) 1643 DEFINE_TYPE_CASTS(thisType, LayoutObject, object, object->predicate, object. predicate)
1644 1644
1645 } // namespace blink 1645 } // namespace blink
1646 1646
1647 #ifndef NDEBUG 1647 #ifndef NDEBUG
1648 // Outside the WebCore namespace for ease of invocation from gdb. 1648 // Outside the WebCore namespace for ease of invocation from gdb.
1649 void showTree(const blink::LayoutObject*); 1649 void showTree(const blink::LayoutObject*);
1650 void showLineTree(const blink::LayoutObject*); 1650 void showLineTree(const blink::LayoutObject*);
1651 void showLayoutTree(const blink::LayoutObject* object1); 1651 void showLayoutTree(const blink::LayoutObject* object1);
1652 // We don't make object2 an optional parameter so that showLayoutTree 1652 // We don't make object2 an optional parameter so that showLayoutTree
1653 // can be called from gdb easily. 1653 // can be called from gdb easily.
1654 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1654 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1655 1655
1656 #endif 1656 #endif
1657 1657
1658 #endif // LayoutObject_h 1658 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutMenuList.cpp ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698