| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 WebElement WebDocument::createElement(const WebString& tagName) | 130 WebElement WebDocument::createElement(const WebString& tagName) |
| 131 { | 131 { |
| 132 TrackExceptionState exceptionState; | 132 TrackExceptionState exceptionState; |
| 133 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); | 133 WebElement element(unwrap<Document>()->createElement(tagName, exceptionState
)); |
| 134 if (exceptionState.hadException()) | 134 if (exceptionState.hadException()) |
| 135 return WebElement(); | 135 return WebElement(); |
| 136 return element; | 136 return element; |
| 137 } | 137 } |
| 138 | 138 |
| 139 WebSize WebDocument::scrollOffset() const | |
| 140 { | |
| 141 if (FrameView* view = constUnwrap<Document>()->view()) | |
| 142 return view->scrollOffset(); | |
| 143 return WebSize(); | |
| 144 } | |
| 145 | |
| 146 WebSize WebDocument::minimumScrollOffset() const | |
| 147 { | |
| 148 if (FrameView* view = constUnwrap<Document>()->view()) | |
| 149 return toIntSize(view->minimumScrollPosition()); | |
| 150 return WebSize(); | |
| 151 } | |
| 152 | |
| 153 WebSize WebDocument::maximumScrollOffset() const | |
| 154 { | |
| 155 if (FrameView* view = constUnwrap<Document>()->view()) | |
| 156 return toIntSize(view->maximumScrollPosition()); | |
| 157 return WebSize(); | |
| 158 } | |
| 159 | |
| 160 v8::Handle<v8::Value> WebDocument::registerEmbedderCustomElement(const WebString
& name, v8::Handle<v8::Value> options, WebExceptionCode& ec) | 139 v8::Handle<v8::Value> WebDocument::registerEmbedderCustomElement(const WebString
& name, v8::Handle<v8::Value> options, WebExceptionCode& ec) |
| 161 { | 140 { |
| 162 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 141 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 163 Document* document = unwrap<Document>(); | 142 Document* document = unwrap<Document>(); |
| 164 Dictionary dictionary(options, isolate); | 143 Dictionary dictionary(options, isolate); |
| 165 TrackExceptionState exceptionState; | 144 TrackExceptionState exceptionState; |
| 166 ScriptValue constructor = document->registerElement(ScriptState::current(iso
late), name, dictionary, exceptionState, CustomElement::EmbedderNames); | 145 ScriptValue constructor = document->registerElement(ScriptState::current(iso
late), name, dictionary, exceptionState, CustomElement::EmbedderNames); |
| 167 ec = exceptionState.code(); | 146 ec = exceptionState.code(); |
| 168 if (exceptionState.hadException()) | 147 if (exceptionState.hadException()) |
| 169 return v8::Handle<v8::Value>(); | 148 return v8::Handle<v8::Value>(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 180 m_private = elem; | 159 m_private = elem; |
| 181 return *this; | 160 return *this; |
| 182 } | 161 } |
| 183 | 162 |
| 184 WebDocument::operator PassRefPtr<Document>() const | 163 WebDocument::operator PassRefPtr<Document>() const |
| 185 { | 164 { |
| 186 return toDocument(m_private.get()); | 165 return toDocument(m_private.get()); |
| 187 } | 166 } |
| 188 | 167 |
| 189 } // namespace blink | 168 } // namespace blink |
| OLD | NEW |