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 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2454 case Node::DOCUMENT_NODE: | 2454 case Node::DOCUMENT_NODE: |
2455 case Node::DOCUMENT_FRAGMENT_NODE: | 2455 case Node::DOCUMENT_FRAGMENT_NODE: |
2456 return toContainerNode(this)->countChildren(); | 2456 return toContainerNode(this)->countChildren(); |
2457 case Node::DOCUMENT_TYPE_NODE: | 2457 case Node::DOCUMENT_TYPE_NODE: |
2458 return 0; | 2458 return 0; |
2459 } | 2459 } |
2460 ASSERT_NOT_REACHED(); | 2460 ASSERT_NOT_REACHED(); |
2461 return 0; | 2461 return 0; |
2462 } | 2462 } |
2463 | 2463 |
2464 v8::Handle<v8::Object> Node::wrap(v8::Handle<v8::Object> creationContext, v8::Is
olate* isolate) | 2464 v8::Local<v8::Object> Node::wrap(v8::Local<v8::Object> creationContext, v8::Isol
ate* isolate) |
2465 { | 2465 { |
2466 // It's possible that no one except for the new wrapper owns this object at | 2466 // It's possible that no one except for the new wrapper owns this object at |
2467 // this moment, so we have to prevent GC to collect this object until the | 2467 // this moment, so we have to prevent GC to collect this object until the |
2468 // object gets associated with the wrapper. | 2468 // object gets associated with the wrapper. |
2469 RefPtrWillBeRawPtr<Node> protect(this); | 2469 RefPtrWillBeRawPtr<Node> protect(this); |
2470 | 2470 |
2471 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); | 2471 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); |
2472 | 2472 |
2473 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); | 2473 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); |
2474 | 2474 |
2475 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creati
onContext, wrapperType, this); | 2475 v8::Local<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creatio
nContext, wrapperType, this); |
2476 if (UNLIKELY(wrapper.IsEmpty())) | 2476 if (UNLIKELY(wrapper.IsEmpty())) |
2477 return wrapper; | 2477 return wrapper; |
2478 | 2478 |
2479 wrapperType->installConditionallyEnabledProperties(wrapper, isolate); | 2479 wrapperType->installConditionallyEnabledProperties(wrapper, isolate); |
2480 return associateWithWrapper(isolate, wrapperType, wrapper); | 2480 return associateWithWrapper(isolate, wrapperType, wrapper); |
2481 } | 2481 } |
2482 | 2482 |
2483 v8::Handle<v8::Object> Node::associateWithWrapper(v8::Isolate* isolate, const Wr
apperTypeInfo* wrapperType, v8::Handle<v8::Object> wrapper) | 2483 v8::Local<v8::Object> Node::associateWithWrapper(v8::Isolate* isolate, const Wra
pperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) |
2484 { | 2484 { |
2485 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
wrapper); | 2485 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
wrapper); |
2486 } | 2486 } |
2487 | 2487 |
2488 } // namespace blink | 2488 } // namespace blink |
2489 | 2489 |
2490 #ifndef NDEBUG | 2490 #ifndef NDEBUG |
2491 | 2491 |
2492 void showNode(const blink::Node* node) | 2492 void showNode(const blink::Node* node) |
2493 { | 2493 { |
2494 if (node) | 2494 if (node) |
2495 node->showNode(""); | 2495 node->showNode(""); |
2496 } | 2496 } |
2497 | 2497 |
2498 void showTree(const blink::Node* node) | 2498 void showTree(const blink::Node* node) |
2499 { | 2499 { |
2500 if (node) | 2500 if (node) |
2501 node->showTreeForThis(); | 2501 node->showTreeForThis(); |
2502 } | 2502 } |
2503 | 2503 |
2504 void showNodePath(const blink::Node* node) | 2504 void showNodePath(const blink::Node* node) |
2505 { | 2505 { |
2506 if (node) | 2506 if (node) |
2507 node->showNodePathForThis(); | 2507 node->showNodePathForThis(); |
2508 } | 2508 } |
2509 | 2509 |
2510 #endif | 2510 #endif |
OLD | NEW |