OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 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) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 unsigned m_bitfields; | 125 unsigned m_bitfields; |
126 unsigned m_bitfields2; | 126 unsigned m_bitfields2; |
127 LayoutRect rect; // Stores the previous paint invalidation rect. | 127 LayoutRect rect; // Stores the previous paint invalidation rect. |
128 LayoutPoint position; // Stores the previous position from the paint invalid
ation container. | 128 LayoutPoint position; // Stores the previous position from the paint invalid
ation container. |
129 }; | 129 }; |
130 | 130 |
131 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObj
ect_should_stay_small); | 131 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObj
ect_should_stay_small); |
132 | 132 |
133 bool RenderObject::s_affectsParentBlock = false; | 133 bool RenderObject::s_affectsParentBlock = false; |
134 | 134 |
135 #if !ENABLE(OILPAN) | |
136 void* RenderObject::operator new(size_t sz) | 135 void* RenderObject::operator new(size_t sz) |
137 { | 136 { |
138 ASSERT(isMainThread()); | 137 ASSERT(isMainThread()); |
139 return partitionAlloc(Partitions::getRenderingPartition(), sz); | 138 return partitionAlloc(Partitions::getRenderingPartition(), sz); |
140 } | 139 } |
141 | 140 |
142 void RenderObject::operator delete(void* ptr) | 141 void RenderObject::operator delete(void* ptr) |
143 { | 142 { |
144 ASSERT(isMainThread()); | 143 ASSERT(isMainThread()); |
145 partitionFree(ptr); | 144 partitionFree(ptr); |
146 } | 145 } |
147 #endif | |
148 | 146 |
149 RenderObject* RenderObject::createObject(Element* element, RenderStyle* style) | 147 RenderObject* RenderObject::createObject(Element* element, RenderStyle* style) |
150 { | 148 { |
151 ASSERT(isAllowedToModifyRenderTreeStructure(element->document())); | 149 ASSERT(isAllowedToModifyRenderTreeStructure(element->document())); |
152 | 150 |
153 // Minimal support for content properties replacing an entire element. | 151 // Minimal support for content properties replacing an entire element. |
154 // Works only if we have exactly one piece of content and it's a URL. | 152 // Works only if we have exactly one piece of content and it's a URL. |
155 // Otherwise acts as if we didn't support this feature. | 153 // Otherwise acts as if we didn't support this feature. |
156 const ContentData* contentData = style->contentData(); | 154 const ContentData* contentData = style->contentData(); |
157 if (contentData && !contentData->next() && contentData->isImage() && !elemen
t->isPseudoElement()) { | 155 if (contentData && !contentData->next() && contentData->isImage() && !elemen
t->isPseudoElement()) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 206 |
209 return 0; | 207 return 0; |
210 } | 208 } |
211 | 209 |
212 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, renderObjectCounter, ("Rend
erObject")); | 210 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, renderObjectCounter, ("Rend
erObject")); |
213 | 211 |
214 RenderObject::RenderObject(Node* node) | 212 RenderObject::RenderObject(Node* node) |
215 : ImageResourceClient() | 213 : ImageResourceClient() |
216 , m_style(nullptr) | 214 , m_style(nullptr) |
217 , m_node(node) | 215 , m_node(node) |
218 , m_parent(nullptr) | 216 , m_parent(0) |
219 , m_previous(nullptr) | 217 , m_previous(0) |
220 , m_next(nullptr) | 218 , m_next(0) |
221 #if ENABLE(ASSERT) | 219 #if ENABLE(ASSERT) |
222 , m_hasAXObject(false) | 220 , m_hasAXObject(false) |
223 , m_setNeedsLayoutForbidden(false) | 221 , m_setNeedsLayoutForbidden(false) |
224 #endif | 222 #endif |
225 , m_bitfields(node) | 223 , m_bitfields(node) |
226 { | 224 { |
227 #ifndef NDEBUG | 225 #ifndef NDEBUG |
228 renderObjectCounter.increment(); | 226 renderObjectCounter.increment(); |
229 #endif | 227 #endif |
230 } | 228 } |
231 | 229 |
232 RenderObject::~RenderObject() | 230 RenderObject::~RenderObject() |
233 { | 231 { |
234 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRender
Object(this); | 232 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->removeRender
Object(this); |
235 ASSERT(!m_hasAXObject); | 233 ASSERT(!m_hasAXObject); |
236 #ifndef NDEBUG | 234 #ifndef NDEBUG |
237 renderObjectCounter.decrement(); | 235 renderObjectCounter.decrement(); |
238 #endif | 236 #endif |
239 } | 237 } |
240 | 238 |
241 void RenderObject::trace(Visitor* visitor) | |
242 { | |
243 visitor->trace(m_node); | |
244 visitor->trace(m_parent); | |
245 visitor->trace(m_previous); | |
246 visitor->trace(m_next); | |
247 } | |
248 | |
249 String RenderObject::debugName() const | 239 String RenderObject::debugName() const |
250 { | 240 { |
251 StringBuilder name; | 241 StringBuilder name; |
252 name.append(renderName()); | 242 name.append(renderName()); |
253 | 243 |
254 if (Node* node = this->node()) { | 244 if (Node* node = this->node()) { |
255 name.append(' '); | 245 name.append(' '); |
256 name.append(node->debugName()); | 246 name.append(node->debugName()); |
257 } | 247 } |
258 | 248 |
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 } | 2833 } |
2844 | 2834 |
2845 if (StyleImage* borderImage = m_style->borderImage().image()) | 2835 if (StyleImage* borderImage = m_style->borderImage().image()) |
2846 borderImage->removeClient(this); | 2836 borderImage->removeClient(this); |
2847 | 2837 |
2848 if (StyleImage* maskBoxImage = m_style->maskBoxImage().image()) | 2838 if (StyleImage* maskBoxImage = m_style->maskBoxImage().image()) |
2849 maskBoxImage->removeClient(this); | 2839 maskBoxImage->removeClient(this); |
2850 | 2840 |
2851 removeShapeImageClient(m_style->shapeOutside()); | 2841 removeShapeImageClient(m_style->shapeOutside()); |
2852 } | 2842 } |
2853 #if !ENABLE(OILPAN) | 2843 |
2854 delete this; | 2844 delete this; |
2855 #endif | |
2856 } | 2845 } |
2857 | 2846 |
2858 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&) | 2847 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&) |
2859 { | 2848 { |
2860 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); | 2849 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); |
2861 } | 2850 } |
2862 | 2851 |
2863 void RenderObject::updateDragState(bool dragOn) | 2852 void RenderObject::updateDragState(bool dragOn) |
2864 { | 2853 { |
2865 bool valueChanged = (dragOn != isDragging()); | 2854 bool valueChanged = (dragOn != isDragging()); |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3464 { | 3453 { |
3465 if (object1) { | 3454 if (object1) { |
3466 const blink::RenderObject* root = object1; | 3455 const blink::RenderObject* root = object1; |
3467 while (root->parent()) | 3456 while (root->parent()) |
3468 root = root->parent(); | 3457 root = root->parent(); |
3469 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3458 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3470 } | 3459 } |
3471 } | 3460 } |
3472 | 3461 |
3473 #endif | 3462 #endif |
OLD | NEW |