|         |      1 /* | 
|         |      2  * Copyright (C) 2006, 2007 Apple Inc.  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 | 
|         |      6  * are met: | 
|         |      7  * 1. Redistributions of source code must retain the above copyright | 
|         |      8  *    notice, this list of conditions and the following disclaimer. | 
|         |      9  * 2. Redistributions in binary form must reproduce the above copyright | 
|         |     10  *    notice, this list of conditions and the following disclaimer in the | 
|         |     11  *    documentation and/or other materials provided with the distribution. | 
|         |     12  * | 
|         |     13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 
|         |     14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 
|         |     15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 
|         |     16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 
|         |     17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 
|         |     18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 
|         |     19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 
|         |     20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 
|         |     21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
|         |     22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
|         |     23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  | 
|         |     24  */ | 
|         |     25  | 
|         |     26 #include "config.h" | 
|         |     27 #include "WebKitDLL.h" | 
|         |     28 #include "DOMHTMLClasses.h" | 
|         |     29 #include "COMPtr.h" | 
|         |     30  | 
|         |     31 #pragma warning(push, 0) | 
|         |     32 #include <WebCore/BString.h> | 
|         |     33 #include <WebCore/Document.h> | 
|         |     34 #include <WebCore/Element.h> | 
|         |     35 #include <WebCore/FrameView.h> | 
|         |     36 #include <WebCore/HTMLDocument.h> | 
|         |     37 #include <WebCore/HTMLFormElement.h> | 
|         |     38 #include <WebCore/HTMLInputElement.h> | 
|         |     39 #include <WebCore/HTMLNames.h> | 
|         |     40 #include <WebCore/HTMLOptionElement.h> | 
|         |     41 #include <WebCore/HTMLSelectElement.h> | 
|         |     42 #include <WebCore/HTMLTextAreaElement.h> | 
|         |     43 #include <WebCore/IntRect.h> | 
|         |     44 #include <WebCore/RenderObject.h> | 
|         |     45 #include <WebCore/RenderTextControl.h> | 
|         |     46 #pragma warning(pop) | 
|         |     47  | 
|         |     48 using namespace WebCore; | 
|         |     49 using namespace HTMLNames; | 
|         |     50  | 
|         |     51 // DOMHTMLCollection | 
|         |     52  | 
|         |     53 DOMHTMLCollection::DOMHTMLCollection(WebCore::HTMLCollection* c) | 
|         |     54 : m_collection(c) | 
|         |     55 { | 
|         |     56 } | 
|         |     57  | 
|         |     58 IDOMHTMLCollection* DOMHTMLCollection::createInstance(WebCore::HTMLCollection* c) | 
|         |     59 { | 
|         |     60     if (!c) | 
|         |     61         return 0; | 
|         |     62  | 
|         |     63     IDOMHTMLCollection* htmlCollection = 0; | 
|         |     64     DOMHTMLCollection* newCollection = new DOMHTMLCollection(c); | 
|         |     65     if (FAILED(newCollection->QueryInterface(IID_IDOMHTMLCollection, (void**)&htmlCollection))) { | 
|         |     66         delete newCollection; | 
|         |     67         return 0; | 
|         |     68     } | 
|         |     69  | 
|         |     70     return htmlCollection; | 
|         |     71 } | 
|         |     72  | 
|         |     73 // DOMHTMLCollection - IUnknown ----------------------------------------------- | 
|         |     74  | 
|         |     75 HRESULT STDMETHODCALLTYPE DOMHTMLCollection::QueryInterface(REFIID riid, void** ppvObject) | 
|         |     76 { | 
|         |     77     *ppvObject = 0; | 
|         |     78     if (IsEqualGUID(riid, IID_IDOMHTMLCollection)) | 
|         |     79         *ppvObject = static_cast<IDOMHTMLCollection*>(this); | 
|         |     80     else | 
|         |     81         return DOMObject::QueryInterface(riid, ppvObject); | 
|         |     82  | 
|         |     83     AddRef(); | 
|         |     84     return S_OK; | 
|         |     85 } | 
|         |     86  | 
|         |     87 // DOMHTMLCollection ---------------------------------------------------------- | 
|         |     88  | 
|         |     89 HRESULT STDMETHODCALLTYPE DOMHTMLCollection::length(  | 
|         |     90     /* [retval][out] */ UINT* result) | 
|         |     91 { | 
|         |     92     *result = 0; | 
|         |     93     if (!m_collection) | 
|         |     94         return E_POINTER; | 
|         |     95  | 
|         |     96     *result = m_collection->length(); | 
|         |     97     return S_OK; | 
|         |     98 } | 
|         |     99  | 
|         |    100 HRESULT STDMETHODCALLTYPE DOMHTMLCollection::item(  | 
|         |    101     /* [in] */ UINT index, | 
|         |    102     /* [retval][out] */ IDOMNode** node) | 
|         |    103 { | 
|         |    104     *node = 0; | 
|         |    105     if (!m_collection) | 
|         |    106         return E_POINTER; | 
|         |    107  | 
|         |    108     *node = DOMNode::createInstance(m_collection->item(index)); | 
|         |    109     return *node ? S_OK : E_FAIL; | 
|         |    110 } | 
|         |    111  | 
|         |    112 HRESULT STDMETHODCALLTYPE DOMHTMLCollection::namedItem(  | 
|         |    113     /* [in] */ BSTR /*name*/, | 
|         |    114     /* [retval][out] */ IDOMNode** /*node*/) | 
|         |    115 { | 
|         |    116     ASSERT_NOT_REACHED(); | 
|         |    117     return E_NOTIMPL; | 
|         |    118 } | 
|         |    119  | 
|         |    120 // DOMHTMLOptionsCollection - IUnknown ---------------------------------------- | 
|         |    121  | 
|         |    122 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    123 { | 
|         |    124     *ppvObject = 0; | 
|         |    125     if (IsEqualGUID(riid, IID_IDOMHTMLOptionsCollection)) | 
|         |    126         *ppvObject = static_cast<IDOMHTMLOptionsCollection*>(this); | 
|         |    127     else | 
|         |    128         return DOMObject::QueryInterface(riid, ppvObject); | 
|         |    129  | 
|         |    130     AddRef(); | 
|         |    131     return S_OK; | 
|         |    132 } | 
|         |    133  | 
|         |    134 // DOMHTMLOptionsCollection --------------------------------------------------- | 
|         |    135  | 
|         |    136 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::length(  | 
|         |    137     /* [retval][out] */ unsigned int* /*result*/) | 
|         |    138 { | 
|         |    139     ASSERT_NOT_REACHED(); | 
|         |    140     return E_NOTIMPL; | 
|         |    141 } | 
|         |    142  | 
|         |    143 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::setLength(  | 
|         |    144     /* [in] */ unsigned int /*length*/) | 
|         |    145 { | 
|         |    146     ASSERT_NOT_REACHED(); | 
|         |    147     return E_NOTIMPL; | 
|         |    148 } | 
|         |    149  | 
|         |    150 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::item(  | 
|         |    151     /* [in] */ unsigned int /*index*/, | 
|         |    152     /* [retval][out] */ IDOMNode** /*result*/) | 
|         |    153 { | 
|         |    154     ASSERT_NOT_REACHED(); | 
|         |    155     return E_NOTIMPL; | 
|         |    156 } | 
|         |    157  | 
|         |    158 HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::namedItem(  | 
|         |    159     /* [in] */ BSTR /*name*/, | 
|         |    160     /* [retval][out] */ IDOMNode* /*result*/) | 
|         |    161 { | 
|         |    162     ASSERT_NOT_REACHED(); | 
|         |    163     return E_NOTIMPL; | 
|         |    164 } | 
|         |    165  | 
|         |    166 // DOMHTMLDocument - IUnknown ------------------------------------------------- | 
|         |    167  | 
|         |    168 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    169 { | 
|         |    170     *ppvObject = 0; | 
|         |    171     if (IsEqualGUID(riid, IID_IDOMHTMLDocument)) | 
|         |    172         *ppvObject = static_cast<IDOMHTMLDocument*>(this); | 
|         |    173     else | 
|         |    174         return DOMDocument::QueryInterface(riid, ppvObject); | 
|         |    175  | 
|         |    176     AddRef(); | 
|         |    177     return S_OK; | 
|         |    178 } | 
|         |    179  | 
|         |    180 // DOMHTMLDocument ------------------------------------------------------------ | 
|         |    181  | 
|         |    182 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::title(  | 
|         |    183         /* [retval][out] */ BSTR* /*result*/) | 
|         |    184 { | 
|         |    185     ASSERT_NOT_REACHED(); | 
|         |    186     return E_NOTIMPL; | 
|         |    187 } | 
|         |    188      | 
|         |    189 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setTitle(  | 
|         |    190         /* [in] */ BSTR /*title*/) | 
|         |    191 { | 
|         |    192     ASSERT_NOT_REACHED(); | 
|         |    193     return E_NOTIMPL; | 
|         |    194 } | 
|         |    195      | 
|         |    196 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::referrer(  | 
|         |    197         /* [retval][out] */ BSTR* /*result*/) | 
|         |    198 { | 
|         |    199     ASSERT_NOT_REACHED(); | 
|         |    200     return E_NOTIMPL; | 
|         |    201 } | 
|         |    202      | 
|         |    203 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::domain(  | 
|         |    204         /* [retval][out] */ BSTR* /*result*/) | 
|         |    205 { | 
|         |    206     ASSERT_NOT_REACHED(); | 
|         |    207     return E_NOTIMPL; | 
|         |    208 } | 
|         |    209      | 
|         |    210 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::URL(  | 
|         |    211         /* [retval][out] */ BSTR* /*result*/) | 
|         |    212 { | 
|         |    213     ASSERT_NOT_REACHED(); | 
|         |    214     return E_NOTIMPL; | 
|         |    215 } | 
|         |    216      | 
|         |    217 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::body(  | 
|         |    218         /* [retval][out] */ IDOMHTMLElement** bodyElement) | 
|         |    219 { | 
|         |    220     *bodyElement = 0; | 
|         |    221     if (!m_document || !m_document->isHTMLDocument()) | 
|         |    222         return E_FAIL; | 
|         |    223  | 
|         |    224     HTMLDocument* htmlDoc = static_cast<HTMLDocument*>(m_document); | 
|         |    225     COMPtr<IDOMElement> domElement; | 
|         |    226     domElement.adoptRef(DOMHTMLElement::createInstance(htmlDoc->body())); | 
|         |    227     if (domElement) | 
|         |    228         return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) bodyElement); | 
|         |    229     return E_FAIL; | 
|         |    230 } | 
|         |    231      | 
|         |    232 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setBody(  | 
|         |    233         /* [in] */ IDOMHTMLElement* /*body*/) | 
|         |    234 { | 
|         |    235     ASSERT_NOT_REACHED(); | 
|         |    236     return E_NOTIMPL; | 
|         |    237 } | 
|         |    238      | 
|         |    239 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::images(  | 
|         |    240         /* [retval][out] */ IDOMHTMLCollection** /*collection*/) | 
|         |    241 { | 
|         |    242     ASSERT_NOT_REACHED(); | 
|         |    243     return E_NOTIMPL; | 
|         |    244 } | 
|         |    245      | 
|         |    246 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::applets(  | 
|         |    247         /* [retval][out] */ IDOMHTMLCollection** /*collection*/) | 
|         |    248 { | 
|         |    249     ASSERT_NOT_REACHED(); | 
|         |    250     return E_NOTIMPL; | 
|         |    251 } | 
|         |    252      | 
|         |    253 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::links(  | 
|         |    254         /* [retval][out] */ IDOMHTMLCollection** /*collection*/) | 
|         |    255 { | 
|         |    256     ASSERT_NOT_REACHED(); | 
|         |    257     return E_NOTIMPL; | 
|         |    258 } | 
|         |    259      | 
|         |    260 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::forms(  | 
|         |    261         /* [retval][out] */ IDOMHTMLCollection** collection) | 
|         |    262 { | 
|         |    263     *collection = 0; | 
|         |    264     if (!m_document || !m_document->isHTMLDocument()) | 
|         |    265         return E_FAIL; | 
|         |    266  | 
|         |    267     HTMLDocument* htmlDoc = static_cast<HTMLDocument*>(m_document); | 
|         |    268     *collection = DOMHTMLCollection::createInstance(htmlDoc->forms().get()); | 
|         |    269     return S_OK; | 
|         |    270 } | 
|         |    271      | 
|         |    272 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::anchors(  | 
|         |    273         /* [retval][out] */ IDOMHTMLCollection** /*collection*/) | 
|         |    274 { | 
|         |    275     ASSERT_NOT_REACHED(); | 
|         |    276     return E_NOTIMPL; | 
|         |    277 } | 
|         |    278      | 
|         |    279 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::cookie(  | 
|         |    280         /* [retval][out] */ BSTR* /*result*/) | 
|         |    281 { | 
|         |    282     ASSERT_NOT_REACHED(); | 
|         |    283     return E_NOTIMPL; | 
|         |    284 } | 
|         |    285      | 
|         |    286 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setCookie(  | 
|         |    287         /* [in] */ BSTR /*cookie*/) | 
|         |    288 { | 
|         |    289     ASSERT_NOT_REACHED(); | 
|         |    290     return E_NOTIMPL; | 
|         |    291 } | 
|         |    292      | 
|         |    293 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::open( void) | 
|         |    294 { | 
|         |    295     ASSERT_NOT_REACHED(); | 
|         |    296     return E_NOTIMPL; | 
|         |    297 } | 
|         |    298      | 
|         |    299 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::close( void) | 
|         |    300 { | 
|         |    301     ASSERT_NOT_REACHED(); | 
|         |    302     return E_NOTIMPL; | 
|         |    303 } | 
|         |    304      | 
|         |    305 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::write(  | 
|         |    306         /* [in] */ BSTR /*text*/) | 
|         |    307 { | 
|         |    308     ASSERT_NOT_REACHED(); | 
|         |    309     return E_NOTIMPL; | 
|         |    310 } | 
|         |    311      | 
|         |    312 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::writeln(  | 
|         |    313         /* [in] */ BSTR /*text*/) | 
|         |    314 { | 
|         |    315     ASSERT_NOT_REACHED(); | 
|         |    316     return E_NOTIMPL; | 
|         |    317 } | 
|         |    318      | 
|         |    319 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::getElementById_(  | 
|         |    320         /* [in] */ BSTR /*elementId*/, | 
|         |    321         /* [retval][out] */ IDOMElement** /*element*/) | 
|         |    322 { | 
|         |    323     ASSERT_NOT_REACHED(); | 
|         |    324     return E_NOTIMPL; | 
|         |    325 } | 
|         |    326      | 
|         |    327 HRESULT STDMETHODCALLTYPE DOMHTMLDocument::getElementsByName(  | 
|         |    328         /* [in] */ BSTR /*elementName*/, | 
|         |    329         /* [retval][out] */ IDOMNodeList** /*nodeList*/) | 
|         |    330 { | 
|         |    331     ASSERT_NOT_REACHED(); | 
|         |    332     return E_NOTIMPL; | 
|         |    333 } | 
|         |    334  | 
|         |    335 // DOMHTMLElement - IUnknown -------------------------------------------------- | 
|         |    336  | 
|         |    337 HRESULT STDMETHODCALLTYPE DOMHTMLElement::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    338 { | 
|         |    339     *ppvObject = 0; | 
|         |    340     if (IsEqualGUID(riid, IID_IDOMHTMLElement)) | 
|         |    341         *ppvObject = static_cast<IDOMHTMLElement*>(this); | 
|         |    342     else | 
|         |    343         return DOMElement::QueryInterface(riid, ppvObject); | 
|         |    344  | 
|         |    345     AddRef(); | 
|         |    346     return S_OK; | 
|         |    347 } | 
|         |    348  | 
|         |    349 // DOMHTMLElement ------------------------------------------------------------- | 
|         |    350  | 
|         |    351 HRESULT STDMETHODCALLTYPE DOMHTMLElement::idName(  | 
|         |    352         /* [retval][out] */ BSTR* /*result*/) | 
|         |    353 { | 
|         |    354     ASSERT_NOT_REACHED(); | 
|         |    355     return E_NOTIMPL; | 
|         |    356 } | 
|         |    357      | 
|         |    358 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setIdName(  | 
|         |    359         /* [in] */ BSTR /*idName*/) | 
|         |    360 { | 
|         |    361     ASSERT_NOT_REACHED(); | 
|         |    362     return E_NOTIMPL; | 
|         |    363 } | 
|         |    364      | 
|         |    365 HRESULT STDMETHODCALLTYPE DOMHTMLElement::title(  | 
|         |    366         /* [retval][out] */ BSTR* /*result*/) | 
|         |    367 { | 
|         |    368     ASSERT_NOT_REACHED(); | 
|         |    369     return E_NOTIMPL; | 
|         |    370 } | 
|         |    371      | 
|         |    372 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setTitle(  | 
|         |    373         /* [in] */ BSTR /*title*/) | 
|         |    374 { | 
|         |    375     ASSERT_NOT_REACHED(); | 
|         |    376     return E_NOTIMPL; | 
|         |    377 } | 
|         |    378      | 
|         |    379 HRESULT STDMETHODCALLTYPE DOMHTMLElement::lang(  | 
|         |    380         /* [retval][out] */ BSTR* /*result*/) | 
|         |    381 { | 
|         |    382     ASSERT_NOT_REACHED(); | 
|         |    383     return E_NOTIMPL; | 
|         |    384 } | 
|         |    385      | 
|         |    386 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setLang(  | 
|         |    387         /* [in] */ BSTR /*lang*/) | 
|         |    388 { | 
|         |    389     ASSERT_NOT_REACHED(); | 
|         |    390     return E_NOTIMPL; | 
|         |    391 } | 
|         |    392      | 
|         |    393 HRESULT STDMETHODCALLTYPE DOMHTMLElement::dir(  | 
|         |    394         /* [retval][out] */ BSTR* /*result*/) | 
|         |    395 { | 
|         |    396     ASSERT_NOT_REACHED(); | 
|         |    397     return E_NOTIMPL; | 
|         |    398 } | 
|         |    399      | 
|         |    400 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setDir(  | 
|         |    401         /* [in] */ BSTR /*dir*/) | 
|         |    402 { | 
|         |    403     ASSERT_NOT_REACHED(); | 
|         |    404     return E_NOTIMPL; | 
|         |    405 } | 
|         |    406      | 
|         |    407 HRESULT STDMETHODCALLTYPE DOMHTMLElement::className(  | 
|         |    408         /* [retval][out] */ BSTR* /*result*/) | 
|         |    409 { | 
|         |    410     ASSERT_NOT_REACHED(); | 
|         |    411     return E_NOTIMPL; | 
|         |    412 } | 
|         |    413      | 
|         |    414 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setClassName(  | 
|         |    415         /* [in] */ BSTR /*className*/) | 
|         |    416 { | 
|         |    417     ASSERT_NOT_REACHED(); | 
|         |    418     return E_NOTIMPL; | 
|         |    419 } | 
|         |    420  | 
|         |    421 HRESULT STDMETHODCALLTYPE DOMHTMLElement::innerHTML(  | 
|         |    422         /* [retval][out] */ BSTR* /*result*/) | 
|         |    423 { | 
|         |    424     ASSERT_NOT_REACHED(); | 
|         |    425     return E_NOTIMPL; | 
|         |    426 } | 
|         |    427          | 
|         |    428 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setInnerHTML(  | 
|         |    429         /* [in] */ BSTR /*html*/) | 
|         |    430 { | 
|         |    431     ASSERT_NOT_REACHED(); | 
|         |    432     return E_NOTIMPL; | 
|         |    433 } | 
|         |    434          | 
|         |    435 HRESULT STDMETHODCALLTYPE DOMHTMLElement::innerText(  | 
|         |    436         /* [retval][out] */ BSTR* result) | 
|         |    437 { | 
|         |    438     ASSERT(m_element && m_element->isHTMLElement()); | 
|         |    439     WebCore::String innerTextString = static_cast<HTMLElement*>(m_element)->innerText(); | 
|         |    440     *result = BString(innerTextString.characters(), innerTextString.length()).release(); | 
|         |    441     return S_OK; | 
|         |    442 } | 
|         |    443          | 
|         |    444 HRESULT STDMETHODCALLTYPE DOMHTMLElement::setInnerText(  | 
|         |    445         /* [in] */ BSTR text) | 
|         |    446 { | 
|         |    447     ASSERT(m_element && m_element->isHTMLElement()); | 
|         |    448     HTMLElement* htmlEle = static_cast<HTMLElement*>(m_element); | 
|         |    449     WebCore::String textString(text, SysStringLen(text)); | 
|         |    450     WebCore::ExceptionCode ec = 0; | 
|         |    451     htmlEle->setInnerText(textString, ec); | 
|         |    452     return S_OK; | 
|         |    453 } | 
|         |    454  | 
|         |    455 // DOMHTMLFormElement - IUnknown ---------------------------------------------- | 
|         |    456  | 
|         |    457 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    458 { | 
|         |    459     *ppvObject = 0; | 
|         |    460     if (IsEqualGUID(riid, IID_IDOMHTMLFormElement)) | 
|         |    461         *ppvObject = static_cast<IDOMHTMLFormElement*>(this); | 
|         |    462     else | 
|         |    463         return DOMHTMLElement::QueryInterface(riid, ppvObject); | 
|         |    464  | 
|         |    465     AddRef(); | 
|         |    466     return S_OK; | 
|         |    467 } | 
|         |    468  | 
|         |    469 // DOMHTMLFormElement --------------------------------------------------------- | 
|         |    470  | 
|         |    471 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::elements(  | 
|         |    472         /* [retval][out] */ IDOMHTMLCollection** /*result*/) | 
|         |    473 { | 
|         |    474     ASSERT_NOT_REACHED(); | 
|         |    475     return E_NOTIMPL; | 
|         |    476 } | 
|         |    477      | 
|         |    478 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::length(  | 
|         |    479         /* [retval][out] */ int* /*result*/) | 
|         |    480 { | 
|         |    481     ASSERT_NOT_REACHED(); | 
|         |    482     return E_NOTIMPL; | 
|         |    483 } | 
|         |    484      | 
|         |    485 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::name(  | 
|         |    486         /* [retval][out] */ BSTR* /*result*/) | 
|         |    487 { | 
|         |    488     ASSERT_NOT_REACHED(); | 
|         |    489     return E_NOTIMPL; | 
|         |    490 } | 
|         |    491      | 
|         |    492 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setName(  | 
|         |    493         /* [in] */ BSTR /*name*/) | 
|         |    494 { | 
|         |    495     ASSERT_NOT_REACHED(); | 
|         |    496     return E_NOTIMPL; | 
|         |    497 } | 
|         |    498      | 
|         |    499 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::acceptCharset(  | 
|         |    500         /* [retval][out] */ BSTR* /*result*/) | 
|         |    501 { | 
|         |    502     ASSERT_NOT_REACHED(); | 
|         |    503     return E_NOTIMPL; | 
|         |    504 } | 
|         |    505      | 
|         |    506 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setAcceptCharset(  | 
|         |    507         /* [in] */ BSTR /*acceptCharset*/) | 
|         |    508 { | 
|         |    509     ASSERT_NOT_REACHED(); | 
|         |    510     return E_NOTIMPL; | 
|         |    511 } | 
|         |    512      | 
|         |    513 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::action(  | 
|         |    514         /* [retval][out] */ BSTR* result) | 
|         |    515 { | 
|         |    516     ASSERT(m_element && m_element->hasTagName(formTag)); | 
|         |    517     WebCore::String actionString = static_cast<HTMLFormElement*>(m_element)->action(); | 
|         |    518     *result = BString(actionString.characters(), actionString.length()).release(); | 
|         |    519     return S_OK; | 
|         |    520 } | 
|         |    521      | 
|         |    522 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setAction(  | 
|         |    523         /* [in] */ BSTR /*action*/) | 
|         |    524 { | 
|         |    525     ASSERT_NOT_REACHED(); | 
|         |    526     return E_NOTIMPL; | 
|         |    527 } | 
|         |    528      | 
|         |    529 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::encType(  | 
|         |    530         /* [retval][out] */ BSTR* /*result*/) | 
|         |    531 { | 
|         |    532     ASSERT_NOT_REACHED(); | 
|         |    533     return E_NOTIMPL; | 
|         |    534 } | 
|         |    535      | 
|         |    536 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setEnctype(  | 
|         |    537         /* [retval][out] */ BSTR* /*encType*/) | 
|         |    538 { | 
|         |    539     ASSERT_NOT_REACHED(); | 
|         |    540     return E_NOTIMPL; | 
|         |    541 } | 
|         |    542      | 
|         |    543 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::method(  | 
|         |    544         /* [retval][out] */ BSTR* result) | 
|         |    545 { | 
|         |    546     ASSERT(m_element && m_element->hasTagName(formTag)); | 
|         |    547     WebCore::String methodString = static_cast<HTMLFormElement*>(m_element)->method(); | 
|         |    548     *result = BString(methodString.characters(), methodString.length()).release(); | 
|         |    549     return S_OK; | 
|         |    550 } | 
|         |    551      | 
|         |    552 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setMethod(  | 
|         |    553         /* [in] */ BSTR /*method*/) | 
|         |    554 { | 
|         |    555     ASSERT_NOT_REACHED(); | 
|         |    556     return E_NOTIMPL; | 
|         |    557 } | 
|         |    558      | 
|         |    559 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::target(  | 
|         |    560         /* [retval][out] */ BSTR* /*result*/) | 
|         |    561 { | 
|         |    562     ASSERT_NOT_REACHED(); | 
|         |    563     return E_NOTIMPL; | 
|         |    564 } | 
|         |    565      | 
|         |    566 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setTarget(  | 
|         |    567         /* [in] */ BSTR /*target*/) | 
|         |    568 { | 
|         |    569     ASSERT_NOT_REACHED(); | 
|         |    570     return E_NOTIMPL; | 
|         |    571 } | 
|         |    572      | 
|         |    573 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::submit( void) | 
|         |    574 { | 
|         |    575     ASSERT_NOT_REACHED(); | 
|         |    576     return E_NOTIMPL; | 
|         |    577 } | 
|         |    578      | 
|         |    579 HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::reset( void) | 
|         |    580 { | 
|         |    581     ASSERT_NOT_REACHED(); | 
|         |    582     return E_NOTIMPL; | 
|         |    583 } | 
|         |    584  | 
|         |    585 // DOMHTMLSelectElement - IUnknown ---------------------------------------------- | 
|         |    586  | 
|         |    587 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    588 { | 
|         |    589     *ppvObject = 0; | 
|         |    590     if (IsEqualGUID(riid, IID_IDOMHTMLSelectElement)) | 
|         |    591         *ppvObject = static_cast<IDOMHTMLSelectElement*>(this); | 
|         |    592     else if (IsEqualGUID(riid, IID_IFormsAutoFillTransitionSelect)) | 
|         |    593         *ppvObject = static_cast<IFormsAutoFillTransitionSelect*>(this); | 
|         |    594     else | 
|         |    595         return DOMHTMLElement::QueryInterface(riid, ppvObject); | 
|         |    596  | 
|         |    597     AddRef(); | 
|         |    598     return S_OK; | 
|         |    599 } | 
|         |    600  | 
|         |    601 // DOMHTMLSelectElement ------------------------------------------------------- | 
|         |    602  | 
|         |    603 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::type(  | 
|         |    604         /* [retval][out] */ BSTR* /*result*/) | 
|         |    605 { | 
|         |    606     ASSERT_NOT_REACHED(); | 
|         |    607     return E_NOTIMPL; | 
|         |    608 } | 
|         |    609      | 
|         |    610 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::selectedIndex(  | 
|         |    611         /* [retval][out] */ int* /*result*/) | 
|         |    612 { | 
|         |    613     ASSERT_NOT_REACHED(); | 
|         |    614     return E_NOTIMPL; | 
|         |    615 } | 
|         |    616      | 
|         |    617 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setSelectedIndx(  | 
|         |    618         /* [in] */ int /*selectedIndex*/) | 
|         |    619 { | 
|         |    620     ASSERT_NOT_REACHED(); | 
|         |    621     return E_NOTIMPL; | 
|         |    622 } | 
|         |    623      | 
|         |    624 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::value(  | 
|         |    625         /* [retval][out] */ BSTR* /*result*/) | 
|         |    626 { | 
|         |    627     ASSERT_NOT_REACHED(); | 
|         |    628     return E_NOTIMPL; | 
|         |    629 } | 
|         |    630      | 
|         |    631 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setValue(  | 
|         |    632         /* [in] */ BSTR /*value*/) | 
|         |    633 { | 
|         |    634     ASSERT_NOT_REACHED(); | 
|         |    635     return E_NOTIMPL; | 
|         |    636 } | 
|         |    637      | 
|         |    638 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::length(  | 
|         |    639         /* [retval][out] */ int* /*result*/) | 
|         |    640 { | 
|         |    641     ASSERT_NOT_REACHED(); | 
|         |    642     return E_NOTIMPL; | 
|         |    643 } | 
|         |    644      | 
|         |    645 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::form(  | 
|         |    646         /* [retval][out] */ IDOMHTMLFormElement** /*result*/) | 
|         |    647 { | 
|         |    648     ASSERT_NOT_REACHED(); | 
|         |    649     return E_NOTIMPL; | 
|         |    650 } | 
|         |    651      | 
|         |    652 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::options(  | 
|         |    653         /* [retval][out] */ IDOMHTMLOptionsCollection** /*result*/) | 
|         |    654 { | 
|         |    655     ASSERT_NOT_REACHED(); | 
|         |    656     return E_NOTIMPL; | 
|         |    657 } | 
|         |    658      | 
|         |    659 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::disabled(  | 
|         |    660         /* [retval][out] */ BOOL* /*result*/) | 
|         |    661 { | 
|         |    662     ASSERT_NOT_REACHED(); | 
|         |    663     return E_NOTIMPL; | 
|         |    664 } | 
|         |    665      | 
|         |    666 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setDisabled(  | 
|         |    667         /* [in] */ BOOL /*disabled*/) | 
|         |    668 { | 
|         |    669     ASSERT_NOT_REACHED(); | 
|         |    670     return E_NOTIMPL; | 
|         |    671 } | 
|         |    672      | 
|         |    673 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::multiple(  | 
|         |    674         /* [retval][out] */ BOOL* /*result*/) | 
|         |    675 { | 
|         |    676     ASSERT_NOT_REACHED(); | 
|         |    677     return E_NOTIMPL; | 
|         |    678 } | 
|         |    679      | 
|         |    680 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setMultiple(  | 
|         |    681         /* [in] */ BOOL /*multiple*/) | 
|         |    682 { | 
|         |    683     ASSERT_NOT_REACHED(); | 
|         |    684     return E_NOTIMPL; | 
|         |    685 } | 
|         |    686      | 
|         |    687 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::name(  | 
|         |    688         /* [retval][out] */ BSTR* /*result*/) | 
|         |    689 { | 
|         |    690     ASSERT_NOT_REACHED(); | 
|         |    691     return E_NOTIMPL; | 
|         |    692 } | 
|         |    693      | 
|         |    694 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setName(  | 
|         |    695         /* [in] */ BSTR /*name*/) | 
|         |    696 { | 
|         |    697     ASSERT_NOT_REACHED(); | 
|         |    698     return E_NOTIMPL; | 
|         |    699 } | 
|         |    700      | 
|         |    701 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::size(  | 
|         |    702         /* [retval][out] */ int* /*size*/) | 
|         |    703 { | 
|         |    704     ASSERT_NOT_REACHED(); | 
|         |    705     return E_NOTIMPL; | 
|         |    706 } | 
|         |    707      | 
|         |    708 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setSize(  | 
|         |    709         /* [in] */ int /*size*/) | 
|         |    710 { | 
|         |    711     ASSERT_NOT_REACHED(); | 
|         |    712     return E_NOTIMPL; | 
|         |    713 } | 
|         |    714      | 
|         |    715 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::tabIndex(  | 
|         |    716         /* [retval][out] */ int* /*result*/) | 
|         |    717 { | 
|         |    718     ASSERT_NOT_REACHED(); | 
|         |    719     return E_NOTIMPL; | 
|         |    720 } | 
|         |    721      | 
|         |    722 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setTabIndex(  | 
|         |    723         /* [in] */ int /*tabIndex*/) | 
|         |    724 { | 
|         |    725     ASSERT_NOT_REACHED(); | 
|         |    726     return E_NOTIMPL; | 
|         |    727 } | 
|         |    728      | 
|         |    729 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::add(  | 
|         |    730         /* [in] */ IDOMHTMLElement* /*element*/, | 
|         |    731         /* [in] */ IDOMHTMLElement* /*before*/) | 
|         |    732 { | 
|         |    733     ASSERT_NOT_REACHED(); | 
|         |    734     return E_NOTIMPL; | 
|         |    735 } | 
|         |    736      | 
|         |    737 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::remove(  | 
|         |    738         /* [in] */ int /*index*/) | 
|         |    739 { | 
|         |    740     ASSERT_NOT_REACHED(); | 
|         |    741     return E_NOTIMPL; | 
|         |    742 } | 
|         |    743      | 
|         |    744 // DOMHTMLSelectElement - IFormsAutoFillTransitionSelect ---------------------- | 
|         |    745  | 
|         |    746 HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::activateItemAtIndex(  | 
|         |    747     /* [in] */ int /*index*/) | 
|         |    748 { | 
|         |    749     ASSERT_NOT_REACHED(); | 
|         |    750     return E_NOTIMPL;     | 
|         |    751 } | 
|         |    752  | 
|         |    753 // DOMHTMLOptionElement - IUnknown -------------------------------------------- | 
|         |    754  | 
|         |    755 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    756 { | 
|         |    757     *ppvObject = 0; | 
|         |    758     if (IsEqualGUID(riid, IID_IDOMHTMLOptionElement)) | 
|         |    759         *ppvObject = static_cast<IDOMHTMLOptionElement*>(this); | 
|         |    760     else | 
|         |    761         return DOMHTMLElement::QueryInterface(riid, ppvObject); | 
|         |    762  | 
|         |    763     AddRef(); | 
|         |    764     return S_OK; | 
|         |    765 } | 
|         |    766  | 
|         |    767 // DOMHTMLOptionElement ------------------------------------------------------- | 
|         |    768  | 
|         |    769 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::form(  | 
|         |    770         /* [retval][out] */ IDOMHTMLFormElement** /*result*/) | 
|         |    771 { | 
|         |    772     ASSERT_NOT_REACHED(); | 
|         |    773     return E_NOTIMPL; | 
|         |    774 } | 
|         |    775      | 
|         |    776 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::defaultSelected(  | 
|         |    777         /* [retval][out] */ BOOL* /*result*/) | 
|         |    778 { | 
|         |    779     ASSERT_NOT_REACHED(); | 
|         |    780     return E_NOTIMPL; | 
|         |    781 } | 
|         |    782      | 
|         |    783 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setDefaultSelected(  | 
|         |    784         /* [in] */ BOOL /*defaultSelected*/) | 
|         |    785 { | 
|         |    786     ASSERT_NOT_REACHED(); | 
|         |    787     return E_NOTIMPL; | 
|         |    788 } | 
|         |    789      | 
|         |    790 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::text(  | 
|         |    791         /* [retval][out] */ BSTR* /*result*/) | 
|         |    792 { | 
|         |    793     ASSERT_NOT_REACHED(); | 
|         |    794     return E_NOTIMPL; | 
|         |    795 } | 
|         |    796      | 
|         |    797 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::index(  | 
|         |    798         /* [retval][out] */ int* /*result*/) | 
|         |    799 { | 
|         |    800     ASSERT_NOT_REACHED(); | 
|         |    801     return E_NOTIMPL; | 
|         |    802 } | 
|         |    803      | 
|         |    804 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::disabled(  | 
|         |    805         /* [retval][out] */ BOOL* /*result*/) | 
|         |    806 { | 
|         |    807     ASSERT_NOT_REACHED(); | 
|         |    808     return E_NOTIMPL; | 
|         |    809 } | 
|         |    810      | 
|         |    811 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setDisabled(  | 
|         |    812         /* [in] */ BOOL /*disabled*/) | 
|         |    813 { | 
|         |    814     ASSERT_NOT_REACHED(); | 
|         |    815     return E_NOTIMPL; | 
|         |    816 } | 
|         |    817      | 
|         |    818 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::label(  | 
|         |    819         /* [retval][out] */ BSTR* /*result*/) | 
|         |    820 { | 
|         |    821     ASSERT_NOT_REACHED(); | 
|         |    822     return E_NOTIMPL; | 
|         |    823 } | 
|         |    824      | 
|         |    825 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setLabel(  | 
|         |    826         /* [in] */ BSTR /*label*/) | 
|         |    827 { | 
|         |    828     ASSERT_NOT_REACHED(); | 
|         |    829     return E_NOTIMPL; | 
|         |    830 } | 
|         |    831      | 
|         |    832 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::selected(  | 
|         |    833         /* [retval][out] */ BOOL* /*result*/) | 
|         |    834 { | 
|         |    835     ASSERT_NOT_REACHED(); | 
|         |    836     return E_NOTIMPL; | 
|         |    837 } | 
|         |    838      | 
|         |    839 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setSelected(  | 
|         |    840         /* [in] */ BOOL /*selected*/) | 
|         |    841 { | 
|         |    842     ASSERT_NOT_REACHED(); | 
|         |    843     return E_NOTIMPL; | 
|         |    844 } | 
|         |    845      | 
|         |    846 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::value(  | 
|         |    847         /* [retval][out] */ BSTR* /*result*/) | 
|         |    848 { | 
|         |    849     ASSERT_NOT_REACHED(); | 
|         |    850     return E_NOTIMPL; | 
|         |    851 } | 
|         |    852      | 
|         |    853 HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setValue(  | 
|         |    854         /* [in] */ BSTR /*value*/) | 
|         |    855 { | 
|         |    856     ASSERT_NOT_REACHED(); | 
|         |    857     return E_NOTIMPL; | 
|         |    858 } | 
|         |    859  | 
|         |    860 // DOMHTMLInputElement - IUnknown ---------------------------------------------- | 
|         |    861  | 
|         |    862 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::QueryInterface(REFIID riid, void** ppvObject) | 
|         |    863 { | 
|         |    864     *ppvObject = 0; | 
|         |    865     if (IsEqualGUID(riid, IID_IDOMHTMLInputElement)) | 
|         |    866         *ppvObject = static_cast<IDOMHTMLInputElement*>(this); | 
|         |    867     else if (IsEqualGUID(riid, IID_IFormsAutoFillTransition)) | 
|         |    868         *ppvObject = static_cast<IFormsAutoFillTransition*>(this); | 
|         |    869     else if (IsEqualGUID(riid, IID_IFormPromptAdditions)) | 
|         |    870         *ppvObject = static_cast<IFormPromptAdditions*>(this);     | 
|         |    871     else | 
|         |    872         return DOMHTMLElement::QueryInterface(riid, ppvObject); | 
|         |    873  | 
|         |    874     AddRef(); | 
|         |    875     return S_OK; | 
|         |    876 } | 
|         |    877  | 
|         |    878 // DOMHTMLInputElement -------------------------------------------------------- | 
|         |    879  | 
|         |    880 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::defaultValue(  | 
|         |    881         /* [retval][out] */ BSTR* /*result*/) | 
|         |    882 { | 
|         |    883     ASSERT_NOT_REACHED(); | 
|         |    884     return E_NOTIMPL; | 
|         |    885 } | 
|         |    886      | 
|         |    887 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setDefaultValue(  | 
|         |    888         /* [in] */ BSTR /*val*/) | 
|         |    889 { | 
|         |    890     ASSERT_NOT_REACHED(); | 
|         |    891     return E_NOTIMPL; | 
|         |    892 } | 
|         |    893      | 
|         |    894 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::defaultChecked(  | 
|         |    895         /* [retval][out] */ BOOL* /*result*/) | 
|         |    896 { | 
|         |    897     ASSERT_NOT_REACHED(); | 
|         |    898     return E_NOTIMPL; | 
|         |    899 } | 
|         |    900      | 
|         |    901 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setDefaultChecked(  | 
|         |    902         /* [in] */ BSTR /*checked*/) | 
|         |    903 { | 
|         |    904     ASSERT_NOT_REACHED(); | 
|         |    905     return E_NOTIMPL; | 
|         |    906 } | 
|         |    907      | 
|         |    908 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::form(  | 
|         |    909         /* [retval][out] */ IDOMHTMLElement** result) | 
|         |    910 { | 
|         |    911     if (!result) | 
|         |    912         return E_POINTER; | 
|         |    913     *result = 0; | 
|         |    914     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |    915     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |    916     COMPtr<IDOMElement> domElement; | 
|         |    917     domElement.adoptRef(DOMHTMLElement::createInstance(inputElement->form())); | 
|         |    918     if (domElement) | 
|         |    919         return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) result); | 
|         |    920     return E_FAIL; | 
|         |    921 } | 
|         |    922      | 
|         |    923 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::accept(  | 
|         |    924         /* [retval][out] */ BSTR* /*result*/) | 
|         |    925 { | 
|         |    926     ASSERT_NOT_REACHED(); | 
|         |    927     return E_NOTIMPL; | 
|         |    928 } | 
|         |    929      | 
|         |    930 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAccept(  | 
|         |    931         /* [in] */ BSTR /*accept*/) | 
|         |    932 { | 
|         |    933     ASSERT_NOT_REACHED(); | 
|         |    934     return E_NOTIMPL; | 
|         |    935 } | 
|         |    936      | 
|         |    937 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::accessKey(  | 
|         |    938         /* [retval][out] */ BSTR* /*result*/) | 
|         |    939 { | 
|         |    940     ASSERT_NOT_REACHED(); | 
|         |    941     return E_NOTIMPL; | 
|         |    942 } | 
|         |    943      | 
|         |    944 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAccessKey(  | 
|         |    945         /* [in] */ BSTR /*key*/) | 
|         |    946 { | 
|         |    947     ASSERT_NOT_REACHED(); | 
|         |    948     return E_NOTIMPL; | 
|         |    949 } | 
|         |    950      | 
|         |    951 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::align(  | 
|         |    952         /* [retval][out] */ BSTR* /*result*/) | 
|         |    953 { | 
|         |    954     ASSERT_NOT_REACHED(); | 
|         |    955     return E_NOTIMPL; | 
|         |    956 } | 
|         |    957      | 
|         |    958 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAlign(  | 
|         |    959         /* [in] */ BSTR /*align*/) | 
|         |    960 { | 
|         |    961     ASSERT_NOT_REACHED(); | 
|         |    962     return E_NOTIMPL; | 
|         |    963 } | 
|         |    964      | 
|         |    965 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::alt(  | 
|         |    966         /* [retval][out] */ BSTR* /*result*/) | 
|         |    967 { | 
|         |    968     ASSERT_NOT_REACHED(); | 
|         |    969     return E_NOTIMPL; | 
|         |    970 } | 
|         |    971      | 
|         |    972 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAlt(  | 
|         |    973         /* [in] */ BSTR /*alt*/) | 
|         |    974 { | 
|         |    975     ASSERT_NOT_REACHED(); | 
|         |    976     return E_NOTIMPL; | 
|         |    977 } | 
|         |    978      | 
|         |    979 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::checked(  | 
|         |    980         /* [retval][out] */ BOOL* /*result*/) | 
|         |    981 { | 
|         |    982     ASSERT_NOT_REACHED(); | 
|         |    983     return E_NOTIMPL; | 
|         |    984 } | 
|         |    985      | 
|         |    986 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setChecked(  | 
|         |    987         /* [in] */ BOOL /*checked*/) | 
|         |    988 { | 
|         |    989     ASSERT_NOT_REACHED(); | 
|         |    990     return E_NOTIMPL; | 
|         |    991 } | 
|         |    992      | 
|         |    993 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::disabled(  | 
|         |    994         /* [retval][out] */ BOOL* result) | 
|         |    995 { | 
|         |    996     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |    997     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |    998     *result = inputElement->disabled() ? TRUE : FALSE; | 
|         |    999     return S_OK; | 
|         |   1000 } | 
|         |   1001      | 
|         |   1002 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setDisabled(  | 
|         |   1003         /* [in] */ BOOL /*disabled*/) | 
|         |   1004 { | 
|         |   1005     ASSERT_NOT_REACHED(); | 
|         |   1006     return E_NOTIMPL; | 
|         |   1007 } | 
|         |   1008      | 
|         |   1009 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::maxLength(  | 
|         |   1010         /* [retval][out] */ int* /*result*/) | 
|         |   1011 { | 
|         |   1012     ASSERT_NOT_REACHED(); | 
|         |   1013     return E_NOTIMPL; | 
|         |   1014 } | 
|         |   1015      | 
|         |   1016 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setMaxLength(  | 
|         |   1017         /* [in] */ int /*maxLength*/) | 
|         |   1018 { | 
|         |   1019     ASSERT_NOT_REACHED(); | 
|         |   1020     return E_NOTIMPL; | 
|         |   1021 } | 
|         |   1022      | 
|         |   1023 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::name(  | 
|         |   1024         /* [retval][out] */ BSTR* /*name*/) | 
|         |   1025 { | 
|         |   1026     ASSERT_NOT_REACHED(); | 
|         |   1027     return E_NOTIMPL; | 
|         |   1028 } | 
|         |   1029      | 
|         |   1030 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setName(  | 
|         |   1031         /* [in] */ BSTR /*name*/) | 
|         |   1032 { | 
|         |   1033     ASSERT_NOT_REACHED(); | 
|         |   1034     return E_NOTIMPL; | 
|         |   1035 } | 
|         |   1036      | 
|         |   1037 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::readOnly(  | 
|         |   1038         /* [retval][out] */ BOOL* result) | 
|         |   1039 { | 
|         |   1040     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1041     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1042     *result = inputElement->readOnly() ? TRUE : FALSE; | 
|         |   1043     return S_OK; | 
|         |   1044 } | 
|         |   1045      | 
|         |   1046 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setReadOnly(  | 
|         |   1047         /* [in] */ BOOL /*readOnly*/) | 
|         |   1048 { | 
|         |   1049     ASSERT_NOT_REACHED(); | 
|         |   1050     return E_NOTIMPL; | 
|         |   1051 } | 
|         |   1052      | 
|         |   1053 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::size(  | 
|         |   1054         /* [retval][out] */ unsigned int* /*result*/) | 
|         |   1055 { | 
|         |   1056     ASSERT_NOT_REACHED(); | 
|         |   1057     return E_NOTIMPL; | 
|         |   1058 } | 
|         |   1059      | 
|         |   1060 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setSize(  | 
|         |   1061         /* [in] */ unsigned int /*size*/) | 
|         |   1062 { | 
|         |   1063     ASSERT_NOT_REACHED(); | 
|         |   1064     return E_NOTIMPL; | 
|         |   1065 } | 
|         |   1066      | 
|         |   1067 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::src(  | 
|         |   1068         /* [retval][out] */ BSTR* /*result*/) | 
|         |   1069 { | 
|         |   1070     ASSERT_NOT_REACHED(); | 
|         |   1071     return E_NOTIMPL; | 
|         |   1072 } | 
|         |   1073      | 
|         |   1074 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setSrc(  | 
|         |   1075         /* [in] */ BSTR /*src*/) | 
|         |   1076 { | 
|         |   1077     ASSERT_NOT_REACHED(); | 
|         |   1078     return E_NOTIMPL; | 
|         |   1079 } | 
|         |   1080      | 
|         |   1081 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::tabIndex(  | 
|         |   1082         /* [retval][out] */ int* /*result*/) | 
|         |   1083 { | 
|         |   1084     ASSERT_NOT_REACHED(); | 
|         |   1085     return E_NOTIMPL; | 
|         |   1086 } | 
|         |   1087      | 
|         |   1088 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setTabIndex(  | 
|         |   1089         /* [in] */ int /*tabIndex*/) | 
|         |   1090 { | 
|         |   1091     ASSERT_NOT_REACHED(); | 
|         |   1092     return E_NOTIMPL; | 
|         |   1093 } | 
|         |   1094      | 
|         |   1095 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::type(  | 
|         |   1096         /* [retval][out] */ BSTR* /*result*/) | 
|         |   1097 { | 
|         |   1098     ASSERT_NOT_REACHED(); | 
|         |   1099     return E_NOTIMPL; | 
|         |   1100 } | 
|         |   1101      | 
|         |   1102 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setType(  | 
|         |   1103         /* [in] */ BSTR type) | 
|         |   1104 { | 
|         |   1105     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1106     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1107     WebCore::String typeString(type, SysStringLen(type)); | 
|         |   1108     inputElement->setType(typeString); | 
|         |   1109     return S_OK; | 
|         |   1110 } | 
|         |   1111      | 
|         |   1112 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::useMap(  | 
|         |   1113         /* [retval][out] */ BSTR* /*result*/) | 
|         |   1114 { | 
|         |   1115     ASSERT_NOT_REACHED(); | 
|         |   1116     return E_NOTIMPL; | 
|         |   1117 } | 
|         |   1118      | 
|         |   1119 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setUseMap(  | 
|         |   1120         /* [in] */ BSTR /*useMap*/) | 
|         |   1121 { | 
|         |   1122     ASSERT_NOT_REACHED(); | 
|         |   1123     return E_NOTIMPL; | 
|         |   1124 } | 
|         |   1125      | 
|         |   1126 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::value(  | 
|         |   1127         /* [retval][out] */ BSTR* result) | 
|         |   1128 { | 
|         |   1129     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1130     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1131     WebCore::String valueString = inputElement->value(); | 
|         |   1132     *result = BString(valueString.characters(), valueString.length()).release(); | 
|         |   1133     if (valueString.length() && !*result) | 
|         |   1134         return E_OUTOFMEMORY; | 
|         |   1135     return S_OK; | 
|         |   1136 } | 
|         |   1137      | 
|         |   1138 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setValue(  | 
|         |   1139         /* [in] */ BSTR value) | 
|         |   1140 { | 
|         |   1141     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1142     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1143     inputElement->setValue(String((UChar*) value, SysStringLen(value))); | 
|         |   1144     return S_OK; | 
|         |   1145 } | 
|         |   1146      | 
|         |   1147 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::select( void) | 
|         |   1148 { | 
|         |   1149     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1150     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1151     inputElement->select(); | 
|         |   1152     return S_OK; | 
|         |   1153 } | 
|         |   1154      | 
|         |   1155 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::click( void) | 
|         |   1156 { | 
|         |   1157     ASSERT_NOT_REACHED(); | 
|         |   1158     return E_NOTIMPL; | 
|         |   1159 } | 
|         |   1160  | 
|         |   1161 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setSelectionStart(  | 
|         |   1162     /* [in] */ long start) | 
|         |   1163 { | 
|         |   1164     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1165     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1166     inputElement->setSelectionStart(start); | 
|         |   1167     return S_OK; | 
|         |   1168 } | 
|         |   1169  | 
|         |   1170 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::selectionStart(  | 
|         |   1171     /* [retval][out] */ long *start) | 
|         |   1172 { | 
|         |   1173     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1174     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1175     *start = inputElement->selectionStart(); | 
|         |   1176     return S_OK; | 
|         |   1177 } | 
|         |   1178  | 
|         |   1179 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setSelectionEnd(  | 
|         |   1180     /* [in] */ long end) | 
|         |   1181 { | 
|         |   1182     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1183     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1184     inputElement->setSelectionEnd(end); | 
|         |   1185     return S_OK; | 
|         |   1186 } | 
|         |   1187  | 
|         |   1188 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::selectionEnd(  | 
|         |   1189     /* [retval][out] */ long *end) | 
|         |   1190 { | 
|         |   1191     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1192     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1193     *end = inputElement->selectionEnd(); | 
|         |   1194     return S_OK; | 
|         |   1195 } | 
|         |   1196  | 
|         |   1197 // DOMHTMLInputElement -- IFormsAutoFillTransition ---------------------------- | 
|         |   1198  | 
|         |   1199 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::isTextField( | 
|         |   1200     /* [retval][out] */ BOOL* result) | 
|         |   1201 { | 
|         |   1202     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1203     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1204     *result = inputElement->isTextField() ? TRUE : FALSE; | 
|         |   1205     return S_OK; | 
|         |   1206 } | 
|         |   1207  | 
|         |   1208 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::rectOnScreen(  | 
|         |   1209     /* [retval][out] */ LPRECT rect) | 
|         |   1210 { | 
|         |   1211     rect->left = rect->top = rect->right = rect->bottom = 0; | 
|         |   1212     RenderObject* renderer = m_element->renderer(); | 
|         |   1213     FrameView* view = m_element->document()->view(); | 
|         |   1214     if (!renderer || !view) | 
|         |   1215         return E_FAIL; | 
|         |   1216  | 
|         |   1217     IntRect coreRect = renderer->absoluteBoundingBoxRect(); | 
|         |   1218     coreRect.setLocation(view->contentsToWindow(coreRect.location())); | 
|         |   1219     rect->left = coreRect.x(); | 
|         |   1220     rect->top = coreRect.y(); | 
|         |   1221     rect->right = coreRect.right(); | 
|         |   1222     rect->bottom = coreRect.bottom(); | 
|         |   1223     return S_OK; | 
|         |   1224 } | 
|         |   1225  | 
|         |   1226 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::replaceCharactersInRange(  | 
|         |   1227     /* [in] */ int /*startTarget*/, | 
|         |   1228     /* [in] */ int /*endTarget*/, | 
|         |   1229     /* [in] */ BSTR /*replacementString*/, | 
|         |   1230     /* [in] */ int /*index*/) | 
|         |   1231 { | 
|         |   1232     ASSERT_NOT_REACHED(); | 
|         |   1233     return E_NOTIMPL; | 
|         |   1234 } | 
|         |   1235  | 
|         |   1236 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::selectedRange(  | 
|         |   1237     /* [out] */ int* start, | 
|         |   1238     /* [out] */ int* end) | 
|         |   1239 { | 
|         |   1240     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1241     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1242     *start = inputElement->selectionStart(); | 
|         |   1243     *end = inputElement->selectionEnd(); | 
|         |   1244     return S_OK; | 
|         |   1245 } | 
|         |   1246  | 
|         |   1247 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAutofilled(  | 
|         |   1248     /* [in] */ BOOL filled) | 
|         |   1249 { | 
|         |   1250     ASSERT(m_element && m_element->hasTagName(inputTag)); | 
|         |   1251     HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); | 
|         |   1252     inputElement->setAutofilled(!!filled); | 
|         |   1253     return S_OK; | 
|         |   1254 } | 
|         |   1255  | 
|         |   1256 // DOMHTMLInputElement -- IFormPromptAdditions ------------------------------------ | 
|         |   1257  | 
|         |   1258 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::isUserEdited(  | 
|         |   1259     /* [retval][out] */ BOOL *result) | 
|         |   1260 { | 
|         |   1261     if (!result) | 
|         |   1262         return E_POINTER; | 
|         |   1263  | 
|         |   1264     *result = FALSE; | 
|         |   1265     ASSERT(m_element); | 
|         |   1266     BOOL textField = FALSE; | 
|         |   1267     if (FAILED(isTextField(&textField)) || !textField) | 
|         |   1268         return S_OK; | 
|         |   1269     RenderObject* renderer = m_element->renderer(); | 
|         |   1270     if (renderer && static_cast<WebCore::RenderTextControl*>(renderer)->isUserEdited()) | 
|         |   1271         *result = TRUE; | 
|         |   1272     return S_OK; | 
|         |   1273 } | 
|         |   1274  | 
|         |   1275 // DOMHTMLTextAreaElement - IUnknown ---------------------------------------------- | 
|         |   1276  | 
|         |   1277 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::QueryInterface(REFIID riid, void** ppvObject) | 
|         |   1278 { | 
|         |   1279     *ppvObject = 0; | 
|         |   1280     if (IsEqualGUID(riid, IID_IDOMHTMLTextAreaElement)) | 
|         |   1281         *ppvObject = static_cast<IDOMHTMLTextAreaElement*>(this); | 
|         |   1282     else if (IsEqualGUID(riid, IID_IFormPromptAdditions)) | 
|         |   1283         *ppvObject = static_cast<IFormPromptAdditions*>(this);     | 
|         |   1284     else | 
|         |   1285         return DOMHTMLElement::QueryInterface(riid, ppvObject); | 
|         |   1286  | 
|         |   1287     AddRef(); | 
|         |   1288     return S_OK; | 
|         |   1289 } | 
|         |   1290  | 
|         |   1291 // DOMHTMLTextAreaElement ----------------------------------------------------- | 
|         |   1292  | 
|         |   1293 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::defaultValue(  | 
|         |   1294         /* [retval][out] */ BSTR* /*result*/) | 
|         |   1295 { | 
|         |   1296     ASSERT_NOT_REACHED(); | 
|         |   1297     return E_NOTIMPL; | 
|         |   1298 } | 
|         |   1299      | 
|         |   1300 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setDefaultValue(  | 
|         |   1301         /* [in] */ BSTR /*val*/) | 
|         |   1302 { | 
|         |   1303     ASSERT_NOT_REACHED(); | 
|         |   1304     return E_NOTIMPL; | 
|         |   1305 } | 
|         |   1306      | 
|         |   1307 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::form(  | 
|         |   1308         /* [retval][out] */ IDOMHTMLElement** result) | 
|         |   1309 { | 
|         |   1310     if (!result) | 
|         |   1311         return E_POINTER; | 
|         |   1312     *result = 0; | 
|         |   1313     ASSERT(m_element && m_element->hasTagName(textareaTag)); | 
|         |   1314     HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); | 
|         |   1315     COMPtr<IDOMElement> domElement; | 
|         |   1316     domElement.adoptRef(DOMHTMLElement::createInstance(textareaElement->form())); | 
|         |   1317     if (domElement) | 
|         |   1318         return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) result); | 
|         |   1319     return E_FAIL; | 
|         |   1320 } | 
|         |   1321      | 
|         |   1322 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::accessKey(  | 
|         |   1323         /* [retval][out] */ BSTR* /*result*/) | 
|         |   1324 { | 
|         |   1325     ASSERT_NOT_REACHED(); | 
|         |   1326     return E_NOTIMPL; | 
|         |   1327 } | 
|         |   1328      | 
|         |   1329 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setAccessKey(  | 
|         |   1330         /* [in] */ BSTR /*key*/) | 
|         |   1331 { | 
|         |   1332     ASSERT_NOT_REACHED(); | 
|         |   1333     return E_NOTIMPL; | 
|         |   1334 } | 
|         |   1335      | 
|         |   1336 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::cols(  | 
|         |   1337         /* [retval][out] */ int* /*result*/) | 
|         |   1338 { | 
|         |   1339     ASSERT_NOT_REACHED(); | 
|         |   1340     return E_NOTIMPL; | 
|         |   1341 } | 
|         |   1342      | 
|         |   1343 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setCols(  | 
|         |   1344         /* [in] */ int /*cols*/) | 
|         |   1345 { | 
|         |   1346     ASSERT_NOT_REACHED(); | 
|         |   1347     return E_NOTIMPL; | 
|         |   1348 } | 
|         |   1349      | 
|         |   1350 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::disabled(  | 
|         |   1351         /* [retval][out] */ BOOL* /*result*/) | 
|         |   1352 { | 
|         |   1353     ASSERT_NOT_REACHED(); | 
|         |   1354     return E_NOTIMPL; | 
|         |   1355 } | 
|         |   1356      | 
|         |   1357 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setDisabled(  | 
|         |   1358         /* [in] */ BOOL /*disabled*/) | 
|         |   1359 { | 
|         |   1360     ASSERT_NOT_REACHED(); | 
|         |   1361     return E_NOTIMPL; | 
|         |   1362 } | 
|         |   1363      | 
|         |   1364 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::name(  | 
|         |   1365         /* [retval][out] */ BSTR* /*name*/) | 
|         |   1366 { | 
|         |   1367     ASSERT_NOT_REACHED(); | 
|         |   1368     return E_NOTIMPL; | 
|         |   1369 } | 
|         |   1370      | 
|         |   1371 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setName(  | 
|         |   1372         /* [in] */ BSTR /*name*/) | 
|         |   1373 { | 
|         |   1374     ASSERT_NOT_REACHED(); | 
|         |   1375     return E_NOTIMPL; | 
|         |   1376 } | 
|         |   1377      | 
|         |   1378 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::readOnly(  | 
|         |   1379         /* [retval][out] */ BOOL* /*result*/) | 
|         |   1380 { | 
|         |   1381     ASSERT_NOT_REACHED(); | 
|         |   1382     return E_NOTIMPL; | 
|         |   1383 } | 
|         |   1384      | 
|         |   1385 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setReadOnly(  | 
|         |   1386         /* [in] */ BOOL /*readOnly*/) | 
|         |   1387 { | 
|         |   1388     ASSERT_NOT_REACHED(); | 
|         |   1389     return E_NOTIMPL; | 
|         |   1390 } | 
|         |   1391      | 
|         |   1392 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::rows(  | 
|         |   1393         /* [retval][out] */ int* /*result*/) | 
|         |   1394 { | 
|         |   1395     ASSERT_NOT_REACHED(); | 
|         |   1396     return E_NOTIMPL; | 
|         |   1397 } | 
|         |   1398      | 
|         |   1399 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setRows(  | 
|         |   1400         /* [in] */ int /*rows*/) | 
|         |   1401 { | 
|         |   1402     ASSERT_NOT_REACHED(); | 
|         |   1403     return E_NOTIMPL; | 
|         |   1404 } | 
|         |   1405      | 
|         |   1406 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::tabIndex(  | 
|         |   1407         /* [retval][out] */ int* /*result*/) | 
|         |   1408 { | 
|         |   1409     ASSERT_NOT_REACHED(); | 
|         |   1410     return E_NOTIMPL; | 
|         |   1411 } | 
|         |   1412      | 
|         |   1413 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setTabIndex(  | 
|         |   1414         /* [in] */ int /*tabIndex*/) | 
|         |   1415 { | 
|         |   1416     ASSERT_NOT_REACHED(); | 
|         |   1417     return E_NOTIMPL; | 
|         |   1418 } | 
|         |   1419      | 
|         |   1420 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::type(  | 
|         |   1421         /* [retval][out] */ BSTR* /*result*/) | 
|         |   1422 { | 
|         |   1423     ASSERT_NOT_REACHED(); | 
|         |   1424     return E_NOTIMPL; | 
|         |   1425 } | 
|         |   1426      | 
|         |   1427 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::value(  | 
|         |   1428         /* [retval][out] */ BSTR* result) | 
|         |   1429 { | 
|         |   1430     ASSERT(m_element && m_element->hasTagName(textareaTag)); | 
|         |   1431     HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); | 
|         |   1432     WebCore::String valueString = textareaElement->value(); | 
|         |   1433     *result = BString(valueString.characters(), valueString.length()).release(); | 
|         |   1434     if (valueString.length() && !*result) | 
|         |   1435         return E_OUTOFMEMORY; | 
|         |   1436     return S_OK; | 
|         |   1437 } | 
|         |   1438      | 
|         |   1439 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::setValue(  | 
|         |   1440         /* [in] */ BSTR value) | 
|         |   1441 { | 
|         |   1442     ASSERT(m_element && m_element->hasTagName(textareaTag)); | 
|         |   1443     HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); | 
|         |   1444     textareaElement->setValue(String((UChar*) value, SysStringLen(value))); | 
|         |   1445     return S_OK; | 
|         |   1446 } | 
|         |   1447      | 
|         |   1448 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::select( void) | 
|         |   1449 { | 
|         |   1450     ASSERT(m_element && m_element->hasTagName(textareaTag)); | 
|         |   1451     HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); | 
|         |   1452     textareaElement->select(); | 
|         |   1453     return S_OK; | 
|         |   1454 } | 
|         |   1455  | 
|         |   1456 // DOMHTMLTextAreaElement -- IFormPromptAdditions ------------------------------------ | 
|         |   1457  | 
|         |   1458 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::isUserEdited(  | 
|         |   1459     /* [retval][out] */ BOOL *result) | 
|         |   1460 { | 
|         |   1461     if (!result) | 
|         |   1462         return E_POINTER; | 
|         |   1463  | 
|         |   1464     *result = FALSE; | 
|         |   1465     ASSERT(m_element); | 
|         |   1466     RenderObject* renderer = m_element->renderer(); | 
|         |   1467     if (renderer && static_cast<WebCore::RenderTextControl*>(renderer)->isUserEdited()) | 
|         |   1468         *result = TRUE; | 
|         |   1469     return S_OK; | 
|         |   1470 } |