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

Side by Side Diff: third_party/WebKit/WebCore/rendering/RenderObject.h

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
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 Apple Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 IntRect clip; 108 IntRect clip;
109 int type; 109 int type;
110 }; 110 };
111 #endif 111 #endif
112 112
113 // Base class for all rendering tree objects. 113 // Base class for all rendering tree objects.
114 class RenderObject : public CachedResourceClient { 114 class RenderObject : public CachedResourceClient {
115 friend class RenderBlock; 115 friend class RenderBlock;
116 friend class RenderContainer; 116 friend class RenderContainer;
117 friend class RenderLayer; 117 friend class RenderLayer;
118 friend class RenderObjectChildList;
118 friend class RenderSVGContainer; 119 friend class RenderSVGContainer;
119 public: 120 public:
120 // Anonymous objects should pass the document as their node, and they will t hen automatically be 121 // Anonymous objects should pass the document as their node, and they will t hen automatically be
121 // marked as anonymous in the constructor. 122 // marked as anonymous in the constructor.
122 RenderObject(Node*); 123 RenderObject(Node*);
123 virtual ~RenderObject(); 124 virtual ~RenderObject();
124 125
125 virtual const char* renderName() const { return "RenderObject"; } 126 virtual const char* renderName() const { return "RenderObject"; }
126 127
127 RenderObject* parent() const { return m_parent; } 128 RenderObject* parent() const { return m_parent; }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 virtual int staticX() const { return 0; } 207 virtual int staticX() const { return 0; }
207 virtual int staticY() const { return 0; } 208 virtual int staticY() const { return 0; }
208 209
209 // RenderObject tree manipulation 210 // RenderObject tree manipulation
210 ////////////////////////////////////////// 211 //////////////////////////////////////////
211 virtual bool canHaveChildren() const { return virtualChildren(); } 212 virtual bool canHaveChildren() const { return virtualChildren(); }
212 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true ; } 213 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true ; }
213 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) ; 214 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) ;
214 virtual void removeChild(RenderObject*); 215 virtual void removeChild(RenderObject*);
215 virtual bool createsAnonymousWrapper() const { return false; } 216 virtual bool createsAnonymousWrapper() const { return false; }
216
217 // raw tree manipulation
218 virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true) ;
219 virtual void appendChildNode(RenderObject*, bool fullAppend = true);
220 virtual void insertChildNode(RenderObject* child, RenderObject* before, bool fullInsert = true);
221 // Designed for speed. Don't waste time doing a bunch of work like layer up dating and repainting when we know that our
222 // change in parentage is not going to affect anything.
223 virtual void moveChildNode(RenderObject*);
224 ////////////////////////////////////////// 217 //////////////////////////////////////////
225 218
226 protected: 219 protected:
227 ////////////////////////////////////////// 220 //////////////////////////////////////////
228 // Helper functions. Dangerous to use! 221 // Helper functions. Dangerous to use!
229 void setPreviousSibling(RenderObject* previous) { m_previous = previous; } 222 void setPreviousSibling(RenderObject* previous) { m_previous = previous; }
230 void setNextSibling(RenderObject* next) { m_next = next; } 223 void setNextSibling(RenderObject* next) { m_next = next; }
231 void setParent(RenderObject* parent) { m_parent = parent; } 224 void setParent(RenderObject* parent) { m_parent = parent; }
232 ////////////////////////////////////////// 225 //////////////////////////////////////////
233 private: 226 private:
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 */ 370 */
378 RenderObject* container() const; 371 RenderObject* container() const;
379 virtual RenderObject* hoverAncestor() const { return parent(); } 372 virtual RenderObject* hoverAncestor() const { return parent(); }
380 373
381 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0); 374 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0);
382 void setNeedsLayout(bool b, bool markParents = true); 375 void setNeedsLayout(bool b, bool markParents = true);
383 void setChildNeedsLayout(bool b, bool markParents = true); 376 void setChildNeedsLayout(bool b, bool markParents = true);
384 void setNeedsPositionedMovementLayout(); 377 void setNeedsPositionedMovementLayout();
385 void setPrefWidthsDirty(bool, bool markParents = true); 378 void setPrefWidthsDirty(bool, bool markParents = true);
386 void invalidateContainerPrefWidths(); 379 void invalidateContainerPrefWidths();
387 virtual void invalidateCounters() { }
388 380
389 void setNeedsLayoutAndPrefWidthsRecalc() 381 void setNeedsLayoutAndPrefWidthsRecalc()
390 { 382 {
391 setNeedsLayout(true); 383 setNeedsLayout(true);
392 setPrefWidthsDirty(true); 384 setPrefWidthsDirty(true);
393 } 385 }
394 386
395 void setPositioned(bool b = true) { m_positioned = b; } 387 void setPositioned(bool b = true) { m_positioned = b; }
396 void setRelPositioned(bool b = true) { m_relPositioned = b; } 388 void setRelPositioned(bool b = true) { m_relPositioned = b; }
397 void setFloating(bool b = true) { m_floating = b; } 389 void setFloating(bool b = true) { m_floating = b; }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 } 994 }
1003 995
1004 } // namespace WebCore 996 } // namespace WebCore
1005 997
1006 #ifndef NDEBUG 998 #ifndef NDEBUG
1007 // Outside the WebCore namespace for ease of invocation from gdb. 999 // Outside the WebCore namespace for ease of invocation from gdb.
1008 void showTree(const WebCore::RenderObject*); 1000 void showTree(const WebCore::RenderObject*);
1009 #endif 1001 #endif
1010 1002
1011 #endif // RenderObject_h 1003 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/rendering/RenderInline.cpp ('k') | third_party/WebKit/WebCore/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698