| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 WebElement WebDocument::createElement(const WebString& tagName) | 120 WebElement WebDocument::createElement(const WebString& tagName) |
| 121 { | 121 { |
| 122 TrackExceptionState exceptionState; | 122 TrackExceptionState exceptionState; |
| 123 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); | 123 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); |
| 124 if (exceptionState.hadException()) | 124 if (exceptionState.hadException()) |
| 125 return WebElement(); | 125 return WebElement(); |
| 126 return element; | 126 return element; |
| 127 } | 127 } |
| 128 | 128 |
| 129 v8::Handle<v8::Value> WebDocument::registerEmbedderCustomElement(const WebString
& name, v8::Handle<v8::Value> options, WebExceptionCode& ec) | |
| 130 { | |
| 131 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | |
| 132 Document* document = unwrap<Document>(); | |
| 133 Dictionary dictionary(options, isolate); | |
| 134 TrackExceptionState exceptionState; | |
| 135 ScriptValue constructor = document->registerElement(ScriptState::current(iso
late), name, dictionary, exceptionState, CustomElement::EmbedderNames); | |
| 136 ec = exceptionState.code(); | |
| 137 if (exceptionState.hadException()) | |
| 138 return v8::Handle<v8::Value>(); | |
| 139 return constructor.v8Value(); | |
| 140 } | |
| 141 | |
| 142 void WebDocument::pauseAnimationsForTesting(double pauseTime) const { | 129 void WebDocument::pauseAnimationsForTesting(double pauseTime) const { |
| 143 constUnwrap<Document>()->frame()->view()->updateLayoutAndStyleForPainting(); | 130 constUnwrap<Document>()->frame()->view()->updateLayoutAndStyleForPainting(); |
| 144 constUnwrap<Document>()->timeline().pauseAnimationsForTesting(pauseTime); | 131 constUnwrap<Document>()->timeline().pauseAnimationsForTesting(pauseTime); |
| 145 } | 132 } |
| 146 | 133 |
| 147 WebDocument::WebDocument(const PassRefPtr<Document>& elem) | 134 WebDocument::WebDocument(const PassRefPtr<Document>& elem) |
| 148 : WebNode(elem) | 135 : WebNode(elem) |
| 149 { | 136 { |
| 150 } | 137 } |
| 151 | 138 |
| 152 WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem) | 139 WebDocument& WebDocument::operator=(const PassRefPtr<Document>& elem) |
| 153 { | 140 { |
| 154 m_private = elem; | 141 m_private = elem; |
| 155 return *this; | 142 return *this; |
| 156 } | 143 } |
| 157 | 144 |
| 158 WebDocument::operator PassRefPtr<Document>() const | 145 WebDocument::operator PassRefPtr<Document>() const |
| 159 { | 146 { |
| 160 return toDocument(m_private.get()); | 147 return toDocument(m_private.get()); |
| 161 } | 148 } |
| 162 | 149 |
| 163 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |