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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 #endif | 257 #endif |
258 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter); | 258 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter); |
259 } | 259 } |
260 | 260 |
261 Node::~Node() | 261 Node::~Node() |
262 { | 262 { |
263 // With Oilpan, the rare data finalizer also asserts for | 263 // With Oilpan, the rare data finalizer also asserts for |
264 // this condition (we cannot directly access it here.) | 264 // this condition (we cannot directly access it here.) |
265 RELEASE_ASSERT(hasRareData() || !layoutObject()); | 265 RELEASE_ASSERT(hasRareData() || !layoutObject()); |
266 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter); | 266 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter); |
267 if (!hasRareData() && !hasLayoutObject() && m_data.m_computedStyle) | |
esprehn
2016/08/05 21:26:26
!hasLayoutObject() doesn't make sense here, you ca
Bugs Nash
2016/08/12 03:55:33
Done
| |
268 m_data.m_computedStyle->deref(); | |
267 } | 269 } |
268 | 270 |
269 NodeRareData* Node::rareData() const | 271 NodeRareData* Node::rareData() const |
270 { | 272 { |
271 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); | 273 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); |
272 return static_cast<NodeRareData*>(m_data.m_rareData); | 274 return static_cast<NodeRareData*>(m_data.m_rareData); |
273 } | 275 } |
274 | 276 |
275 NodeRareData& Node::ensureRareData() | 277 NodeRareData& Node::ensureRareData() |
276 { | 278 { |
277 if (hasRareData()) | 279 if (hasRareData()) |
278 return *rareData(); | 280 return *rareData(); |
279 | 281 |
280 if (isElementNode()) | 282 if (isElementNode()) |
281 m_data.m_rareData = ElementRareData::create(m_data.m_layoutObject); | 283 m_data.m_rareData = ElementRareData::create(layoutObject()); |
282 else | 284 else |
283 m_data.m_rareData = NodeRareData::create(m_data.m_layoutObject); | 285 m_data.m_rareData = NodeRareData::create(layoutObject()); |
284 | 286 |
285 DCHECK(m_data.m_rareData); | 287 DCHECK(m_data.m_rareData); |
286 | 288 |
287 setFlag(HasRareDataFlag); | 289 setFlag(HasRareDataFlag); |
288 return *rareData(); | 290 return *rareData(); |
289 } | 291 } |
290 | 292 |
291 Node* Node::toNode() | 293 Node* Node::toNode() |
292 { | 294 { |
293 return this; | 295 return this; |
(...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2503 | 2505 |
2504 void showNodePath(const blink::Node* node) | 2506 void showNodePath(const blink::Node* node) |
2505 { | 2507 { |
2506 if (node) | 2508 if (node) |
2507 node->showNodePathForThis(); | 2509 node->showNodePathForThis(); |
2508 else | 2510 else |
2509 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2511 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
2510 } | 2512 } |
2511 | 2513 |
2512 #endif | 2514 #endif |
OLD | NEW |