| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 return 0; | 235 return 0; |
| 236 if (const QualifiedName* htmlName = findHTMLTagNameOfV8Type(type)) | 236 if (const QualifiedName* htmlName = findHTMLTagNameOfV8Type(type)) |
| 237 return htmlName; | 237 return htmlName; |
| 238 #if ENABLE(SVG) | 238 #if ENABLE(SVG) |
| 239 if (const QualifiedName* svgName = findSVGTagNameOfV8Type(type)) | 239 if (const QualifiedName* svgName = findSVGTagNameOfV8Type(type)) |
| 240 return svgName; | 240 return svgName; |
| 241 #endif | 241 #endif |
| 242 return 0; | 242 return 0; |
| 243 } | 243 } |
| 244 | 244 |
| 245 bool CustomElementHelpers::isCustomElement(Element* element) |
| 246 { |
| 247 // FIXME: This dynamically consults the "is" attribute; instead a |
| 248 // bit should be marked on elements that are Custom Elements |
| 249 return CustomElementRegistry::isCustomTagName(element->localName()) || Custo
mElementRegistry::isCustomTagName(element->getAttribute(HTMLNames::isAttr)); |
| 250 } |
| 251 |
| 245 void CustomElementHelpers::invokeReadyCallbackIfNeeded(Element* element, v8::Han
dle<v8::Context> context) | 252 void CustomElementHelpers::invokeReadyCallbackIfNeeded(Element* element, v8::Han
dle<v8::Context> context) |
| 246 { | 253 { |
| 247 v8::Handle<v8::Value> wrapperValue = toV8(element, context->Global(), contex
t->GetIsolate()); | 254 v8::Handle<v8::Value> wrapperValue = toV8(element, context->Global(), contex
t->GetIsolate()); |
| 248 if (wrapperValue.IsEmpty() || !wrapperValue->IsObject()) | 255 if (wrapperValue.IsEmpty() || !wrapperValue->IsObject()) |
| 249 return; | 256 return; |
| 250 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(wrapperValue); | 257 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(wrapperValue); |
| 251 v8::Handle<v8::Value> prototypeValue = wrapper->GetPrototype(); | 258 v8::Handle<v8::Value> prototypeValue = wrapper->GetPrototype(); |
| 252 if (prototypeValue.IsEmpty() || !prototypeValue->IsObject()) | 259 if (prototypeValue.IsEmpty() || !prototypeValue->IsObject()) |
| 253 return; | 260 return; |
| 254 v8::Handle<v8::Object> prototype = v8::Handle<v8::Object>::Cast(prototypeVal
ue); | 261 v8::Handle<v8::Object> prototype = v8::Handle<v8::Object>::Cast(prototypeVal
ue); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 274 return; | 281 return; |
| 275 v8::Context::Scope scope(context); | 282 v8::Context::Scope scope(context); |
| 276 | 283 |
| 277 for (size_t i = 0; i < invocations.size(); ++i) { | 284 for (size_t i = 0; i < invocations.size(); ++i) { |
| 278 ASSERT(executionContext == invocations[i].element()->document()); | 285 ASSERT(executionContext == invocations[i].element()->document()); |
| 279 invokeReadyCallbackIfNeeded(invocations[i].element(), context); | 286 invokeReadyCallbackIfNeeded(invocations[i].element(), context); |
| 280 } | 287 } |
| 281 } | 288 } |
| 282 | 289 |
| 283 } // namespace WebCore | 290 } // namespace WebCore |
| OLD | NEW |