| OLD | NEW |
| (Empty) |
| 1 // Copyright 2011, Google Inc. | |
| 2 // All rights reserved. | |
| 3 // | |
| 4 // Redistribution and use in source and binary forms, with or without | |
| 5 // modification, are permitted provided that the following conditions are | |
| 6 // met: | |
| 7 // | |
| 8 // * Redistributions of source code must retain the above copyright | |
| 9 // notice, this list of conditions and the following disclaimer. | |
| 10 // * Redistributions in binary form must reproduce the above | |
| 11 // copyright notice, this list of conditions and the following disclaimer | |
| 12 // in the documentation and/or other materials provided with the | |
| 13 // distribution. | |
| 14 // * Neither the name of Google Inc. nor the names of its | |
| 15 // contributors may be used to endorse or promote products derived from | |
| 16 // this software without specific prior written permission. | |
| 17 // | |
| 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 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. | |
| 29 | |
| 30 #include "config.h" | |
| 31 #include "bindings/core/dart/DartCSSRule.h" | |
| 32 | |
| 33 #include "bindings/core/dart/DartCSSCharsetRule.h" | |
| 34 #include "bindings/core/dart/DartCSSFontFaceRule.h" | |
| 35 #include "bindings/core/dart/DartCSSImportRule.h" | |
| 36 #include "bindings/core/dart/DartCSSKeyframeRule.h" | |
| 37 #include "bindings/core/dart/DartCSSKeyframesRule.h" | |
| 38 #include "bindings/core/dart/DartCSSMediaRule.h" | |
| 39 #include "bindings/core/dart/DartCSSPageRule.h" | |
| 40 #include "bindings/core/dart/DartCSSStyleRule.h" | |
| 41 #include "bindings/core/dart/DartCSSSupportsRule.h" | |
| 42 #include "bindings/core/dart/DartCSSViewportRule.h" | |
| 43 #include "bindings/core/dart/DartWebKitCSSFilterRule.h" | |
| 44 | |
| 45 namespace blink { | |
| 46 | |
| 47 Dart_Handle DartCSSRule::createWrapper(DartDOMData* domData, CSSRule* impl) | |
| 48 { | |
| 49 if (!impl) | |
| 50 return Dart_Null(); | |
| 51 | |
| 52 switch (impl->type()) { | |
| 53 case CSSRule::UNKNOWN_RULE: | |
| 54 // CSSUnknownRule.idl is explicitly excluded as it doesn't add anything | |
| 55 // over CSSRule.idl (see WebCore.gyp/WebCore.gyp: 'bindings_idl_files'). | |
| 56 // -> Use the base class wrapper here. | |
| 57 return DartDOMWrapper::createWrapper<DartCSSRule>(domData, impl); | |
| 58 case CSSRule::STYLE_RULE: | |
| 59 return DartCSSStyleRule::createWrapper(domData, static_cast<CSSStyleRule
*>(impl)); | |
| 60 case CSSRule::CHARSET_RULE: | |
| 61 return DartCSSCharsetRule::createWrapper(domData, static_cast<CSSCharset
Rule*>(impl)); | |
| 62 case CSSRule::IMPORT_RULE: | |
| 63 return DartCSSImportRule::createWrapper(domData, static_cast<CSSImportRu
le*>(impl)); | |
| 64 case CSSRule::MEDIA_RULE: | |
| 65 return DartCSSMediaRule::createWrapper(domData, static_cast<CSSMediaRule
*>(impl)); | |
| 66 case CSSRule::FONT_FACE_RULE: | |
| 67 return DartCSSFontFaceRule::createWrapper(domData, static_cast<CSSFontFa
ceRule*>(impl)); | |
| 68 case CSSRule::PAGE_RULE: | |
| 69 return DartCSSPageRule::createWrapper(domData, static_cast<CSSPageRule*>
(impl)); | |
| 70 case CSSRule::KEYFRAME_RULE: | |
| 71 return DartCSSKeyframeRule::createWrapper(domData, static_cast<CSSKeyfra
meRule*>(impl)); | |
| 72 case CSSRule::KEYFRAMES_RULE: | |
| 73 return DartCSSKeyframesRule::createWrapper(domData, static_cast<CSSKeyfr
amesRule*>(impl)); | |
| 74 case CSSRule::SUPPORTS_RULE: | |
| 75 return DartCSSSupportsRule::createWrapper(domData, static_cast<CSSSuppor
tsRule*>(impl)); | |
| 76 case CSSRule::VIEWPORT_RULE: | |
| 77 return DartCSSViewportRule::createWrapper(domData, static_cast<CSSViewpo
rtRule*>(impl)); | |
| 78 case CSSRule::WEBKIT_FILTER_RULE: | |
| 79 return DartWebKitCSSFilterRule::createWrapper(domData, static_cast<CSSFi
lterRule*>(impl)); | |
| 80 } | |
| 81 return DartDOMWrapper::createWrapper<DartCSSRule>(domData, impl); | |
| 82 } | |
| 83 | |
| 84 } | |
| OLD | NEW |