| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 { | 144 { |
| 145 ASSERT(!m_prototype.IsEmpty()); | 145 ASSERT(!m_prototype.IsEmpty()); |
| 146 | 146 |
| 147 RefPtr<Document> protect(document); | 147 RefPtr<Document> protect(document); |
| 148 | 148 |
| 149 v8::TryCatch exceptionCatcher; | 149 v8::TryCatch exceptionCatcher; |
| 150 exceptionCatcher.SetVerbose(true); | 150 exceptionCatcher.SetVerbose(true); |
| 151 | 151 |
| 152 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 152 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 153 v8::Handle<v8::Function> created = retrieveCallback(isolate, "createdCallbac
k"); | 153 v8::Handle<v8::Function> created = retrieveCallback(isolate, "createdCallbac
k"); |
| 154 v8::Handle<v8::Function> enteredDocument = retrieveCallback(isolate, "entere
dDocumentCallback"); |
| 155 v8::Handle<v8::Function> leftDocument = retrieveCallback(isolate, "leftDocum
entCallback"); |
| 154 v8::Handle<v8::Function> attributeChanged = retrieveCallback(isolate, "attri
buteChangedCallback"); | 156 v8::Handle<v8::Function> attributeChanged = retrieveCallback(isolate, "attri
buteChangedCallback"); |
| 155 | 157 |
| 156 return V8CustomElementLifecycleCallbacks::create(document, m_prototype, crea
ted, attributeChanged); | 158 return V8CustomElementLifecycleCallbacks::create(document, m_prototype, crea
ted, enteredDocument, leftDocument, attributeChanged); |
| 157 } | 159 } |
| 158 | 160 |
| 159 v8::Handle<v8::Function> CustomElementConstructorBuilder::retrieveCallback(v8::I
solate* isolate, const char* name) | 161 v8::Handle<v8::Function> CustomElementConstructorBuilder::retrieveCallback(v8::I
solate* isolate, const char* name) |
| 160 { | 162 { |
| 161 v8::Handle<v8::Value> value = m_prototype->Get(v8String(name, isolate)); | 163 v8::Handle<v8::Value> value = m_prototype->Get(v8String(name, isolate)); |
| 162 if (value.IsEmpty() || !value->IsFunction()) | 164 if (value.IsEmpty() || !value->IsFunction()) |
| 163 return v8::Handle<v8::Function>(); | 165 return v8::Handle<v8::Function>(); |
| 164 return v8::Handle<v8::Function>::Cast(value); | 166 return v8::Handle<v8::Function>::Cast(value); |
| 165 } | 167 } |
| 166 | 168 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 292 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| 291 RefPtr<Element> element = document->createElementNS(namespaceURI, name, mayb
eType->IsNull() ? nullAtom : type, ec); | 293 RefPtr<Element> element = document->createElementNS(namespaceURI, name, mayb
eType->IsNull() ? nullAtom : type, ec); |
| 292 if (ec) { | 294 if (ec) { |
| 293 setDOMException(ec, isolate); | 295 setDOMException(ec, isolate); |
| 294 return; | 296 return; |
| 295 } | 297 } |
| 296 v8SetReturnValue(args, toV8Fast(element.release(), args, document)); | 298 v8SetReturnValue(args, toV8Fast(element.release(), args, document)); |
| 297 } | 299 } |
| 298 | 300 |
| 299 } // namespace WebCore | 301 } // namespace WebCore |
| OLD | NEW |