| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 virtual RenderBlock* firstLineBlock() const; | 265 virtual RenderBlock* firstLineBlock() const; |
| 266 | 266 |
| 267 // Called when an object that was floating or positioned becomes a normal fl
ow object | 267 // Called when an object that was floating or positioned becomes a normal fl
ow object |
| 268 // again. We have to make sure the render tree updates as needed to accommo
date the new | 268 // again. We have to make sure the render tree updates as needed to accommo
date the new |
| 269 // normal flow object. | 269 // normal flow object. |
| 270 void handleDynamicFloatPositionChange(); | 270 void handleDynamicFloatPositionChange(); |
| 271 | 271 |
| 272 // RenderObject tree manipulation | 272 // RenderObject tree manipulation |
| 273 ////////////////////////////////////////// | 273 ////////////////////////////////////////// |
| 274 virtual bool canHaveChildren() const { return virtualChildren(); } | 274 virtual bool canHaveChildren() const { return virtualChildren(); } |
| 275 virtual bool canHaveGeneratedChildren() const; | |
| 276 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true
; } | 275 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true
; } |
| 277 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; | 276 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; |
| 278 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } | 277 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } |
| 279 virtual void removeChild(RenderObject*); | 278 virtual void removeChild(RenderObject*); |
| 280 ////////////////////////////////////////// | 279 ////////////////////////////////////////// |
| 281 | 280 |
| 282 protected: | 281 protected: |
| 283 ////////////////////////////////////////// | 282 ////////////////////////////////////////// |
| 284 // Helper functions. Dangerous to use! | 283 // Helper functions. Dangerous to use! |
| 285 void setPreviousSibling(RenderObject* previous) { m_previous = previous; } | 284 void setPreviousSibling(RenderObject* previous) { m_previous = previous; } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 316 void* operator new(size_t); | 315 void* operator new(size_t); |
| 317 void operator delete(void*); | 316 void operator delete(void*); |
| 318 #endif | 317 #endif |
| 319 | 318 |
| 320 public: | 319 public: |
| 321 virtual bool isBoxModelObject() const { return false; } | 320 virtual bool isBoxModelObject() const { return false; } |
| 322 virtual bool isCanvas() const { return false; } | 321 virtual bool isCanvas() const { return false; } |
| 323 virtual bool isImage() const { return false; } | 322 virtual bool isImage() const { return false; } |
| 324 virtual bool isInlineBlock() const { return false; } | 323 virtual bool isInlineBlock() const { return false; } |
| 325 virtual bool isLayerModelObject() const { return false; } | 324 virtual bool isLayerModelObject() const { return false; } |
| 326 virtual bool isMedia() const { return false; } | |
| 327 virtual bool isRenderBlock() const { return false; } | 325 virtual bool isRenderBlock() const { return false; } |
| 328 virtual bool isRenderBlockFlow() const { return false; } | 326 virtual bool isRenderBlockFlow() const { return false; } |
| 329 virtual bool isRenderParagraph() const { return false; } | 327 virtual bool isRenderParagraph() const { return false; } |
| 330 virtual bool isRenderImage() const { return false; } | 328 virtual bool isRenderImage() const { return false; } |
| 331 virtual bool isRenderInline() const { return false; } | 329 virtual bool isRenderInline() const { return false; } |
| 332 virtual bool isRenderView() const { return false; } | 330 virtual bool isRenderView() const { return false; } |
| 333 virtual bool isWidget() const { return false; } | |
| 334 | 331 |
| 335 bool isDocumentElement() const { return document().documentElement() == m_no
de; } | 332 bool isDocumentElement() const { return document().documentElement() == m_no
de; } |
| 336 | 333 |
| 337 bool everHadLayout() const { return m_bitfields.everHadLayout(); } | 334 bool everHadLayout() const { return m_bitfields.everHadLayout(); } |
| 338 | 335 |
| 339 // FIXME(sky): Remove this concept. | 336 // FIXME(sky): Remove this concept. |
| 340 bool childrenInline() const { return isRenderParagraph(); } | 337 bool childrenInline() const { return isRenderParagraph(); } |
| 341 void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } | 338 void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } |
| 342 | 339 |
| 343 bool alwaysCreateLineBoxesForRenderInline() const | 340 bool alwaysCreateLineBoxesForRenderInline() const |
| 344 { | 341 { |
| 345 ASSERT(isRenderInline()); | 342 ASSERT(isRenderInline()); |
| 346 return m_bitfields.alwaysCreateLineBoxesForRenderInline(); | 343 return m_bitfields.alwaysCreateLineBoxesForRenderInline(); |
| 347 } | 344 } |
| 348 void setAlwaysCreateLineBoxesForRenderInline(bool alwaysCreateLineBoxes) | 345 void setAlwaysCreateLineBoxesForRenderInline(bool alwaysCreateLineBoxes) |
| 349 { | 346 { |
| 350 ASSERT(isRenderInline()); | 347 ASSERT(isRenderInline()); |
| 351 m_bitfields.setAlwaysCreateLineBoxesForRenderInline(alwaysCreateLineBoxe
s); | 348 m_bitfields.setAlwaysCreateLineBoxesForRenderInline(alwaysCreateLineBoxe
s); |
| 352 } | 349 } |
| 353 | 350 |
| 354 bool ancestorLineBoxDirty() const { return m_bitfields.ancestorLineBoxDirty(
); } | 351 bool ancestorLineBoxDirty() const { return m_bitfields.ancestorLineBoxDirty(
); } |
| 355 void setAncestorLineBoxDirty(bool value = true) | 352 void setAncestorLineBoxDirty(bool value = true) |
| 356 { | 353 { |
| 357 m_bitfields.setAncestorLineBoxDirty(value); | 354 m_bitfields.setAncestorLineBoxDirty(value); |
| 358 if (value) | 355 if (value) |
| 359 setNeedsLayoutAndFullPaintInvalidation(); | 356 setNeedsLayoutAndFullPaintInvalidation(); |
| 360 } | 357 } |
| 361 | 358 |
| 362 // FIXME: Those belong into a SVG specific base-class for all renderers (see
above) | |
| 363 // Unfortunately we don't have such a class yet, because it's not possible f
or all renderers | |
| 364 // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock in
heritance for instance) | |
| 365 virtual void setNeedsTransformUpdate() { } | |
| 366 virtual void setNeedsBoundariesUpdate(); | |
| 367 | |
| 368 // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects,
opacity and stroke-width. | |
| 369 // This is used for all computation of objectBoundingBox relative units and
by SVGLocatable::getBBox(). | |
| 370 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we i
gnore them | |
| 371 // since stroke-width is ignored (and marker size can depend on stroke-width
). | |
| 372 // objectBoundingBox is returned local coordinates. | |
| 373 // The name objectBoundingBox is taken from the SVG 1.1 spec. | |
| 374 virtual FloatRect objectBoundingBox() const; | |
| 375 virtual FloatRect strokeBoundingBox() const; | |
| 376 | |
| 377 // Returns the smallest rectangle enclosing all of the painted content | 359 // Returns the smallest rectangle enclosing all of the painted content |
| 378 // respecting clipping, masking, filters, opacity, stroke-width and markers | 360 // respecting clipping, masking, filters, opacity, stroke-width and markers |
| 379 virtual FloatRect paintInvalidationRectInLocalCoordinates() const; | 361 virtual FloatRect paintInvalidationRectInLocalCoordinates() const; |
| 380 | 362 |
| 381 // This only returns the transform="" value from the element | |
| 382 // most callsites want localToParentTransform() instead. | |
| 383 virtual AffineTransform localTransform() const; | |
| 384 | |
| 385 // Returns the full transform mapping from local coordinates to local coords
for the parent SVG renderer | |
| 386 // This includes any viewport transforms and x/y offsets as well as the tran
sform="" value off the element. | |
| 387 virtual const AffineTransform& localToParentTransform() const; | |
| 388 | |
| 389 // SVG uses FloatPoint precise hit testing, and passes the point in parent | 363 // SVG uses FloatPoint precise hit testing, and passes the point in parent |
| 390 // coordinates instead of in paint invalidaiton container coordinates. Event
ually the | 364 // coordinates instead of in paint invalidaiton container coordinates. Event
ually the |
| 391 // rest of the rendering tree will move to a similar model. | 365 // rest of the rendering tree will move to a similar model. |
| 392 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F
loatPoint& pointInParent, HitTestAction); | 366 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F
loatPoint& pointInParent, HitTestAction); |
| 393 | 367 |
| 394 virtual bool canHaveWhitespaceChildren() const | 368 bool canHaveWhitespaceChildren() const |
| 395 { | 369 { |
| 396 return !isFlexibleBox(); | 370 return !isFlexibleBox(); |
| 397 } | 371 } |
| 398 | 372 |
| 399 bool isAnonymous() const { return m_bitfields.isAnonymous(); } | 373 bool isAnonymous() const { return m_bitfields.isAnonymous(); } |
| 400 bool isAnonymousBlock() const | 374 bool isAnonymousBlock() const |
| 401 { | 375 { |
| 402 // This function is kept in sync with anonymous block creation condition
s in | 376 // This function is kept in sync with anonymous block creation condition
s in |
| 403 // RenderBlock::createAnonymousBlock(). This includes creating an anonym
ous | 377 // RenderBlock::createAnonymousBlock(). This includes creating an anonym
ous |
| 404 // RenderBlock having a BLOCK or BOX display. See https://bugs.webkit.or
g/show_bug.cgi?id=56709. | 378 // RenderBlock having a BLOCK or BOX display. See https://bugs.webkit.or
g/show_bug.cgi?id=56709. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 RenderView* view() const { return document().renderView(); }; | 458 RenderView* view() const { return document().renderView(); }; |
| 485 FrameView* frameView() const { return document().view(); }; | 459 FrameView* frameView() const { return document().view(); }; |
| 486 | 460 |
| 487 bool isRooted() const; | 461 bool isRooted() const; |
| 488 | 462 |
| 489 Node* node() const | 463 Node* node() const |
| 490 { | 464 { |
| 491 return isAnonymous() ? 0 : m_node.get(); | 465 return isAnonymous() ? 0 : m_node.get(); |
| 492 } | 466 } |
| 493 | 467 |
| 494 Node* nonPseudoNode() const | |
| 495 { | |
| 496 return node(); | |
| 497 } | |
| 498 | |
| 499 // FIXME(sky): remove this. | |
| 500 Node* generatingNode() const { return node(); } | |
| 501 | |
| 502 Document& document() const { return m_node->document(); } | 468 Document& document() const { return m_node->document(); } |
| 503 LocalFrame* frame() const { return document().frame(); } | 469 LocalFrame* frame() const { return document().frame(); } |
| 504 | 470 |
| 505 // Returns the object containing this one. Can be different from parent for
positioned elements. | 471 // Returns the object containing this one. Can be different from parent for
positioned elements. |
| 506 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped | 472 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped |
| 507 // is true if the renderer returned is an ancestor of paintInvalidationConta
iner. | 473 // is true if the renderer returned is an ancestor of paintInvalidationConta
iner. |
| 508 RenderObject* container(const RenderLayerModelObject* paintInvalidationConta
iner = 0, bool* paintInvalidationContainerSkipped = 0) const; | 474 RenderObject* container(const RenderLayerModelObject* paintInvalidationConta
iner = 0, bool* paintInvalidationContainerSkipped = 0) const; |
| 509 | 475 |
| 510 virtual RenderObject* hoverAncestor() const { return parent(); } | 476 // TODO(esprehn): Remove this. |
| 477 RenderObject* hoverAncestor() const { return parent(); } |
| 511 | 478 |
| 512 Element* offsetParent() const; | 479 Element* offsetParent() const; |
| 513 | 480 |
| 514 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec
t* newRoot = 0, SubtreeLayoutScope* = 0); | 481 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec
t* newRoot = 0, SubtreeLayoutScope* = 0); |
| 515 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou
tScope* = 0); | 482 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou
tScope* = 0); |
| 516 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContaining
BlockChain, SubtreeLayoutScope* = 0); | 483 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContaining
BlockChain, SubtreeLayoutScope* = 0); |
| 517 void clearNeedsLayout(); | 484 void clearNeedsLayout(); |
| 518 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree
LayoutScope* = 0); | 485 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree
LayoutScope* = 0); |
| 519 void setNeedsPositionedMovementLayout(); | 486 void setNeedsPositionedMovementLayout(); |
| 520 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha
in); | 487 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha
in); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 523 |
| 557 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers
); | 524 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers
); |
| 558 void updateImage(StyleImage*, StyleImage*); | 525 void updateImage(StyleImage*, StyleImage*); |
| 559 | 526 |
| 560 // paintOffset is the offset from the origin of the GraphicsContext at which
to paint the current object. | 527 // paintOffset is the offset from the origin of the GraphicsContext at which
to paint the current object. |
| 561 virtual void paint(PaintInfo&, const LayoutPoint& paintOffset); | 528 virtual void paint(PaintInfo&, const LayoutPoint& paintOffset); |
| 562 | 529 |
| 563 // Subclasses must reimplement this method to compute the size and position | 530 // Subclasses must reimplement this method to compute the size and position |
| 564 // of this object and all its descendants. | 531 // of this object and all its descendants. |
| 565 virtual void layout() = 0; | 532 virtual void layout() = 0; |
| 566 void setHasPendingResourceUpdate(bool hasPendingResourceUpdate) { m_bitfield
s.setHasPendingResourceUpdate(hasPendingResourceUpdate); } | |
| 567 bool hasPendingResourceUpdate() const { return m_bitfields.hasPendingResourc
eUpdate(); } | |
| 568 | 533 |
| 569 /* This function performs a layout only if one is needed. */ | 534 /* This function performs a layout only if one is needed. */ |
| 570 void layoutIfNeeded() { if (needsLayout()) layout(); } | 535 void layoutIfNeeded() { if (needsLayout()) layout(); } |
| 571 | 536 |
| 572 void forceLayout(); | 537 void forceLayout(); |
| 573 void forceChildLayout(); | 538 void forceChildLayout(); |
| 574 | 539 |
| 575 // Used for element state updates that cannot be fixed with a | |
| 576 // paint invalidation and do not need a relayout. | |
| 577 virtual void updateFromElement() { } | |
| 578 | |
| 579 CompositingState compositingState() const; | 540 CompositingState compositingState() const; |
| 580 virtual CompositingReasons additionalCompositingReasons() const; | 541 virtual CompositingReasons additionalCompositingReasons() const; |
| 581 | 542 |
| 582 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l
ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes
tAll); | 543 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l
ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes
tAll); |
| 583 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); | 544 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); |
| 584 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion); | 545 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion); |
| 585 | 546 |
| 586 virtual PositionWithAffinity positionForPoint(const LayoutPoint&); | 547 virtual PositionWithAffinity positionForPoint(const LayoutPoint&); |
| 587 PositionWithAffinity createPositionWithAffinity(int offset, EAffinity); | 548 PositionWithAffinity createPositionWithAffinity(int offset, EAffinity); |
| 588 PositionWithAffinity createPositionWithAffinity(const Position&); | 549 PositionWithAffinity createPositionWithAffinity(const Position&); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // When performing a global document tear-down, the renderer of the document
is cleared. We use this | 732 // When performing a global document tear-down, the renderer of the document
is cleared. We use this |
| 772 // as a hook to detect the case of document destruction and don't waste time
doing unnecessary work. | 733 // as a hook to detect the case of document destruction and don't waste time
doing unnecessary work. |
| 773 bool documentBeingDestroyed() const; | 734 bool documentBeingDestroyed() const; |
| 774 | 735 |
| 775 void destroyAndCleanupAnonymousWrappers(); | 736 void destroyAndCleanupAnonymousWrappers(); |
| 776 virtual void destroy(); | 737 virtual void destroy(); |
| 777 | 738 |
| 778 // Virtual function helper for the new FlexibleBox Layout (display: -webkit-
flex). | 739 // Virtual function helper for the new FlexibleBox Layout (display: -webkit-
flex). |
| 779 virtual bool isFlexibleBox() const { return false; } | 740 virtual bool isFlexibleBox() const { return false; } |
| 780 | 741 |
| 781 virtual bool isCombineText() const { return false; } | |
| 782 | |
| 783 virtual int caretMinOffset() const; | 742 virtual int caretMinOffset() const; |
| 784 virtual int caretMaxOffset() const; | 743 virtual int caretMaxOffset() const; |
| 785 | 744 |
| 786 virtual int previousOffset(int current) const; | 745 virtual int previousOffset(int current) const; |
| 787 virtual int previousOffsetForBackwardDeletion(int current) const; | 746 virtual int previousOffsetForBackwardDeletion(int current) const; |
| 788 virtual int nextOffset(int current) const; | 747 virtual int nextOffset(int current) const; |
| 789 | 748 |
| 790 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; | 749 virtual void imageChanged(ImageResource*, const IntRect* = 0) override final
; |
| 791 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } | 750 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } |
| 792 virtual bool willRenderImage(ImageResource*) override final; | 751 virtual bool willRenderImage(ImageResource*) override final; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 void doNotUseInvalidatePaintForWholeRendererSynchronously() const { invalida
tePaintForWholeRenderer(); } | 850 void doNotUseInvalidatePaintForWholeRendererSynchronously() const { invalida
tePaintForWholeRenderer(); } |
| 892 | 851 |
| 893 protected: | 852 protected: |
| 894 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time | 853 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time |
| 895 // this function will be called. | 854 // this function will be called. |
| 896 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); | 855 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); |
| 897 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first | 856 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first |
| 898 // time this function is called. | 857 // time this function is called. |
| 899 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 858 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
| 900 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); | 859 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
| 901 virtual void updateAnonymousChildStyle(const RenderObject* child, RenderStyl
e* style) const { } | 860 void updateAnonymousChildStyle(const RenderObject* child, RenderStyle* style
) const { } |
| 902 | 861 |
| 903 void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, Bo
xSide, | 862 void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, Bo
xSide, |
| 904 Color, EBorderStyle, int adjbw1, int adjbw2, bool an
tialias = false); | 863 Color, EBorderStyle, int adjbw1, int adjbw2, bool an
tialias = false); |
| 905 void drawDashedOrDottedBoxSide(GraphicsContext*, int x1, int y1, int x2, int
y2, | 864 void drawDashedOrDottedBoxSide(GraphicsContext*, int x1, int y1, int x2, int
y2, |
| 906 BoxSide, Color, int thickness, EBorderStyle, bool antialias); | 865 BoxSide, Color, int thickness, EBorderStyle, bool antialias); |
| 907 void drawDoubleBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, | 866 void drawDoubleBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, |
| 908 int length, BoxSide, Color, int thickness, int adjacentWidth1, int adjac
entWidth2, bool antialias); | 867 int length, BoxSide, Color, int thickness, int adjacentWidth1, int adjac
entWidth2, bool antialias); |
| 909 void drawRidgeOrGrooveBoxSide(GraphicsContext*, int x1, int y1, int x2, int
y2, | 868 void drawRidgeOrGrooveBoxSide(GraphicsContext*, int x1, int y1, int x2, int
y2, |
| 910 BoxSide, Color, EBorderStyle, int adjacentWidth1, int adjacentWidth2, bo
ol antialias); | 869 BoxSide, Color, EBorderStyle, int adjacentWidth1, int adjacentWidth2, bo
ol antialias); |
| 911 void drawSolidBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, | 870 void drawSolidBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, |
| 912 BoxSide, Color, int adjacentWidth1, int adjacentWidth2, bool antialias); | 871 BoxSide, Color, int adjacentWidth1, int adjacentWidth2, bool antialias); |
| 913 | 872 |
| 914 void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*); | 873 void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*); |
| 915 void paintOutline(PaintInfo&, const LayoutRect&); | 874 void paintOutline(PaintInfo&, const LayoutRect&); |
| 916 void addChildFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalO
ffset, const RenderLayerModelObject* paintContainer) const; | 875 void addChildFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalO
ffset, const RenderLayerModelObject* paintContainer) const; |
| 917 | 876 |
| 918 virtual LayoutRect viewRect() const; | 877 virtual LayoutRect viewRect() const; |
| 919 | 878 |
| 920 void clearLayoutRootIfNeeded() const; | 879 void clearLayoutRootIfNeeded() const; |
| 921 virtual void willBeDestroyed(); | 880 virtual void willBeDestroyed(); |
| 922 void postDestroy(); | 881 void postDestroy(); |
| 923 | 882 |
| 924 virtual void insertedIntoTree(); | 883 void insertedIntoTree(); |
| 925 virtual void willBeRemovedFromTree(); | 884 void willBeRemovedFromTree(); |
| 926 | 885 |
| 927 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_
node = document; } | 886 void setDocumentForAnonymous(Document* document) { ASSERT(isAnonymous()); m_
node = document; } |
| 928 | 887 |
| 929 virtual InvalidationReason getPaintInvalidationReason(const RenderLayerModel
Object& paintInvalidationContainer, | 888 virtual InvalidationReason getPaintInvalidationReason(const RenderLayerModel
Object& paintInvalidationContainer, |
| 930 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva
lidationContainer, | 889 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva
lidationContainer, |
| 931 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInva
lidationContainer); | 890 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInva
lidationContainer); |
| 932 virtual void incrementallyInvalidatePaint(const RenderLayerModelObject& pain
tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds
, const LayoutPoint& positionFromPaintInvalidationContainer); | 891 virtual void incrementallyInvalidatePaint(const RenderLayerModelObject& pain
tInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds
, const LayoutPoint& positionFromPaintInvalidationContainer); |
| 933 void fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationCon
tainer, InvalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBo
unds); | 892 void fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationCon
tainer, InvalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBo
unds); |
| 934 | 893 |
| 935 #if ENABLE(ASSERT) | 894 #if ENABLE(ASSERT) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 // FIXME: We should remove mayNeedPaintInvalidation once we are able
to | 973 // FIXME: We should remove mayNeedPaintInvalidation once we are able
to |
| 1015 // use the other layout flags to detect the same cases. crbug.com/37
0118 | 974 // use the other layout flags to detect the same cases. crbug.com/37
0118 |
| 1016 , m_mayNeedPaintInvalidation(false) | 975 , m_mayNeedPaintInvalidation(false) |
| 1017 , m_onlyNeededPositionedMovementLayout(false) | 976 , m_onlyNeededPositionedMovementLayout(false) |
| 1018 , m_neededLayoutBecauseOfChildren(false) | 977 , m_neededLayoutBecauseOfChildren(false) |
| 1019 , m_needsPositionedMovementLayout(false) | 978 , m_needsPositionedMovementLayout(false) |
| 1020 , m_normalChildNeedsLayout(false) | 979 , m_normalChildNeedsLayout(false) |
| 1021 , m_posChildNeedsLayout(false) | 980 , m_posChildNeedsLayout(false) |
| 1022 , m_needsSimplifiedNormalFlowLayout(false) | 981 , m_needsSimplifiedNormalFlowLayout(false) |
| 1023 , m_preferredLogicalWidthsDirty(false) | 982 , m_preferredLogicalWidthsDirty(false) |
| 1024 , m_floating(false) | |
| 1025 , m_selfNeedsOverflowRecalcAfterStyleChange(false) | 983 , m_selfNeedsOverflowRecalcAfterStyleChange(false) |
| 1026 , m_childNeedsOverflowRecalcAfterStyleChange(false) | 984 , m_childNeedsOverflowRecalcAfterStyleChange(false) |
| 1027 , m_isAnonymous(!node) | 985 , m_isAnonymous(!node) |
| 1028 , m_isText(false) | 986 , m_isText(false) |
| 1029 , m_isBox(false) | 987 , m_isBox(false) |
| 1030 , m_isInline(true) | 988 , m_isInline(true) |
| 1031 , m_isReplaced(false) | 989 , m_isReplaced(false) |
| 1032 , m_isDragging(false) | 990 , m_isDragging(false) |
| 1033 , m_hasLayer(false) | 991 , m_hasLayer(false) |
| 1034 , m_hasOverflowClip(false) | 992 , m_hasOverflowClip(false) |
| 1035 , m_hasTransform(false) | 993 , m_hasTransform(false) |
| 1036 , m_everHadLayout(false) | 994 , m_everHadLayout(false) |
| 1037 , m_ancestorLineBoxDirty(false) | 995 , m_ancestorLineBoxDirty(false) |
| 1038 , m_layoutDidGetCalled(false) | 996 , m_layoutDidGetCalled(false) |
| 1039 , m_hasPendingResourceUpdate(false) | |
| 1040 , m_childrenInline(false) | 997 , m_childrenInline(false) |
| 1041 , m_hasColumns(false) | |
| 1042 , m_alwaysCreateLineBoxesForRenderInline(false) | 998 , m_alwaysCreateLineBoxesForRenderInline(false) |
| 1043 , m_positionedState(IsStaticallyPositioned) | 999 , m_positionedState(IsStaticallyPositioned) |
| 1044 , m_selectionState(SelectionNone) | 1000 , m_selectionState(SelectionNone) |
| 1045 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) | 1001 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) |
| 1046 { | 1002 { |
| 1047 } | 1003 } |
| 1048 | 1004 |
| 1049 // 32 bits have been used in the first word, and 11 in the second. | 1005 // 32 bits have been used in the first word, and 11 in the second. |
| 1050 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); | 1006 ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); |
| 1051 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidation, ShouldDoFullPaintInv
alidation); | 1007 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidation, ShouldDoFullPaintInv
alidation); |
| 1052 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO
verflowForPaint); | 1008 ADD_BOOLEAN_BITFIELD(shouldInvalidateOverflowForPaint, ShouldInvalidateO
verflowForPaint); |
| 1053 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, S
houldDoFullPaintInvalidationIfSelfPaintingLayer); | 1009 ADD_BOOLEAN_BITFIELD(shouldDoFullPaintInvalidationIfSelfPaintingLayer, S
houldDoFullPaintInvalidationIfSelfPaintingLayer); |
| 1054 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation)
; | 1010 ADD_BOOLEAN_BITFIELD(mayNeedPaintInvalidation, MayNeedPaintInvalidation)
; |
| 1055 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit
ionedMovementLayout); | 1011 ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, OnlyNeededPosit
ionedMovementLayout); |
| 1056 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO
fChildren); | 1012 ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, NeededLayoutBecauseO
fChildren); |
| 1057 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem
entLayout); | 1013 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem
entLayout); |
| 1058 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); | 1014 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); |
| 1059 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); | 1015 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); |
| 1060 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor
malFlowLayout); | 1016 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor
malFlowLayout); |
| 1061 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths
Dirty); | 1017 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths
Dirty); |
| 1062 ADD_BOOLEAN_BITFIELD(floating, Floating); | |
| 1063 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO
verflowRecalcAfterStyleChange); | 1018 ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, SelfNeedsO
verflowRecalcAfterStyleChange); |
| 1064 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed
sOverflowRecalcAfterStyleChange); | 1019 ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, ChildNeed
sOverflowRecalcAfterStyleChange); |
| 1065 | 1020 |
| 1066 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); | 1021 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); |
| 1067 ADD_BOOLEAN_BITFIELD(isText, IsText); | 1022 ADD_BOOLEAN_BITFIELD(isText, IsText); |
| 1068 ADD_BOOLEAN_BITFIELD(isBox, IsBox); | 1023 ADD_BOOLEAN_BITFIELD(isBox, IsBox); |
| 1069 ADD_BOOLEAN_BITFIELD(isInline, IsInline); | 1024 ADD_BOOLEAN_BITFIELD(isInline, IsInline); |
| 1070 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); | 1025 ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); |
| 1071 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); | 1026 ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); |
| 1072 | 1027 |
| 1073 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); | 1028 ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); |
| 1074 ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the ca
se of overflow:auto/scroll/hidden | 1029 ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the ca
se of overflow:auto/scroll/hidden |
| 1075 ADD_BOOLEAN_BITFIELD(hasTransform, HasTransform); | 1030 ADD_BOOLEAN_BITFIELD(hasTransform, HasTransform); |
| 1076 | 1031 |
| 1077 ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout); | 1032 ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout); |
| 1078 ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty); | 1033 ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty); |
| 1079 | 1034 |
| 1080 ADD_BOOLEAN_BITFIELD(layoutDidGetCalled, LayoutDidGetCalled); | 1035 ADD_BOOLEAN_BITFIELD(layoutDidGetCalled, LayoutDidGetCalled); |
| 1081 | 1036 |
| 1082 ADD_BOOLEAN_BITFIELD(hasPendingResourceUpdate, HasPendingResourceUpdate)
; | |
| 1083 | |
| 1084 // from RenderBlock | 1037 // from RenderBlock |
| 1085 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); | 1038 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); |
| 1086 ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns); | |
| 1087 | 1039 |
| 1088 // from RenderInline | 1040 // from RenderInline |
| 1089 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForRenderInline, AlwaysCreateL
ineBoxesForRenderInline); | 1041 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForRenderInline, AlwaysCreateL
ineBoxesForRenderInline); |
| 1090 | 1042 |
| 1091 private: | 1043 private: |
| 1092 unsigned m_positionedState : 2; // PositionedState | 1044 unsigned m_positionedState : 2; // PositionedState |
| 1093 unsigned m_selectionState : 3; // SelectionState | 1045 unsigned m_selectionState : 3; // SelectionState |
| 1094 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS
tate | 1046 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS
tate |
| 1095 | 1047 |
| 1096 public: | 1048 public: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 // This stores the paint invalidation rect from the previous layout. | 1085 // This stores the paint invalidation rect from the previous layout. |
| 1134 LayoutRect m_previousPaintInvalidationRect; | 1086 LayoutRect m_previousPaintInvalidationRect; |
| 1135 | 1087 |
| 1136 // This stores the position in the paint invalidation container's coordinate
. | 1088 // This stores the position in the paint invalidation container's coordinate
. |
| 1137 // It is used to detect renderer shifts that forces a full invalidation. | 1089 // It is used to detect renderer shifts that forces a full invalidation. |
| 1138 LayoutPoint m_previousPositionFromPaintInvalidationContainer; | 1090 LayoutPoint m_previousPositionFromPaintInvalidationContainer; |
| 1139 | 1091 |
| 1140 static unsigned s_instanceCount; | 1092 static unsigned s_instanceCount; |
| 1141 }; | 1093 }; |
| 1142 | 1094 |
| 1143 // FIXME: remove this once the render object lifecycle ASSERTS are no longer hit
. | |
| 1144 class DeprecatedDisableModifyRenderTreeStructureAsserts { | |
| 1145 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); | |
| 1146 public: | |
| 1147 DeprecatedDisableModifyRenderTreeStructureAsserts(); | |
| 1148 | |
| 1149 static bool canModifyRenderTreeStateInAnyState(); | |
| 1150 | |
| 1151 private: | |
| 1152 TemporaryChange<bool> m_disabler; | |
| 1153 }; | |
| 1154 | |
| 1155 // Allow equality comparisons of RenderObjects by reference or pointer, intercha
ngeably. | 1095 // Allow equality comparisons of RenderObjects by reference or pointer, intercha
ngeably. |
| 1156 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(RenderObject) | 1096 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(RenderObject) |
| 1157 | 1097 |
| 1158 inline bool RenderObject::documentBeingDestroyed() const | 1098 inline bool RenderObject::documentBeingDestroyed() const |
| 1159 { | 1099 { |
| 1160 return document().lifecycle().state() >= DocumentLifecycle::Stopping; | 1100 return document().lifecycle().state() >= DocumentLifecycle::Stopping; |
| 1161 } | 1101 } |
| 1162 | 1102 |
| 1163 // setNeedsLayout() won't cause full paint invalidations as | 1103 // setNeedsLayout() won't cause full paint invalidations as |
| 1164 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. | 1104 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 void showTree(const blink::RenderObject*); | 1211 void showTree(const blink::RenderObject*); |
| 1272 void showLineTree(const blink::RenderObject*); | 1212 void showLineTree(const blink::RenderObject*); |
| 1273 void showRenderTree(const blink::RenderObject* object1); | 1213 void showRenderTree(const blink::RenderObject* object1); |
| 1274 // We don't make object2 an optional parameter so that showRenderTree | 1214 // We don't make object2 an optional parameter so that showRenderTree |
| 1275 // can be called from gdb easily. | 1215 // can be called from gdb easily. |
| 1276 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); | 1216 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); |
| 1277 | 1217 |
| 1278 #endif | 1218 #endif |
| 1279 | 1219 |
| 1280 #endif // RenderObject_h | 1220 #endif // RenderObject_h |
| OLD | NEW |