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

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

Issue 948053002: Revert 190605 "Make RenderObject::style() return a const object" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 5 years, 10 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 | « trunk/Source/core/layout/LayoutMedia.cpp ('k') | trunk/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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili ty() == BackfaceVisibilityHidden; } 594 bool hasHiddenBackface() const { return style() && style()->backfaceVisibili ty() == BackfaceVisibilityHidden; }
595 595
596 bool hasFilter() const { return style() && style()->hasFilter(); } 596 bool hasFilter() const { return style() && style()->hasFilter(); }
597 597
598 bool hasShapeOutside() const { return style() && style()->shapeOutside(); } 598 bool hasShapeOutside() const { return style() && style()->shapeOutside(); }
599 599
600 inline bool preservesNewline() const; 600 inline bool preservesNewline() const;
601 601
602 // The pseudo element style can be cached or uncached. Use the cached metho d if the pseudo element doesn't respect 602 // The pseudo element style can be cached or uncached. Use the cached metho d if the pseudo element doesn't respect
603 // any pseudo classes (and therefore has no concept of changing state). 603 // any pseudo classes (and therefore has no concept of changing state).
604 LayoutStyle* getCachedPseudoStyle(PseudoId, const LayoutStyle* parentStyle = 0) const; 604 LayoutStyle* getCachedPseudoStyle(PseudoId, LayoutStyle* parentStyle = 0) co nst;
605 PassRefPtr<LayoutStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, co nst LayoutStyle* parentStyle = 0, const LayoutStyle* ownStyle = 0) const; 605 PassRefPtr<LayoutStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, La youtStyle* parentStyle = 0, LayoutStyle* ownStyle = 0) const;
606 606
607 virtual void updateDragState(bool dragOn); 607 virtual void updateDragState(bool dragOn);
608 608
609 RenderView* view() const { return document().renderView(); }; 609 RenderView* view() const { return document().renderView(); };
610 FrameView* frameView() const { return document().view(); }; 610 FrameView* frameView() const { return document().view(); };
611 611
612 bool isRooted() const; 612 bool isRooted() const;
613 613
614 Node* node() const 614 Node* node() const
615 { 615 {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 virtual IntRect absoluteFocusRingBoundingBoxRect() const; 791 virtual IntRect absoluteFocusRingBoundingBoxRect() const;
792 792
793 static FloatRect absoluteBoundingBoxRectForRange(const Range*); 793 static FloatRect absoluteBoundingBoxRectForRange(const Range*);
794 794
795 // the rect that will be painted if this object is passed as the paintingRoo t 795 // the rect that will be painted if this object is passed as the paintingRoo t
796 LayoutRect paintingRootRect(LayoutRect& topLevelRect); 796 LayoutRect paintingRootRect(LayoutRect& topLevelRect);
797 797
798 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } 798 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; }
799 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } 799 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; }
800 800
801 const LayoutStyle* style() const { return m_style.get(); } 801 LayoutStyle* style() const { return m_style.get(); }
802 LayoutStyle* mutableStyle() const { return m_style.get(); }
803 802
804 // m_style can only be nullptr before the first style is set, thus most 803 // m_style can only be nullptr before the first style is set, thus most
805 // callers will never see a nullptr style and should use styleRef(). 804 // callers will never see a nullptr style and should use styleRef().
806 // FIXME: It would be better if style() returned a const reference. 805 // FIXME: It would be better if style() returned a const reference.
807 const LayoutStyle& styleRef() const { return mutableStyleRef(); } 806 const LayoutStyle& styleRef() const { return mutableStyleRef(); }
808 LayoutStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; } 807 LayoutStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; }
809 808
810 /* The following methods are inlined in LayoutObjectInlines.h */ 809 /* The following methods are inlined in LayoutObjectInlines.h */
811 const LayoutStyle* firstLineStyle() const; 810 LayoutStyle* firstLineStyle() const;
812 const LayoutStyle& firstLineStyleRef() const; 811 const LayoutStyle& firstLineStyleRef() const;
813 const LayoutStyle* style(bool firstLine) const; 812 LayoutStyle* style(bool firstLine) const;
814 const LayoutStyle& styleRef(bool firstLine) const; 813 const LayoutStyle& styleRef(bool firstLine) const;
815 814
816 static inline Color resolveColor(const LayoutStyle& styleToUse, int colorPro perty) 815 static inline Color resolveColor(const LayoutStyle& styleToUse, int colorPro perty)
817 { 816 {
818 return styleToUse.visitedDependentColor(colorProperty); 817 return styleToUse.visitedDependentColor(colorProperty);
819 } 818 }
820 819
821 inline Color resolveColor(int colorProperty) const 820 inline Color resolveColor(int colorProperty) const
822 { 821 {
823 return style()->visitedDependentColor(colorProperty); 822 return style()->visitedDependentColor(colorProperty);
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 void showTree(const blink::LayoutObject*); 1632 void showTree(const blink::LayoutObject*);
1634 void showLineTree(const blink::LayoutObject*); 1633 void showLineTree(const blink::LayoutObject*);
1635 void showRenderTree(const blink::LayoutObject* object1); 1634 void showRenderTree(const blink::LayoutObject* object1);
1636 // We don't make object2 an optional parameter so that showRenderTree 1635 // We don't make object2 an optional parameter so that showRenderTree
1637 // can be called from gdb easily. 1636 // can be called from gdb easily.
1638 void showRenderTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1637 void showRenderTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1639 1638
1640 #endif 1639 #endif
1641 1640
1642 #endif // LayoutObject_h 1641 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « trunk/Source/core/layout/LayoutMedia.cpp ('k') | trunk/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698