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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 #endif | 236 #endif |
237 | 237 |
238 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 238 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
239 // children. | 239 // children. |
240 virtual RenderBlock* firstLineBlock() const; | 240 virtual RenderBlock* firstLineBlock() const; |
241 | 241 |
242 // Called when an object that was floating or positioned becomes a normal fl
ow object | 242 // Called when an object that was floating or positioned becomes a normal fl
ow object |
243 // again. We have to make sure the render tree updates as needed to accommo
date the new | 243 // again. We have to make sure the render tree updates as needed to accommo
date the new |
244 // normal flow object. | 244 // normal flow object. |
245 void handleDynamicFloatPositionChange(); | 245 void handleDynamicFloatPositionChange(); |
246 | 246 |
247 // RenderObject tree manipulation | 247 // RenderObject tree manipulation |
248 ////////////////////////////////////////// | 248 ////////////////////////////////////////// |
249 virtual bool canHaveChildren() const { return virtualChildren(); } | 249 virtual bool canHaveChildren() const { return virtualChildren(); } |
250 virtual bool canHaveGeneratedChildren() const; | 250 virtual bool canHaveGeneratedChildren() const; |
251 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true
; } | 251 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true
; } |
252 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; | 252 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; |
253 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } | 253 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild = 0) { return addChild(newChild, beforeChild); } |
254 virtual void removeChild(RenderObject*); | 254 virtual void removeChild(RenderObject*); |
255 virtual bool createsAnonymousWrapper() const { return false; } | 255 virtual bool createsAnonymousWrapper() const { return false; } |
256 ////////////////////////////////////////// | 256 ////////////////////////////////////////// |
257 | 257 |
258 protected: | 258 protected: |
259 ////////////////////////////////////////// | 259 ////////////////////////////////////////// |
260 // Helper functions. Dangerous to use! | 260 // Helper functions. Dangerous to use! |
261 void setPreviousSibling(RenderObject* previous) { m_previous = previous; } | 261 void setPreviousSibling(RenderObject* previous) { m_previous = previous; } |
262 void setNextSibling(RenderObject* next) { m_next = next; } | 262 void setNextSibling(RenderObject* next) { m_next = next; } |
263 void setParent(RenderObject* parent) | 263 void setParent(RenderObject* parent) |
264 { | 264 { |
265 m_parent = parent; | 265 m_parent = parent; |
266 | 266 |
267 // Only update if our flow thread state is different from our new parent
and if we're not a RenderFlowThread. | 267 // Only update if our flow thread state is different from our new parent
and if we're not a RenderFlowThread. |
268 // A RenderFlowThread is always considered to be inside itself, so it ne
ver has to change its state | 268 // A RenderFlowThread is always considered to be inside itself, so it ne
ver has to change its state |
269 // in response to parent changes. | 269 // in response to parent changes. |
270 FlowThreadState newState = parent ? parent->flowThreadState() : NotInsid
eFlowThread; | 270 FlowThreadState newState = parent ? parent->flowThreadState() : NotInsid
eFlowThread; |
271 if (newState != flowThreadState() && !isRenderFlowThread()) | 271 if (newState != flowThreadState() && !isRenderFlowThread()) |
272 setFlowThreadStateIncludingDescendants(newState); | 272 setFlowThreadStateIncludingDescendants(newState); |
273 } | 273 } |
274 | 274 |
275 ////////////////////////////////////////// | 275 ////////////////////////////////////////// |
276 private: | 276 private: |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 // coordinates instead of in repaint container coordinates. Eventually the | 492 // coordinates instead of in repaint container coordinates. Eventually the |
493 // rest of the rendering tree will move to a similar model. | 493 // rest of the rendering tree will move to a similar model. |
494 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F
loatPoint& pointInParent, HitTestAction); | 494 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F
loatPoint& pointInParent, HitTestAction); |
495 | 495 |
496 bool isAnonymous() const { return m_bitfields.isAnonymous(); } | 496 bool isAnonymous() const { return m_bitfields.isAnonymous(); } |
497 bool isAnonymousBlock() const | 497 bool isAnonymousBlock() const |
498 { | 498 { |
499 // This function is kept in sync with anonymous block creation condition
s in | 499 // This function is kept in sync with anonymous block creation condition
s in |
500 // RenderBlock::createAnonymousBlock(). This includes creating an anonym
ous | 500 // RenderBlock::createAnonymousBlock(). This includes creating an anonym
ous |
501 // RenderBlock having a BLOCK or BOX display. Other classes such as Rend
erTextFragment | 501 // RenderBlock having a BLOCK or BOX display. Other classes such as Rend
erTextFragment |
502 // are not RenderBlocks and will return false. See https://bugs.webkit.o
rg/show_bug.cgi?id=56709. | 502 // are not RenderBlocks and will return false. See https://bugs.webkit.o
rg/show_bug.cgi?id=56709. |
503 return isAnonymous() && (style()->display() == BLOCK || style()->display
() == BOX) && style()->styleType() == NOPSEUDO && isRenderBlock() && !isListMark
er() && !isRenderFlowThread() | 503 return isAnonymous() && (style()->display() == BLOCK || style()->display
() == BOX) && style()->styleType() == NOPSEUDO && isRenderBlock() && !isListMark
er() && !isRenderFlowThread() |
504 && !isRenderFullScreen() | 504 && !isRenderFullScreen() |
505 && !isRenderFullScreenPlaceholder(); | 505 && !isRenderFullScreenPlaceholder(); |
506 } | 506 } |
507 bool isAnonymousColumnsBlock() const { return style()->specifiesColumns() &&
isAnonymousBlock(); } | 507 bool isAnonymousColumnsBlock() const { return style()->specifiesColumns() &&
isAnonymousBlock(); } |
508 bool isAnonymousColumnSpanBlock() const { return style()->columnSpan() && is
AnonymousBlock(); } | 508 bool isAnonymousColumnSpanBlock() const { return style()->columnSpan() && is
AnonymousBlock(); } |
509 bool isElementContinuation() const { return node() && node()->renderer() !=
this; } | 509 bool isElementContinuation() const { return node() && node()->renderer() !=
this; } |
510 bool isInlineElementContinuation() const { return isElementContinuation() &&
isInline(); } | 510 bool isInlineElementContinuation() const { return isElementContinuation() &&
isInline(); } |
511 bool isBlockElementContinuation() const { return isElementContinuation() &&
!isInline(); } | 511 bool isBlockElementContinuation() const { return isElementContinuation() &&
!isInline(); } |
512 virtual RenderBoxModelObject* virtualContinuation() const { return 0; } | 512 virtual RenderBoxModelObject* virtualContinuation() const { return 0; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 bool needsPositionedMovementLayout() const { return m_bitfields.needsPositio
nedMovementLayout(); } | 552 bool needsPositionedMovementLayout() const { return m_bitfields.needsPositio
nedMovementLayout(); } |
553 bool needsPositionedMovementLayoutOnly() const | 553 bool needsPositionedMovementLayoutOnly() const |
554 { | 554 { |
555 return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.needs
Layout() && !m_bitfields.normalChildNeedsLayout() | 555 return m_bitfields.needsPositionedMovementLayout() && !m_bitfields.needs
Layout() && !m_bitfields.normalChildNeedsLayout() |
556 && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifie
dNormalFlowLayout(); | 556 && !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsSimplifie
dNormalFlowLayout(); |
557 } | 557 } |
558 | 558 |
559 bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout();
} | 559 bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout();
} |
560 bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimpl
ifiedNormalFlowLayout(); } | 560 bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimpl
ifiedNormalFlowLayout(); } |
561 bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLay
out(); } | 561 bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLay
out(); } |
562 | 562 |
563 bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogic
alWidthsDirty(); } | 563 bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogic
alWidthsDirty(); } |
564 | 564 |
565 bool isSelectionBorder() const; | 565 bool isSelectionBorder() const; |
566 | 566 |
567 bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip();
} | 567 bool hasClip() const { return isOutOfFlowPositioned() && style()->hasClip();
} |
568 bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); } | 568 bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); } |
569 bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip();
} | 569 bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip();
} |
570 | 570 |
571 bool hasTransform() const { return m_bitfields.hasTransform(); } | 571 bool hasTransform() const { return m_bitfields.hasTransform(); } |
572 bool hasMask() const { return style() && style()->hasMask(); } | 572 bool hasMask() const { return style() && style()->hasMask(); } |
573 bool hasClipPath() const { return style() && style()->clipPath(); } | 573 bool hasClipPath() const { return style() && style()->clipPath(); } |
574 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili
ty() == BackfaceVisibilityHidden; } | 574 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili
ty() == BackfaceVisibilityHidden; } |
575 | 575 |
576 bool hasFilter() const { return style() && style()->hasFilter(); } | 576 bool hasFilter() const { return style() && style()->hasFilter(); } |
577 | 577 |
578 bool hasBlendMode() const; | 578 bool hasBlendMode() const; |
579 | 579 |
580 inline bool preservesNewline() const; | 580 inline bool preservesNewline() const; |
581 | 581 |
582 // The pseudo element style can be cached or uncached. Use the cached metho
d if the pseudo element doesn't respect | 582 // The pseudo element style can be cached or uncached. Use the cached metho
d if the pseudo element doesn't respect |
583 // any pseudo classes (and therefore has no concept of changing state). | 583 // any pseudo classes (and therefore has no concept of changing state). |
584 RenderStyle* getCachedPseudoStyle(PseudoId, RenderStyle* parentStyle = 0) co
nst; | 584 RenderStyle* getCachedPseudoStyle(PseudoId, RenderStyle* parentStyle = 0) co
nst; |
585 PassRefPtr<RenderStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, Re
nderStyle* parentStyle = 0, RenderStyle* ownStyle = 0) const; | 585 PassRefPtr<RenderStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, Re
nderStyle* parentStyle = 0, RenderStyle* ownStyle = 0) const; |
586 | 586 |
587 virtual void updateDragState(bool dragOn); | 587 virtual void updateDragState(bool dragOn); |
588 | 588 |
589 RenderView* view() const { return document()->renderView(); }; | 589 RenderView* view() const { return document()->renderView(); }; |
590 | 590 |
591 // Returns true if this renderer is rooted, and optionally returns the hosti
ng view (the root of the hierarchy). | 591 // Returns true if this renderer is rooted, and optionally returns the hosti
ng view (the root of the hierarchy). |
592 bool isRooted(RenderView** = 0) const; | 592 bool isRooted(RenderView** = 0) const; |
593 | 593 |
594 Node* node() const { return isAnonymous() ? 0 : m_node; } | 594 Node* node() const { return isAnonymous() ? 0 : m_node; } |
595 Node* nonPseudoNode() const { return isPseudoElement() ? 0 : node(); } | 595 Node* nonPseudoNode() const { return isPseudoElement() ? 0 : node(); } |
596 | 596 |
(...skipping 20 matching lines...) Expand all Loading... |
617 | 617 |
618 Element* offsetParent() const; | 618 Element* offsetParent() const; |
619 | 619 |
620 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec
t* newRoot = 0); | 620 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec
t* newRoot = 0); |
621 void setNeedsLayout(bool needsLayout, MarkingBehavior = MarkContainingBlockC
hain); | 621 void setNeedsLayout(bool needsLayout, MarkingBehavior = MarkContainingBlockC
hain); |
622 void setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior = MarkContai
ningBlockChain); | 622 void setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior = MarkContai
ningBlockChain); |
623 void setNeedsPositionedMovementLayout(); | 623 void setNeedsPositionedMovementLayout(); |
624 void setNeedsSimplifiedNormalFlowLayout(); | 624 void setNeedsSimplifiedNormalFlowLayout(); |
625 void setPreferredLogicalWidthsDirty(bool, MarkingBehavior = MarkContainingBl
ockChain); | 625 void setPreferredLogicalWidthsDirty(bool, MarkingBehavior = MarkContainingBl
ockChain); |
626 void invalidateContainerPreferredLogicalWidths(); | 626 void invalidateContainerPreferredLogicalWidths(); |
627 | 627 |
628 void setNeedsLayoutAndPrefWidthsRecalc() | 628 void setNeedsLayoutAndPrefWidthsRecalc() |
629 { | 629 { |
630 setNeedsLayout(true); | 630 setNeedsLayout(true); |
631 setPreferredLogicalWidthsDirty(true); | 631 setPreferredLogicalWidthsDirty(true); |
632 } | 632 } |
633 | 633 |
634 void setPositionState(EPosition position) | 634 void setPositionState(EPosition position) |
635 { | 635 { |
636 ASSERT((position != AbsolutePosition && position != FixedPosition) || is
Box()); | 636 ASSERT((position != AbsolutePosition && position != FixedPosition) || is
Box()); |
637 m_bitfields.setPositionedState(position); | 637 m_bitfields.setPositionedState(position); |
(...skipping 21 matching lines...) Expand all Loading... |
659 void updateFillImages(const FillLayer*, const FillLayer*); | 659 void updateFillImages(const FillLayer*, const FillLayer*); |
660 void updateImage(StyleImage*, StyleImage*); | 660 void updateImage(StyleImage*, StyleImage*); |
661 | 661 |
662 virtual void paint(PaintInfo&, const LayoutPoint&); | 662 virtual void paint(PaintInfo&, const LayoutPoint&); |
663 | 663 |
664 // Recursive function that computes the size and position of this object and
all its descendants. | 664 // Recursive function that computes the size and position of this object and
all its descendants. |
665 virtual void layout(); | 665 virtual void layout(); |
666 | 666 |
667 /* This function performs a layout only if one is needed. */ | 667 /* This function performs a layout only if one is needed. */ |
668 void layoutIfNeeded() { if (needsLayout()) layout(); } | 668 void layoutIfNeeded() { if (needsLayout()) layout(); } |
669 | 669 |
670 // used for element state updates that cannot be fixed with a | 670 // used for element state updates that cannot be fixed with a |
671 // repaint and do not need a relayout | 671 // repaint and do not need a relayout |
672 virtual void updateFromElement() { } | 672 virtual void updateFromElement() { } |
673 | 673 |
674 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&); | 674 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&); |
675 void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&); | 675 void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&); |
676 | 676 |
677 bool isComposited() const; | 677 bool isComposited() const; |
678 | 678 |
679 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l
ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes
tAll); | 679 bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& l
ocationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTes
tAll); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 724 |
725 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. | 725 // Convert a local quad into the coordinate system of container, taking tran
sforms into account. |
726 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec
t* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const; | 726 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec
t* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const; |
727 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb
ject* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const; | 727 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb
ject* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const; |
728 | 728 |
729 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, | 729 // Return the offset from the container() renderer (excluding transforms). I
n multi-column layout, |
730 // different offsets apply at different points, so return the offset that ap
plies to the given point. | 730 // different offsets apply at different points, so return the offset that ap
plies to the given point. |
731 virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&, bo
ol* offsetDependsOnPoint = 0) const; | 731 virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&, bo
ol* offsetDependsOnPoint = 0) const; |
732 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. | 732 // Return the offset from an object up the container() chain. Asserts that n
one of the intermediate objects have transforms. |
733 LayoutSize offsetFromAncestorContainer(RenderObject*) const; | 733 LayoutSize offsetFromAncestorContainer(RenderObject*) const; |
734 | 734 |
735 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } | 735 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } |
736 | 736 |
737 // FIXME: useTransforms should go away eventually | 737 // FIXME: useTransforms should go away eventually |
738 IntRect absoluteBoundingBoxRect(bool useTransform = true) const; | 738 IntRect absoluteBoundingBoxRect(bool useTransform = true) const; |
739 IntRect absoluteBoundingBoxRectIgnoringTransforms() const { return absoluteB
oundingBoxRect(false); } | 739 IntRect absoluteBoundingBoxRectIgnoringTransforms() const { return absoluteB
oundingBoxRect(false); } |
740 | 740 |
741 // Build an array of quads in absolute coords for line boxes | 741 // Build an array of quads in absolute coords for line boxes |
742 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } | 742 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const
{ } |
743 | 743 |
744 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); | 744 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); |
745 | 745 |
746 static FloatRect absoluteBoundingBoxRectForRange(const Range*); | 746 static FloatRect absoluteBoundingBoxRectForRange(const Range*); |
747 | 747 |
748 // the rect that will be painted if this object is passed as the paintingRoo
t | 748 // the rect that will be painted if this object is passed as the paintingRoo
t |
749 LayoutRect paintingRootRect(LayoutRect& topLevelRect); | 749 LayoutRect paintingRootRect(LayoutRect& topLevelRect); |
750 | 750 |
751 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } | 751 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } |
752 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } | 752 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } |
753 | 753 |
754 RenderStyle* style() const { return m_style.get(); } | 754 RenderStyle* style() const { return m_style.get(); } |
755 RenderStyle* firstLineStyle() const { return document()->styleSheetCollectio
n()->usesFirstLineRules() ? cachedFirstLineStyle() : style(); } | 755 RenderStyle* firstLineStyle() const { return document()->styleSheetCollectio
n()->usesFirstLineRules() ? cachedFirstLineStyle() : style(); } |
756 RenderStyle* style(bool firstLine) const { return firstLine ? firstLineStyle
() : style(); } | 756 RenderStyle* style(bool firstLine) const { return firstLine ? firstLineStyle
() : style(); } |
757 | 757 |
| 758 inline Color resolveColor(const RenderStyle* styleToUse, int colorProperty)
const |
| 759 { |
| 760 return styleToUse->visitedDependentColor(colorProperty); |
| 761 } |
| 762 |
| 763 inline Color resolveColor(int colorProperty) const |
| 764 { |
| 765 return style()->visitedDependentColor(colorProperty); |
| 766 } |
| 767 |
| 768 inline Color resolveColor(int colorProperty, Color fallback) const |
| 769 { |
| 770 Color color = resolveColor(colorProperty); |
| 771 return color.isValid() ? color : fallback; |
| 772 } |
| 773 |
| 774 inline Color resolveColor(Color color) const |
| 775 { |
| 776 return color; |
| 777 } |
| 778 |
758 // Used only by Element::pseudoStyleCacheIsInvalid to get a first line style
based off of a | 779 // Used only by Element::pseudoStyleCacheIsInvalid to get a first line style
based off of a |
759 // given new style, without accessing the cache. | 780 // given new style, without accessing the cache. |
760 PassRefPtr<RenderStyle> uncachedFirstLineStyle(RenderStyle*) const; | 781 PassRefPtr<RenderStyle> uncachedFirstLineStyle(RenderStyle*) const; |
761 | 782 |
762 // Anonymous blocks that are part of of a continuation chain will return the
ir inline continuation's outline style instead. | 783 // Anonymous blocks that are part of of a continuation chain will return the
ir inline continuation's outline style instead. |
763 // This is typically only relevant when repainting. | 784 // This is typically only relevant when repainting. |
764 virtual RenderStyle* outlineStyleForRepaint() const { return style(); } | 785 virtual RenderStyle* outlineStyleForRepaint() const { return style(); } |
765 | 786 |
766 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; | 787 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; |
767 | 788 |
768 void getTextDecorationColors(int decorations, Color& underline, Color& overl
ine, Color& linethrough, bool quirksMode = false, bool firstlineStyle = false); | 789 void getTextDecorationColors(int decorations, Color& underline, Color& overl
ine, Color& linethrough, bool quirksMode = false, bool firstlineStyle = false); |
769 | 790 |
770 // Return the RenderLayerModelObject in the container chain which is respons
ible for painting this object, or 0 | 791 // Return the RenderLayerModelObject in the container chain which is respons
ible for painting this object, or 0 |
771 // if painting is root-relative. This is the container that should be passed
to the 'forRepaint' | 792 // if painting is root-relative. This is the container that should be passed
to the 'forRepaint' |
772 // methods. | 793 // methods. |
773 RenderLayerModelObject* containerForRepaint() const; | 794 RenderLayerModelObject* containerForRepaint() const; |
774 // Actually do the repaint of rect r for this object which has been computed
in the coordinate space | 795 // Actually do the repaint of rect r for this object which has been computed
in the coordinate space |
775 // of repaintContainer. If repaintContainer is 0, repaint via the view. | 796 // of repaintContainer. If repaintContainer is 0, repaint via the view. |
776 void repaintUsingContainer(const RenderLayerModelObject* repaintContainer, c
onst IntRect&) const; | 797 void repaintUsingContainer(const RenderLayerModelObject* repaintContainer, c
onst IntRect&) const; |
777 | 798 |
778 // Repaint the entire object. Called when, e.g., the color of a border chan
ges, or when a border | 799 // Repaint the entire object. Called when, e.g., the color of a border chan
ges, or when a border |
779 // style changes. | 800 // style changes. |
780 void repaint() const; | 801 void repaint() const; |
781 | 802 |
782 // Repaint a specific subrectangle within a given object. The rect |r| is i
n the object's coordinate space. | 803 // Repaint a specific subrectangle within a given object. The rect |r| is i
n the object's coordinate space. |
783 void repaintRectangle(const LayoutRect&) const; | 804 void repaintRectangle(const LayoutRect&) const; |
784 | 805 |
785 // Repaint only if our old bounds and new bounds are different. The caller m
ay pass in newBounds and newOutlineBox if they are known. | 806 // Repaint only if our old bounds and new bounds are different. The caller m
ay pass in newBounds and newOutlineBox if they are known. |
786 bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContain
er, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRe
ct* newBoundsPtr = 0, const LayoutRect* newOutlineBoxPtr = 0); | 807 bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContain
er, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRe
ct* newBoundsPtr = 0, const LayoutRect* newOutlineBoxPtr = 0); |
787 | 808 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 | 918 |
898 virtual int previousOffset(int current) const; | 919 virtual int previousOffset(int current) const; |
899 virtual int previousOffsetForBackwardDeletion(int current) const; | 920 virtual int previousOffsetForBackwardDeletion(int current) const; |
900 virtual int nextOffset(int current) const; | 921 virtual int nextOffset(int current) const; |
901 | 922 |
902 virtual void imageChanged(CachedImage*, const IntRect* = 0); | 923 virtual void imageChanged(CachedImage*, const IntRect* = 0); |
903 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } | 924 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { } |
904 virtual bool willRenderImage(CachedImage*); | 925 virtual bool willRenderImage(CachedImage*); |
905 | 926 |
906 void selectionStartEnd(int& spos, int& epos) const; | 927 void selectionStartEnd(int& spos, int& epos) const; |
907 | 928 |
908 void remove() { if (parent()) parent()->removeChild(this); } | 929 void remove() { if (parent()) parent()->removeChild(this); } |
909 | 930 |
910 AnimationController* animation() const; | 931 AnimationController* animation() const; |
911 | 932 |
912 bool isInert() const; | 933 bool isInert() const; |
913 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } | 934 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s
tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style()
->pointerEvents() != PE_NONE) && !isInert(); } |
914 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } | 935 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE &
& style()->pointerEvents() != PE_NONE && !isInert(); } |
915 | 936 |
916 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use | 937 // Map points and quads through elements, potentially via 3d transforms. You
should never need to call these directly; use |
917 // localToAbsolute/absoluteToLocal methods instead. | 938 // localToAbsolute/absoluteToLocal methods instead. |
918 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
0) const; | 939 virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContai
ner, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed =
0) const; |
919 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; | 940 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c
onst; |
920 | 941 |
921 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). | 942 // Pushes state onto RenderGeometryMap about how to map coordinates from thi
s renderer to its container, or ancestorToStopAt (whichever is encountered first
). |
922 // Returns the renderer which was mapped to (container or ancestorToStopAt). | 943 // Returns the renderer which was mapped to (container or ancestorToStopAt). |
923 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; | 944 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap&) const; |
924 | 945 |
925 bool shouldUseTransformFromContainer(const RenderObject* container) const; | 946 bool shouldUseTransformFromContainer(const RenderObject* container) const; |
926 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; | 947 void getTransformFromContainer(const RenderObject* container, const LayoutSi
ze& offsetInContainer, TransformationMatrix&) const; |
927 | 948 |
928 // return true if this object requires a new stacking context | 949 // return true if this object requires a new stacking context |
929 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || hasBlendMode(); } | 950 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter
() || hasBlendMode(); } |
930 | 951 |
931 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* addit
ionalOffset */, const RenderLayerModelObject* /* paintContainer */ = 0) { }; | 952 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* addit
ionalOffset */, const RenderLayerModelObject* /* paintContainer */ = 0) { }; |
932 | 953 |
933 LayoutRect absoluteOutlineBounds() const | 954 LayoutRect absoluteOutlineBounds() const |
934 { | 955 { |
935 return outlineBoundsForRepaint(0); | 956 return outlineBoundsForRepaint(0); |
936 } | 957 } |
937 | 958 |
938 // Return the renderer whose background style is used to paint the root back
ground. Should only be called on the renderer for which isRoot() is true. | 959 // Return the renderer whose background style is used to paint the root back
ground. Should only be called on the renderer for which isRoot() is true. |
939 RenderObject* rendererForRootBackground(); | 960 RenderObject* rendererForRootBackground(); |
940 | 961 |
941 RespectImageOrientationEnum shouldRespectImageOrientation() const; | 962 RespectImageOrientationEnum shouldRespectImageOrientation() const; |
942 | 963 |
943 protected: | 964 protected: |
944 inline bool layerCreationAllowedForSubtree() const; | 965 inline bool layerCreationAllowedForSubtree() const; |
945 | 966 |
946 // Overrides should call the superclass at the end | 967 // Overrides should call the superclass at the end |
947 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); | 968 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); |
948 // Overrides should call the superclass at the start | 969 // Overrides should call the superclass at the start |
949 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 970 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
950 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); | 971 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
951 | 972 |
952 void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, Bo
xSide, | 973 void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, Bo
xSide, |
953 Color, EBorderStyle, int adjbw1, int adjbw2, bool an
tialias = false); | 974 Color, EBorderStyle, int adjbw1, int adjbw2, bool an
tialias = false); |
954 | 975 |
955 void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*); | 976 void paintFocusRing(PaintInfo&, const LayoutPoint&, RenderStyle*); |
956 void paintOutline(PaintInfo&, const LayoutRect&); | 977 void paintOutline(PaintInfo&, const LayoutRect&); |
957 void addPDFURLRect(GraphicsContext*, const LayoutRect&); | 978 void addPDFURLRect(GraphicsContext*, const LayoutRect&); |
958 | 979 |
959 virtual LayoutRect viewRect() const; | 980 virtual LayoutRect viewRect() const; |
960 | 981 |
961 void adjustRectForOutlineAndShadow(LayoutRect&) const; | 982 void adjustRectForOutlineAndShadow(LayoutRect&) const; |
962 | 983 |
963 void clearLayoutRootIfNeeded() const; | 984 void clearLayoutRootIfNeeded() const; |
964 virtual void willBeDestroyed(); | 985 virtual void willBeDestroyed(); |
965 void arenaDelete(RenderArena*, void* objectBase); | 986 void arenaDelete(RenderArena*, void* objectBase); |
966 | 987 |
967 virtual bool canBeReplacedWithInlineRunIn() const; | 988 virtual bool canBeReplacedWithInlineRunIn() const; |
968 | 989 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 , m_hasCounterNodeMap(false) | 1062 , m_hasCounterNodeMap(false) |
1042 , m_everHadLayout(false) | 1063 , m_everHadLayout(false) |
1043 , m_childrenInline(false) | 1064 , m_childrenInline(false) |
1044 , m_hasColumns(false) | 1065 , m_hasColumns(false) |
1045 , m_positionedState(IsStaticallyPositioned) | 1066 , m_positionedState(IsStaticallyPositioned) |
1046 , m_selectionState(SelectionNone) | 1067 , m_selectionState(SelectionNone) |
1047 , m_flowThreadState(NotInsideFlowThread) | 1068 , m_flowThreadState(NotInsideFlowThread) |
1048 , m_boxDecorationState(NoBoxDecorations) | 1069 , m_boxDecorationState(NoBoxDecorations) |
1049 { | 1070 { |
1050 } | 1071 } |
1051 | 1072 |
1052 // 31 bits have been used here. There is one bit available. | 1073 // 31 bits have been used here. There is one bit available. |
1053 ADD_BOOLEAN_BITFIELD(needsLayout, NeedsLayout); | 1074 ADD_BOOLEAN_BITFIELD(needsLayout, NeedsLayout); |
1054 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem
entLayout); | 1075 ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovem
entLayout); |
1055 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); | 1076 ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); |
1056 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); | 1077 ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); |
1057 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor
malFlowLayout); | 1078 ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, NeedsSimplifiedNor
malFlowLayout); |
1058 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths
Dirty); | 1079 ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, PreferredLogicalWidths
Dirty); |
1059 ADD_BOOLEAN_BITFIELD(floating, Floating); | 1080 ADD_BOOLEAN_BITFIELD(floating, Floating); |
1060 | 1081 |
1061 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); | 1082 ADD_BOOLEAN_BITFIELD(isAnonymous, IsAnonymous); |
(...skipping 30 matching lines...) Expand all Loading... |
1092 | 1113 |
1093 void setPositionedState(int positionState) | 1114 void setPositionedState(int positionState) |
1094 { | 1115 { |
1095 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP
ositioned, saving one bit. | 1116 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP
ositioned, saving one bit. |
1096 m_positionedState = static_cast<PositionedState>(positionState & 0x3
); | 1117 m_positionedState = static_cast<PositionedState>(positionState & 0x3
); |
1097 } | 1118 } |
1098 void clearPositionedState() { m_positionedState = StaticPosition; } | 1119 void clearPositionedState() { m_positionedState = StaticPosition; } |
1099 | 1120 |
1100 ALWAYS_INLINE SelectionState selectionState() const { return static_cast
<SelectionState>(m_selectionState); } | 1121 ALWAYS_INLINE SelectionState selectionState() const { return static_cast
<SelectionState>(m_selectionState); } |
1101 ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_
selectionState = selectionState; } | 1122 ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_
selectionState = selectionState; } |
1102 | 1123 |
1103 ALWAYS_INLINE FlowThreadState flowThreadState() const { return static_ca
st<FlowThreadState>(m_flowThreadState); } | 1124 ALWAYS_INLINE FlowThreadState flowThreadState() const { return static_ca
st<FlowThreadState>(m_flowThreadState); } |
1104 ALWAYS_INLINE void setFlowThreadState(FlowThreadState flowThreadState) {
m_flowThreadState = flowThreadState; } | 1125 ALWAYS_INLINE void setFlowThreadState(FlowThreadState flowThreadState) {
m_flowThreadState = flowThreadState; } |
1105 | 1126 |
1106 ALWAYS_INLINE BoxDecorationState boxDecorationState() const { return sta
tic_cast<BoxDecorationState>(m_boxDecorationState); } | 1127 ALWAYS_INLINE BoxDecorationState boxDecorationState() const { return sta
tic_cast<BoxDecorationState>(m_boxDecorationState); } |
1107 ALWAYS_INLINE void setBoxDecorationState(BoxDecorationState boxDecoratio
nState) { m_boxDecorationState = boxDecorationState; } | 1128 ALWAYS_INLINE void setBoxDecorationState(BoxDecorationState boxDecoratio
nState) { m_boxDecorationState = boxDecorationState; } |
1108 }; | 1129 }; |
1109 | 1130 |
1110 #undef ADD_BOOLEAN_BITFIELD | 1131 #undef ADD_BOOLEAN_BITFIELD |
1111 | 1132 |
1112 RenderObjectBitfields m_bitfields; | 1133 RenderObjectBitfields m_bitfields; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 // Outside the WebCore namespace for ease of invocation from gdb. | 1330 // Outside the WebCore namespace for ease of invocation from gdb. |
1310 void showTree(const WebCore::RenderObject*); | 1331 void showTree(const WebCore::RenderObject*); |
1311 void showLineTree(const WebCore::RenderObject*); | 1332 void showLineTree(const WebCore::RenderObject*); |
1312 void showRenderTree(const WebCore::RenderObject* object1); | 1333 void showRenderTree(const WebCore::RenderObject* object1); |
1313 // We don't make object2 an optional parameter so that showRenderTree | 1334 // We don't make object2 an optional parameter so that showRenderTree |
1314 // can be called from gdb easily. | 1335 // can be called from gdb easily. |
1315 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO
bject* object2); | 1336 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO
bject* object2); |
1316 #endif | 1337 #endif |
1317 | 1338 |
1318 #endif // RenderObject_h | 1339 #endif // RenderObject_h |
OLD | NEW |