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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 ASSERT(!m_constructor.IsEmpty()); | 228 ASSERT(!m_constructor.IsEmpty()); |
229 | 229 |
230 return m_callbacks->setBinding(definition, CustomElementBinding::create(m_co
ntext->GetIsolate(), m_prototype, m_wrapperType)); | 230 return m_callbacks->setBinding(definition, CustomElementBinding::create(m_co
ntext->GetIsolate(), m_prototype, m_wrapperType)); |
231 } | 231 } |
232 | 232 |
233 ScriptValue CustomElementConstructorBuilder::bindingsReturnValue() const | 233 ScriptValue CustomElementConstructorBuilder::bindingsReturnValue() const |
234 { | 234 { |
235 return ScriptValue(m_constructor, m_context->GetIsolate()); | 235 return ScriptValue(m_constructor, m_context->GetIsolate()); |
236 } | 236 } |
237 | 237 |
238 bool CustomElementConstructorBuilder::hasValidPrototypeChainFor(WrapperTypeInfo*
type) const | 238 bool CustomElementConstructorBuilder::hasValidPrototypeChainFor(const WrapperTyp
eInfo* type) const |
239 { | 239 { |
240 v8::Handle<v8::Object> elementPrototype = V8PerContextData::from(m_context)-
>prototypeForType(type); | 240 v8::Handle<v8::Object> elementPrototype = V8PerContextData::from(m_context)-
>prototypeForType(type); |
241 if (elementPrototype.IsEmpty()) | 241 if (elementPrototype.IsEmpty()) |
242 return false; | 242 return false; |
243 | 243 |
244 v8::Handle<v8::Value> chain = m_prototype; | 244 v8::Handle<v8::Value> chain = m_prototype; |
245 while (!chain.IsEmpty() && chain->IsObject()) { | 245 while (!chain.IsEmpty() && chain->IsObject()) { |
246 if (chain == elementPrototype) | 246 if (chain == elementPrototype) |
247 return true; | 247 return true; |
248 chain = chain.As<v8::Object>()->GetPrototype(); | 248 chain = chain.As<v8::Object>()->GetPrototype(); |
(...skipping 24 matching lines...) Expand all Loading... |
273 | 273 |
274 ExceptionState es(args.GetIsolate()); | 274 ExceptionState es(args.GetIsolate()); |
275 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 275 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
276 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m
aybeType->IsNull() ? nullAtom : type, es); | 276 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m
aybeType->IsNull() ? nullAtom : type, es); |
277 if (es.throwIfNeeded()) | 277 if (es.throwIfNeeded()) |
278 return; | 278 return; |
279 v8SetReturnValueFast(args, element.release(), document); | 279 v8SetReturnValueFast(args, element.release(), document); |
280 } | 280 } |
281 | 281 |
282 } // namespace WebCore | 282 } // namespace WebCore |
OLD | NEW |