| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // part of the arguments. | 53 // part of the arguments. |
| 54 v8::Handle<v8::Object> wrap(Node* impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) | 54 v8::Handle<v8::Object> wrap(Node* impl, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate) |
| 55 { | 55 { |
| 56 ASSERT(impl); | 56 ASSERT(impl); |
| 57 switch (impl->nodeType()) { | 57 switch (impl->nodeType()) { |
| 58 case Node::ELEMENT_NODE: | 58 case Node::ELEMENT_NODE: |
| 59 // For performance reasons, this is inlined from V8Element::wrap and mus
t remain in sync. | 59 // For performance reasons, this is inlined from V8Element::wrap and mus
t remain in sync. |
| 60 if (impl->isHTMLElement()) | 60 if (impl->isHTMLElement()) |
| 61 return wrap(toHTMLElement(impl), creationContext, isolate); | 61 return wrap(toHTMLElement(impl), creationContext, isolate); |
| 62 return V8Element::createWrapper(toElement(impl), creationContext, isolat
e); | 62 return V8Element::createWrapper(toElement(impl), creationContext, isolat
e); |
| 63 case Node::ATTRIBUTE_NODE: | |
| 64 return wrap(toAttr(impl), creationContext, isolate); | |
| 65 case Node::TEXT_NODE: | 63 case Node::TEXT_NODE: |
| 66 return wrap(toText(impl), creationContext, isolate); | 64 return wrap(toText(impl), creationContext, isolate); |
| 67 case Node::DOCUMENT_NODE: | 65 case Node::DOCUMENT_NODE: |
| 68 return wrap(toDocument(impl), creationContext, isolate); | 66 return wrap(toDocument(impl), creationContext, isolate); |
| 69 case Node::DOCUMENT_FRAGMENT_NODE: | 67 case Node::DOCUMENT_FRAGMENT_NODE: |
| 70 if (impl->isShadowRoot()) | 68 if (impl->isShadowRoot()) |
| 71 return wrap(toShadowRoot(impl), creationContext, isolate); | 69 return wrap(toShadowRoot(impl), creationContext, isolate); |
| 72 return wrap(toDocumentFragment(impl), creationContext, isolate); | 70 return wrap(toDocumentFragment(impl), creationContext, isolate); |
| 73 } | 71 } |
| 74 ASSERT_NOT_REACHED(); | 72 ASSERT_NOT_REACHED(); |
| 75 return V8Node::createWrapper(impl, creationContext, isolate); | 73 return V8Node::createWrapper(impl, creationContext, isolate); |
| 76 } | 74 } |
| 77 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |