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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 #endif | 265 #endif |
266 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter); | 266 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter); |
267 } | 267 } |
268 | 268 |
269 Node::~Node() | 269 Node::~Node() |
270 { | 270 { |
271 // With Oilpan, the rare data finalizer also asserts for | 271 // With Oilpan, the rare data finalizer also asserts for |
272 // this condition (we cannot directly access it here.) | 272 // this condition (we cannot directly access it here.) |
273 RELEASE_ASSERT(hasRareData() || !layoutObject()); | 273 RELEASE_ASSERT(hasRareData() || !layoutObject()); |
274 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter); | 274 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter); |
275 if (!hasRareData() && m_data.m_computedStyle) | |
276 m_data.m_computedStyle->deref(); | |
277 } | 275 } |
278 | 276 |
279 NodeRareData* Node::rareData() const | 277 NodeRareData* Node::rareData() const |
280 { | 278 { |
281 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); | 279 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); |
282 return static_cast<NodeRareData*>(m_data.m_rareData); | 280 return static_cast<NodeRareData*>(m_data.m_rareData); |
283 } | 281 } |
284 | 282 |
285 NodeRareData& Node::ensureRareData() | 283 NodeRareData& Node::ensureRareData() |
286 { | 284 { |
287 if (hasRareData()) | 285 if (hasRareData()) |
288 return *rareData(); | 286 return *rareData(); |
289 | 287 |
290 if (isElementNode()) | 288 if (isElementNode()) |
291 m_data.m_rareData = ElementRareData::create(layoutObject()); | 289 m_data.m_rareData = ElementRareData::create(m_data.m_layoutObject); |
292 else | 290 else |
293 m_data.m_rareData = NodeRareData::create(layoutObject()); | 291 m_data.m_rareData = NodeRareData::create(m_data.m_layoutObject); |
294 | 292 |
295 DCHECK(m_data.m_rareData); | 293 DCHECK(m_data.m_rareData); |
296 | 294 |
297 setFlag(HasRareDataFlag); | 295 setFlag(HasRareDataFlag); |
298 return *rareData(); | 296 return *rareData(); |
299 } | 297 } |
300 | 298 |
301 Node* Node::toNode() | 299 Node* Node::toNode() |
302 { | 300 { |
303 return this; | 301 return this; |
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 if (node) { | 2410 if (node) { |
2413 std::stringstream stream; | 2411 std::stringstream stream; |
2414 node->printNodePathTo(stream); | 2412 node->printNodePathTo(stream); |
2415 LOG(INFO) << stream.str(); | 2413 LOG(INFO) << stream.str(); |
2416 } else { | 2414 } else { |
2417 LOG(INFO) << "Cannot showNodePath for <null>"; | 2415 LOG(INFO) << "Cannot showNodePath for <null>"; |
2418 } | 2416 } |
2419 } | 2417 } |
2420 | 2418 |
2421 #endif | 2419 #endif |
OLD | NEW |