| OLD | NEW |
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // 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 13 matching lines...) Expand all Loading... |
| 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "bindings/dart/DartDOMWrapper.h" | 31 #include "bindings/dart/DartDOMWrapper.h" |
| 32 | 32 |
| 33 #include "DartCSSStyleDeclaration.h" | 33 #include "DartCSSStyleDeclaration.h" |
| 34 #include "DartCustomElement.h" | |
| 35 #include "DartDOMException.h" | 34 #include "DartDOMException.h" |
| 36 #include "DartHTMLElement.h" | 35 #include "DartHTMLElement.h" |
| 37 #include "DartNode.h" | 36 #include "DartNode.h" |
| 38 #include "bindings/dart/DartUtilities.h" | 37 #include "bindings/dart/DartUtilities.h" |
| 39 #include "core/html/HTMLFormControlElement.h" | 38 #include "core/html/HTMLFormControlElement.h" |
| 40 #include "core/html/LabelableElement.h" | 39 #include "core/html/LabelableElement.h" |
| 41 | 40 |
| 42 #include <stdio.h> | 41 #include <stdio.h> |
| 43 #include <wtf/text/WTFString.h> | 42 #include <wtf/text/WTFString.h> |
| 44 | 43 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 type = Dart_GetType(library, Dart_NewStringFromCString(className), 0, 0)
; | 61 type = Dart_GetType(library, Dart_NewStringFromCString(className), 0, 0)
; |
| 63 ASSERT(!Dart_IsError(type)); | 62 ASSERT(!Dart_IsError(type)); |
| 64 | 63 |
| 65 persistentType = Dart_NewPersistentHandle(type); | 64 persistentType = Dart_NewPersistentHandle(type); |
| 66 (*table)[index] = persistentType; | 65 (*table)[index] = persistentType; |
| 67 } | 66 } |
| 68 | 67 |
| 69 return type; | 68 return type; |
| 70 } | 69 } |
| 71 | 70 |
| 72 Dart_WeakPersistentHandle DartDOMWrapper::lookupCustomElementWrapper( | |
| 73 DartDOMData* domData, Dart_WeakPersistentHandle wrapper, Node* domObject) | |
| 74 { | |
| 75 ASSERT(wrapper); | |
| 76 ASSERT(domObject->isCustomElement()); | |
| 77 return DartCustomElement::lookupWrapper(domData, wrapper, reinterpret_cast<E
lement*>(domObject)); | |
| 78 } | |
| 79 | |
| 80 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(ExceptionCode exception
Code) | 71 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(ExceptionCode exception
Code) |
| 81 { | 72 { |
| 82 ASSERT(exceptionCode > 0); | 73 ASSERT(exceptionCode > 0); |
| 83 | 74 |
| 84 // FIXME: Get a better exception message here. | 75 // FIXME: Get a better exception message here. |
| 85 RefPtr<DOMException> domException = DOMException::create(exceptionCode, "Int
ernal Dartium Exception"); | 76 RefPtr<DOMException> domException = DOMException::create(exceptionCode, "Int
ernal Dartium Exception"); |
| 86 | 77 |
| 87 return DartDOMException::toDart(domException); | 78 return DartDOMException::toDart(domException); |
| 88 } | 79 } |
| 89 | 80 |
| 90 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(DartExceptionState& exc
eptionState) | 81 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(DartExceptionState& exc
eptionState) |
| 91 { | 82 { |
| 92 return exceptionCodeToDartException(exceptionState.code()); | 83 return exceptionCodeToDartException(exceptionState.code()); |
| 93 } | 84 } |
| 94 | 85 |
| 95 } | 86 } |
| OLD | NEW |