OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "bindings/core/v8/V8ProcessingInstruction.h" | 47 #include "bindings/core/v8/V8ProcessingInstruction.h" |
48 #include "bindings/core/v8/V8SVGElement.h" | 48 #include "bindings/core/v8/V8SVGElement.h" |
49 #include "bindings/core/v8/V8ShadowRoot.h" | 49 #include "bindings/core/v8/V8ShadowRoot.h" |
50 #include "bindings/core/v8/V8Text.h" | 50 #include "bindings/core/v8/V8Text.h" |
51 #include "core/dom/Document.h" | 51 #include "core/dom/Document.h" |
52 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 52 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
53 #include "core/dom/shadow/ShadowRoot.h" | 53 #include "core/dom/shadow/ShadowRoot.h" |
54 #include "core/events/EventListener.h" | 54 #include "core/events/EventListener.h" |
55 #include "wtf/RefPtr.h" | 55 #include "wtf/RefPtr.h" |
56 | 56 |
57 namespace WebCore { | 57 namespace blink { |
58 | 58 |
59 // These functions are custom to prevent a wrapper lookup of the return value wh
ich is always | 59 // These functions are custom to prevent a wrapper lookup of the return value wh
ich is always |
60 // part of the arguments. | 60 // part of the arguments. |
61 v8::Handle<v8::Object> wrap(Node* impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) | 61 v8::Handle<v8::Object> wrap(Node* impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) |
62 { | 62 { |
63 ASSERT(impl); | 63 ASSERT(impl); |
64 switch (impl->nodeType()) { | 64 switch (impl->nodeType()) { |
65 case Node::ELEMENT_NODE: | 65 case Node::ELEMENT_NODE: |
66 // For performance reasons, this is inlined from V8Element::wrap and mus
t remain in sync. | 66 // For performance reasons, this is inlined from V8Element::wrap and mus
t remain in sync. |
67 if (impl->isHTMLElement()) | 67 if (impl->isHTMLElement()) |
(...skipping 16 matching lines...) Expand all Loading... |
84 case Node::DOCUMENT_TYPE_NODE: | 84 case Node::DOCUMENT_TYPE_NODE: |
85 return wrap(toDocumentType(impl), creationContext, isolate); | 85 return wrap(toDocumentType(impl), creationContext, isolate); |
86 case Node::DOCUMENT_FRAGMENT_NODE: | 86 case Node::DOCUMENT_FRAGMENT_NODE: |
87 if (impl->isShadowRoot()) | 87 if (impl->isShadowRoot()) |
88 return wrap(toShadowRoot(impl), creationContext, isolate); | 88 return wrap(toShadowRoot(impl), creationContext, isolate); |
89 return wrap(toDocumentFragment(impl), creationContext, isolate); | 89 return wrap(toDocumentFragment(impl), creationContext, isolate); |
90 } | 90 } |
91 ASSERT_NOT_REACHED(); | 91 ASSERT_NOT_REACHED(); |
92 return V8Node::createWrapper(impl, creationContext, isolate); | 92 return V8Node::createWrapper(impl, creationContext, isolate); |
93 } | 93 } |
94 } // namespace WebCore | 94 } // namespace blink |
OLD | NEW |