DOMHTMLClasses.cpp 42.9 KB
Newer Older
aroben's avatar
aroben committed
1
/*
darin@apple.com's avatar
darin@apple.com committed
2
 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
aroben's avatar
aroben committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

#include "config.h"
#include "WebKitDLL.h"
#include "DOMHTMLClasses.h"
#include "COMPtr.h"
30
#include "WebFrame.h"
aroben's avatar
aroben committed
31 32 33 34 35 36

#pragma warning(push, 0)
#include <WebCore/BString.h>
#include <WebCore/Document.h>
#include <WebCore/Element.h>
#include <WebCore/FrameView.h>
37
#include <WebCore/HTMLCollection.h>
aroben's avatar
aroben committed
38 39
#include <WebCore/HTMLDocument.h>
#include <WebCore/HTMLFormElement.h>
40
#include <WebCore/HTMLIFrameElement.h>
aroben's avatar
aroben committed
41 42 43
#include <WebCore/HTMLInputElement.h>
#include <WebCore/HTMLNames.h>
#include <WebCore/HTMLOptionElement.h>
44
#include <WebCore/HTMLOptionsCollection.h>
aroben's avatar
aroben committed
45 46 47 48
#include <WebCore/HTMLSelectElement.h>
#include <WebCore/HTMLTextAreaElement.h>
#include <WebCore/IntRect.h>
#include <WebCore/RenderObject.h>
49
#include <WebCore/RenderTextControl.h>
aroben's avatar
aroben committed
50 51 52 53 54
#pragma warning(pop)

using namespace WebCore;
using namespace HTMLNames;

weinig's avatar
weinig committed
55
// DOMHTMLCollection
aroben's avatar
aroben committed
56

weinig's avatar
weinig committed
57
DOMHTMLCollection::DOMHTMLCollection(WebCore::HTMLCollection* c)
aroben's avatar
aroben committed
58 59 60 61
: m_collection(c)
{
}

weinig's avatar
weinig committed
62
IDOMHTMLCollection* DOMHTMLCollection::createInstance(WebCore::HTMLCollection* c)
aroben's avatar
aroben committed
63 64 65 66
{
    if (!c)
        return 0;

weinig's avatar
weinig committed
67 68 69
    IDOMHTMLCollection* htmlCollection = 0;
    DOMHTMLCollection* newCollection = new DOMHTMLCollection(c);
    if (FAILED(newCollection->QueryInterface(IID_IDOMHTMLCollection, (void**)&htmlCollection))) {
aroben's avatar
aroben committed
70 71 72 73 74 75 76
        delete newCollection;
        return 0;
    }

    return htmlCollection;
}

weinig's avatar
weinig committed
77
// DOMHTMLCollection - IUnknown -----------------------------------------------
aroben's avatar
aroben committed
78

weinig's avatar
weinig committed
79
HRESULT STDMETHODCALLTYPE DOMHTMLCollection::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
80 81
{
    *ppvObject = 0;
weinig's avatar
weinig committed
82 83
    if (IsEqualGUID(riid, IID_IDOMHTMLCollection))
        *ppvObject = static_cast<IDOMHTMLCollection*>(this);
aroben's avatar
aroben committed
84
    else
weinig's avatar
weinig committed
85
        return DOMObject::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
86 87 88 89 90

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
91
// DOMHTMLCollection ----------------------------------------------------------
aroben's avatar
aroben committed
92

weinig's avatar
weinig committed
93
HRESULT STDMETHODCALLTYPE DOMHTMLCollection::length( 
aroben's avatar
aroben committed
94 95 96 97 98 99 100 101 102 103
    /* [retval][out] */ UINT* result)
{
    *result = 0;
    if (!m_collection)
        return E_POINTER;

    *result = m_collection->length();
    return S_OK;
}

weinig's avatar
weinig committed
104
HRESULT STDMETHODCALLTYPE DOMHTMLCollection::item( 
aroben's avatar
aroben committed
105
    /* [in] */ UINT index,
weinig's avatar
weinig committed
106
    /* [retval][out] */ IDOMNode** node)
aroben's avatar
aroben committed
107 108 109 110 111
{
    *node = 0;
    if (!m_collection)
        return E_POINTER;

weinig's avatar
weinig committed
112
    *node = DOMNode::createInstance(m_collection->item(index));
aroben's avatar
aroben committed
113 114 115
    return *node ? S_OK : E_FAIL;
}

weinig's avatar
weinig committed
116
HRESULT STDMETHODCALLTYPE DOMHTMLCollection::namedItem( 
aroben's avatar
aroben committed
117
    /* [in] */ BSTR /*name*/,
weinig's avatar
weinig committed
118
    /* [retval][out] */ IDOMNode** /*node*/)
aroben's avatar
aroben committed
119 120 121 122 123
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
124
// DOMHTMLOptionsCollection - IUnknown ----------------------------------------
aroben's avatar
aroben committed
125

weinig's avatar
weinig committed
126
HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
127 128
{
    *ppvObject = 0;
weinig's avatar
weinig committed
129 130
    if (IsEqualGUID(riid, IID_IDOMHTMLOptionsCollection))
        *ppvObject = static_cast<IDOMHTMLOptionsCollection*>(this);
aroben's avatar
aroben committed
131
    else
weinig's avatar
weinig committed
132
        return DOMObject::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
133 134 135 136 137

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
138
// DOMHTMLOptionsCollection ---------------------------------------------------
aroben's avatar
aroben committed
139

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
DOMHTMLOptionsCollection::DOMHTMLOptionsCollection(WebCore::HTMLOptionsCollection* collection)
    : m_collection(collection)
{
}

IDOMHTMLOptionsCollection* DOMHTMLOptionsCollection::createInstance(WebCore::HTMLOptionsCollection* collection)
{
    if (!collection)
        return 0;

    IDOMHTMLOptionsCollection* optionsCollection = 0;
    DOMHTMLOptionsCollection* newCollection = new DOMHTMLOptionsCollection(collection);
    if (FAILED(newCollection->QueryInterface(IID_IDOMHTMLOptionsCollection, (void**)&optionsCollection))) {
        delete newCollection;
        return 0;
    }

    return optionsCollection;
}

weinig's avatar
weinig committed
160
HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::length( 
161
    /* [retval][out] */ unsigned int* result)
aroben's avatar
aroben committed
162
{
163 164 165 166 167
    if (!result)
        return E_POINTER;

    *result = m_collection->length();
    return S_OK;
aroben's avatar
aroben committed
168 169
}

weinig's avatar
weinig committed
170
HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::setLength( 
aroben's avatar
aroben committed
171 172 173 174 175 176
    /* [in] */ unsigned int /*length*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
177
HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::item( 
178 179
    /* [in] */ unsigned int index,
    /* [retval][out] */ IDOMNode** result)
aroben's avatar
aroben committed
180
{
181 182 183 184 185 186
    if (!result)
        return E_POINTER;

    *result = DOMNode::createInstance(m_collection->item(index));

    return *result ? S_OK : E_FAIL;
aroben's avatar
aroben committed
187 188
}

weinig's avatar
weinig committed
189
HRESULT STDMETHODCALLTYPE DOMHTMLOptionsCollection::namedItem( 
aroben's avatar
aroben committed
190
    /* [in] */ BSTR /*name*/,
191
    /* [retval][out] */ IDOMNode** /*result*/)
aroben's avatar
aroben committed
192 193 194 195 196
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
197
// DOMHTMLDocument - IUnknown -------------------------------------------------
aroben's avatar
aroben committed
198

weinig's avatar
weinig committed
199
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
200 201
{
    *ppvObject = 0;
weinig's avatar
weinig committed
202 203
    if (IsEqualGUID(riid, IID_IDOMHTMLDocument))
        *ppvObject = static_cast<IDOMHTMLDocument*>(this);
aroben's avatar
aroben committed
204
    else
weinig's avatar
weinig committed
205
        return DOMDocument::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
206 207 208 209 210

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
211
// DOMHTMLDocument ------------------------------------------------------------
aroben's avatar
aroben committed
212

weinig's avatar
weinig committed
213
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::title( 
214
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
215
{
216 217 218 219 220 221 222 223 224 225
    if (!result)
        return E_POINTER;

    *result = 0;

    if (!m_document || !m_document->isHTMLDocument())
        return E_FAIL;

    *result = BString(m_document->title()).release();
    return S_OK;
aroben's avatar
aroben committed
226 227
}
    
weinig's avatar
weinig committed
228
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setTitle( 
aroben's avatar
aroben committed
229 230 231 232 233 234
        /* [in] */ BSTR /*title*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
235
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::referrer( 
aroben's avatar
aroben committed
236 237 238 239 240 241
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
242
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::domain( 
aroben's avatar
aroben committed
243 244 245 246 247 248
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
249
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::URL( 
darin@apple.com's avatar
darin@apple.com committed
250
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
251
{
darin@apple.com's avatar
darin@apple.com committed
252 253 254
    if (!result)
        return E_POINTER;

mitz@apple.com's avatar
mitz@apple.com committed
255
    *result = BString(static_cast<HTMLDocument*>(m_document)->url()).release();
darin@apple.com's avatar
darin@apple.com committed
256
    return S_OK;
aroben's avatar
aroben committed
257 258
}
    
weinig's avatar
weinig committed
259 260
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::body( 
        /* [retval][out] */ IDOMHTMLElement** bodyElement)
aroben's avatar
aroben committed
261 262 263 264 265 266
{
    *bodyElement = 0;
    if (!m_document || !m_document->isHTMLDocument())
        return E_FAIL;

    HTMLDocument* htmlDoc = static_cast<HTMLDocument*>(m_document);
weinig's avatar
weinig committed
267 268
    COMPtr<IDOMElement> domElement;
    domElement.adoptRef(DOMHTMLElement::createInstance(htmlDoc->body()));
269
    if (domElement)
weinig's avatar
weinig committed
270
        return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) bodyElement);
aroben's avatar
aroben committed
271 272 273
    return E_FAIL;
}
    
weinig's avatar
weinig committed
274 275
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setBody( 
        /* [in] */ IDOMHTMLElement* /*body*/)
aroben's avatar
aroben committed
276 277 278 279 280
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
281 282
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::images( 
        /* [retval][out] */ IDOMHTMLCollection** /*collection*/)
aroben's avatar
aroben committed
283 284 285 286 287
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
288 289
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::applets( 
        /* [retval][out] */ IDOMHTMLCollection** /*collection*/)
aroben's avatar
aroben committed
290 291 292 293 294
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
295 296
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::links( 
        /* [retval][out] */ IDOMHTMLCollection** /*collection*/)
aroben's avatar
aroben committed
297 298 299 300 301
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
302 303
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::forms( 
        /* [retval][out] */ IDOMHTMLCollection** collection)
aroben's avatar
aroben committed
304 305 306 307 308 309
{
    *collection = 0;
    if (!m_document || !m_document->isHTMLDocument())
        return E_FAIL;

    HTMLDocument* htmlDoc = static_cast<HTMLDocument*>(m_document);
weinig's avatar
weinig committed
310
    *collection = DOMHTMLCollection::createInstance(htmlDoc->forms().get());
aroben's avatar
aroben committed
311 312 313
    return S_OK;
}
    
weinig's avatar
weinig committed
314 315
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::anchors( 
        /* [retval][out] */ IDOMHTMLCollection** /*collection*/)
aroben's avatar
aroben committed
316 317 318 319 320
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
321
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::cookie( 
aroben's avatar
aroben committed
322 323 324 325 326 327
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
328
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::setCookie( 
aroben's avatar
aroben committed
329 330 331 332 333 334
        /* [in] */ BSTR /*cookie*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
335
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::open( void)
aroben's avatar
aroben committed
336 337 338 339 340
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
341
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::close( void)
aroben's avatar
aroben committed
342 343 344 345 346
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
347
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::write( 
aroben's avatar
aroben committed
348 349 350 351 352 353
        /* [in] */ BSTR /*text*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
354
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::writeln( 
aroben's avatar
aroben committed
355 356 357 358 359 360
        /* [in] */ BSTR /*text*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
361
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::getElementById_( 
aroben's avatar
aroben committed
362
        /* [in] */ BSTR /*elementId*/,
weinig's avatar
weinig committed
363
        /* [retval][out] */ IDOMElement** /*element*/)
aroben's avatar
aroben committed
364 365 366 367 368
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
369
HRESULT STDMETHODCALLTYPE DOMHTMLDocument::getElementsByName( 
aroben's avatar
aroben committed
370
        /* [in] */ BSTR /*elementName*/,
weinig's avatar
weinig committed
371
        /* [retval][out] */ IDOMNodeList** /*nodeList*/)
aroben's avatar
aroben committed
372 373 374 375 376
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
377
// DOMHTMLElement - IUnknown --------------------------------------------------
aroben's avatar
aroben committed
378

weinig's avatar
weinig committed
379
HRESULT STDMETHODCALLTYPE DOMHTMLElement::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
380 381
{
    *ppvObject = 0;
weinig's avatar
weinig committed
382 383
    if (IsEqualGUID(riid, IID_IDOMHTMLElement))
        *ppvObject = static_cast<IDOMHTMLElement*>(this);
aroben's avatar
aroben committed
384
    else
weinig's avatar
weinig committed
385
        return DOMElement::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
386 387 388 389 390

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
391
// DOMHTMLElement -------------------------------------------------------------
aroben's avatar
aroben committed
392

weinig's avatar
weinig committed
393
HRESULT STDMETHODCALLTYPE DOMHTMLElement::idName( 
394
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
395
{
396 397 398 399
    if (!result)
        return E_POINTER;

    ASSERT(m_element && m_element->isHTMLElement());
400
    String idString = static_cast<HTMLElement*>(m_element)->getAttribute(idAttr);
401 402
    *result = BString(idString).release();
    return S_OK;
aroben's avatar
aroben committed
403 404
}
    
weinig's avatar
weinig committed
405
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setIdName( 
aroben's avatar
aroben committed
406 407 408 409 410 411
        /* [in] */ BSTR /*idName*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
412
HRESULT STDMETHODCALLTYPE DOMHTMLElement::title( 
aroben's avatar
aroben committed
413 414 415 416 417 418
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
419
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setTitle( 
aroben's avatar
aroben committed
420 421 422 423 424 425
        /* [in] */ BSTR /*title*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
426
HRESULT STDMETHODCALLTYPE DOMHTMLElement::lang( 
aroben's avatar
aroben committed
427 428 429 430 431 432
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
433
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setLang( 
aroben's avatar
aroben committed
434 435 436 437 438 439
        /* [in] */ BSTR /*lang*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
440
HRESULT STDMETHODCALLTYPE DOMHTMLElement::dir( 
aroben's avatar
aroben committed
441 442 443 444 445 446
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
447
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setDir( 
aroben's avatar
aroben committed
448 449 450 451 452 453
        /* [in] */ BSTR /*dir*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
454
HRESULT STDMETHODCALLTYPE DOMHTMLElement::className( 
aroben's avatar
aroben committed
455 456 457 458 459 460
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
461
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setClassName( 
aroben's avatar
aroben committed
462 463 464 465 466 467
        /* [in] */ BSTR /*className*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
468
HRESULT STDMETHODCALLTYPE DOMHTMLElement::innerHTML( 
aroben's avatar
aroben committed
469 470 471 472 473 474
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
        
weinig's avatar
weinig committed
475
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setInnerHTML( 
aroben's avatar
aroben committed
476 477 478 479 480 481
        /* [in] */ BSTR /*html*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
        
weinig's avatar
weinig committed
482
HRESULT STDMETHODCALLTYPE DOMHTMLElement::innerText( 
aroben's avatar
aroben committed
483 484 485 486 487 488 489 490
        /* [retval][out] */ BSTR* result)
{
    ASSERT(m_element && m_element->isHTMLElement());
    WebCore::String innerTextString = static_cast<HTMLElement*>(m_element)->innerText();
    *result = BString(innerTextString.characters(), innerTextString.length()).release();
    return S_OK;
}
        
weinig's avatar
weinig committed
491
HRESULT STDMETHODCALLTYPE DOMHTMLElement::setInnerText( 
aroben's avatar
aroben committed
492 493 494 495 496 497 498 499 500 501
        /* [in] */ BSTR text)
{
    ASSERT(m_element && m_element->isHTMLElement());
    HTMLElement* htmlEle = static_cast<HTMLElement*>(m_element);
    WebCore::String textString(text, SysStringLen(text));
    WebCore::ExceptionCode ec = 0;
    htmlEle->setInnerText(textString, ec);
    return S_OK;
}

weinig's avatar
weinig committed
502
// DOMHTMLFormElement - IUnknown ----------------------------------------------
aroben's avatar
aroben committed
503

weinig's avatar
weinig committed
504
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
505 506
{
    *ppvObject = 0;
weinig's avatar
weinig committed
507 508
    if (IsEqualGUID(riid, IID_IDOMHTMLFormElement))
        *ppvObject = static_cast<IDOMHTMLFormElement*>(this);
aroben's avatar
aroben committed
509
    else
weinig's avatar
weinig committed
510
        return DOMHTMLElement::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
511 512 513 514 515

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
516
// DOMHTMLFormElement ---------------------------------------------------------
aroben's avatar
aroben committed
517

weinig's avatar
weinig committed
518 519
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::elements( 
        /* [retval][out] */ IDOMHTMLCollection** /*result*/)
aroben's avatar
aroben committed
520 521 522 523 524
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
525
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::length( 
aroben's avatar
aroben committed
526 527 528 529 530 531
        /* [retval][out] */ int* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
532
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::name( 
aroben's avatar
aroben committed
533 534 535 536 537 538
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
539
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setName( 
aroben's avatar
aroben committed
540 541 542 543 544 545
        /* [in] */ BSTR /*name*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
546
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::acceptCharset( 
aroben's avatar
aroben committed
547 548 549 550 551 552
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
553
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setAcceptCharset( 
aroben's avatar
aroben committed
554 555 556 557 558 559
        /* [in] */ BSTR /*acceptCharset*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
560
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::action( 
561
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
562
{
563 564 565 566
    ASSERT(m_element && m_element->hasTagName(formTag));
    WebCore::String actionString = static_cast<HTMLFormElement*>(m_element)->action();
    *result = BString(actionString.characters(), actionString.length()).release();
    return S_OK;
aroben's avatar
aroben committed
567 568
}
    
weinig's avatar
weinig committed
569
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setAction( 
aroben's avatar
aroben committed
570 571 572 573 574 575
        /* [in] */ BSTR /*action*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
576
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::encType( 
aroben's avatar
aroben committed
577 578 579 580 581 582
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
583
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setEnctype( 
aroben's avatar
aroben committed
584 585 586 587 588 589
        /* [retval][out] */ BSTR* /*encType*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
590
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::method( 
591
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
592
{
593 594 595 596
    ASSERT(m_element && m_element->hasTagName(formTag));
    WebCore::String methodString = static_cast<HTMLFormElement*>(m_element)->method();
    *result = BString(methodString.characters(), methodString.length()).release();
    return S_OK;
aroben's avatar
aroben committed
597 598
}
    
weinig's avatar
weinig committed
599
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setMethod( 
aroben's avatar
aroben committed
600 601 602 603 604 605
        /* [in] */ BSTR /*method*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
606
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::target( 
aroben's avatar
aroben committed
607 608 609 610 611 612
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
613
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::setTarget( 
aroben's avatar
aroben committed
614 615 616 617 618 619
        /* [in] */ BSTR /*target*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
620
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::submit( void)
aroben's avatar
aroben committed
621 622 623 624 625
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
626
HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::reset( void)
aroben's avatar
aroben committed
627 628 629 630 631
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
632
// DOMHTMLSelectElement - IUnknown ----------------------------------------------
aroben's avatar
aroben committed
633

weinig's avatar
weinig committed
634
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
635 636
{
    *ppvObject = 0;
weinig's avatar
weinig committed
637 638
    if (IsEqualGUID(riid, IID_IDOMHTMLSelectElement))
        *ppvObject = static_cast<IDOMHTMLSelectElement*>(this);
aroben's avatar
aroben committed
639 640 641
    else if (IsEqualGUID(riid, IID_IFormsAutoFillTransitionSelect))
        *ppvObject = static_cast<IFormsAutoFillTransitionSelect*>(this);
    else
weinig's avatar
weinig committed
642
        return DOMHTMLElement::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
643 644 645 646 647

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
648
// DOMHTMLSelectElement -------------------------------------------------------
aroben's avatar
aroben committed
649

weinig's avatar
weinig committed
650
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::type( 
aroben's avatar
aroben committed
651 652 653 654 655 656
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
657
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::selectedIndex( 
aroben's avatar
aroben committed
658 659 660 661 662 663
        /* [retval][out] */ int* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
664
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setSelectedIndx( 
aroben's avatar
aroben committed
665 666 667 668 669 670
        /* [in] */ int /*selectedIndex*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
671
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::value( 
aroben's avatar
aroben committed
672 673 674 675 676 677
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
678
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setValue( 
aroben's avatar
aroben committed
679 680 681 682 683 684
        /* [in] */ BSTR /*value*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
685
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::length( 
aroben's avatar
aroben committed
686 687 688 689 690 691
        /* [retval][out] */ int* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
692 693
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::form( 
        /* [retval][out] */ IDOMHTMLFormElement** /*result*/)
aroben's avatar
aroben committed
694 695 696 697 698
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
699
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::options( 
700
        /* [retval][out] */ IDOMHTMLOptionsCollection** result)
aroben's avatar
aroben committed
701
{
702 703 704 705 706 707 708 709 710 711 712 713 714 715
    if (!result)
        return E_POINTER;

    *result = 0;

    ASSERT(m_element);
    ASSERT(m_element->hasTagName(selectTag));
    HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_element);

    if (!selectElement->options())
        return E_FAIL;

    *result = DOMHTMLOptionsCollection::createInstance(selectElement->options().get());
    return S_OK;
aroben's avatar
aroben committed
716 717
}
    
weinig's avatar
weinig committed
718
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::disabled( 
aroben's avatar
aroben committed
719 720 721 722 723 724
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
725
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setDisabled( 
aroben's avatar
aroben committed
726 727 728 729 730 731
        /* [in] */ BOOL /*disabled*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
732
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::multiple( 
aroben's avatar
aroben committed
733 734 735 736 737 738
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
739
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setMultiple( 
aroben's avatar
aroben committed
740 741 742 743 744 745
        /* [in] */ BOOL /*multiple*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
746
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::name( 
aroben's avatar
aroben committed
747 748 749 750 751 752
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
753
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setName( 
aroben's avatar
aroben committed
754 755 756 757 758 759
        /* [in] */ BSTR /*name*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
760
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::size( 
aroben's avatar
aroben committed
761 762 763 764 765 766
        /* [retval][out] */ int* /*size*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
767
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setSize( 
aroben's avatar
aroben committed
768 769 770 771 772 773
        /* [in] */ int /*size*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
774
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::tabIndex( 
aroben's avatar
aroben committed
775 776 777 778 779 780
        /* [retval][out] */ int* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
781
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::setTabIndex( 
aroben's avatar
aroben committed
782 783 784 785 786 787
        /* [in] */ int /*tabIndex*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
788 789 790
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::add( 
        /* [in] */ IDOMHTMLElement* /*element*/,
        /* [in] */ IDOMHTMLElement* /*before*/)
aroben's avatar
aroben committed
791 792 793 794 795
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
796
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::remove( 
aroben's avatar
aroben committed
797 798 799 800 801 802
        /* [in] */ int /*index*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
803
// DOMHTMLSelectElement - IFormsAutoFillTransitionSelect ----------------------
aroben's avatar
aroben committed
804

weinig's avatar
weinig committed
805
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::activateItemAtIndex( 
806
    /* [in] */ int index)
aroben's avatar
aroben committed
807
{
808 809 810 811 812 813 814 815 816
    ASSERT(m_element);
    ASSERT(m_element->hasTagName(selectTag));
    HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_element);

    if (index >= selectElement->length())
        return E_FAIL;

    selectElement->setSelectedIndex(index);
    return S_OK;
aroben's avatar
aroben committed
817 818
}

weinig's avatar
weinig committed
819
// DOMHTMLOptionElement - IUnknown --------------------------------------------
aroben's avatar
aroben committed
820

weinig's avatar
weinig committed
821
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
822 823
{
    *ppvObject = 0;
weinig's avatar
weinig committed
824 825
    if (IsEqualGUID(riid, IID_IDOMHTMLOptionElement))
        *ppvObject = static_cast<IDOMHTMLOptionElement*>(this);
aroben's avatar
aroben committed
826
    else
weinig's avatar
weinig committed
827
        return DOMHTMLElement::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
828 829 830 831 832

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
833
// DOMHTMLOptionElement -------------------------------------------------------
aroben's avatar
aroben committed
834

weinig's avatar
weinig committed
835 836
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::form( 
        /* [retval][out] */ IDOMHTMLFormElement** /*result*/)
aroben's avatar
aroben committed
837 838 839 840 841
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
842
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::defaultSelected( 
aroben's avatar
aroben committed
843 844 845 846 847 848
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
849
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setDefaultSelected( 
aroben's avatar
aroben committed
850 851 852 853 854 855
        /* [in] */ BOOL /*defaultSelected*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
856
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::text( 
857
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
858
{
859 860 861 862 863 864 865 866 867 868 869
    if (!result)
        return E_POINTER;

    *result = 0;

    ASSERT(m_element);
    ASSERT(m_element->hasTagName(optionTag));
    HTMLOptionElement* optionElement = static_cast<HTMLOptionElement*>(m_element);

    *result = BString(optionElement->text()).release();
    return S_OK;
aroben's avatar
aroben committed
870 871
}
    
weinig's avatar
weinig committed
872
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::index( 
aroben's avatar
aroben committed
873 874 875 876 877 878
        /* [retval][out] */ int* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
879
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::disabled( 
aroben's avatar
aroben committed
880 881 882 883 884 885
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
886
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setDisabled( 
aroben's avatar
aroben committed
887 888 889 890 891 892
        /* [in] */ BOOL /*disabled*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
893
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::label( 
894
        /* [retval][out] */ BSTR* result)
aroben's avatar
aroben committed
895
{
896 897 898 899 900 901 902 903 904 905 906
    if (!result)
        return E_POINTER;

    *result = 0;

    ASSERT(m_element);
    ASSERT(m_element->hasTagName(optionTag));
    HTMLOptionElement* optionElement = static_cast<HTMLOptionElement*>(m_element);

    *result = BString(optionElement->label()).release();
    return S_OK;
aroben's avatar
aroben committed
907 908
}
    
weinig's avatar
weinig committed
909
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setLabel( 
aroben's avatar
aroben committed
910 911 912 913 914 915
        /* [in] */ BSTR /*label*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
916
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::selected( 
aroben's avatar
aroben committed
917 918 919 920 921 922
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
923
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setSelected( 
aroben's avatar
aroben committed
924 925 926 927 928 929
        /* [in] */ BOOL /*selected*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
930
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::value( 
aroben's avatar
aroben committed
931 932 933 934 935 936
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
937
HRESULT STDMETHODCALLTYPE DOMHTMLOptionElement::setValue( 
aroben's avatar
aroben committed
938 939 940 941 942 943
        /* [in] */ BSTR /*value*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}

weinig's avatar
weinig committed
944
// DOMHTMLInputElement - IUnknown ----------------------------------------------
aroben's avatar
aroben committed
945

weinig's avatar
weinig committed
946
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::QueryInterface(REFIID riid, void** ppvObject)
aroben's avatar
aroben committed
947 948
{
    *ppvObject = 0;
weinig's avatar
weinig committed
949 950
    if (IsEqualGUID(riid, IID_IDOMHTMLInputElement))
        *ppvObject = static_cast<IDOMHTMLInputElement*>(this);
aroben's avatar
aroben committed
951 952
    else if (IsEqualGUID(riid, IID_IFormsAutoFillTransition))
        *ppvObject = static_cast<IFormsAutoFillTransition*>(this);
953 954
    else if (IsEqualGUID(riid, IID_IFormPromptAdditions))
        *ppvObject = static_cast<IFormPromptAdditions*>(this);    
aroben's avatar
aroben committed
955
    else
weinig's avatar
weinig committed
956
        return DOMHTMLElement::QueryInterface(riid, ppvObject);
aroben's avatar
aroben committed
957 958 959 960 961

    AddRef();
    return S_OK;
}

weinig's avatar
weinig committed
962
// DOMHTMLInputElement --------------------------------------------------------
aroben's avatar
aroben committed
963

weinig's avatar
weinig committed
964
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::defaultValue( 
aroben's avatar
aroben committed
965 966 967 968 969 970
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
971
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setDefaultValue( 
aroben's avatar
aroben committed
972 973 974 975 976 977
        /* [in] */ BSTR /*val*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
978
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::defaultChecked( 
aroben's avatar
aroben committed
979 980 981 982 983 984
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
985
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setDefaultChecked( 
aroben's avatar
aroben committed
986 987 988 989 990 991
        /* [in] */ BSTR /*checked*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
992 993
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::form( 
        /* [retval][out] */ IDOMHTMLElement** result)
aroben's avatar
aroben committed
994
{
995 996 997 998 999
    if (!result)
        return E_POINTER;
    *result = 0;
    ASSERT(m_element && m_element->hasTagName(inputTag));
    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);
weinig's avatar
weinig committed
1000 1001
    COMPtr<IDOMElement> domElement;
    domElement.adoptRef(DOMHTMLElement::createInstance(inputElement->form()));
1002
    if (domElement)
weinig's avatar
weinig committed
1003
        return domElement->QueryInterface(IID_IDOMHTMLElement, (void**) result);
1004
    return E_FAIL;
aroben's avatar
aroben committed
1005 1006
}
    
weinig's avatar
weinig committed
1007
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::accept( 
aroben's avatar
aroben committed
1008 1009 1010 1011 1012 1013
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1014
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAccept( 
aroben's avatar
aroben committed
1015 1016 1017 1018 1019 1020
        /* [in] */ BSTR /*accept*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1021
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::accessKey( 
aroben's avatar
aroben committed
1022 1023 1024 1025 1026 1027
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1028
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAccessKey( 
aroben's avatar
aroben committed
1029 1030 1031 1032 1033 1034
        /* [in] */ BSTR /*key*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1035
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::align( 
aroben's avatar
aroben committed
1036 1037 1038 1039 1040 1041
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1042
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAlign( 
aroben's avatar
aroben committed
1043 1044 1045 1046 1047 1048
        /* [in] */ BSTR /*align*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1049
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::alt( 
aroben's avatar
aroben committed
1050 1051 1052 1053 1054 1055
        /* [retval][out] */ BSTR* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1056
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setAlt( 
aroben's avatar
aroben committed
1057 1058 1059 1060 1061 1062
        /* [in] */ BSTR /*alt*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1063
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::checked( 
aroben's avatar
aroben committed
1064 1065 1066 1067 1068 1069
        /* [retval][out] */ BOOL* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1070
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setChecked( 
aroben's avatar
aroben committed
1071 1072 1073 1074 1075 1076
        /* [in] */ BOOL /*checked*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1077
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::disabled( 
aroben's avatar
aroben committed
1078 1079 1080 1081 1082 1083 1084 1085
        /* [retval][out] */ BOOL* result)
{
    ASSERT(m_element && m_element->hasTagName(inputTag));
    HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);
    *result = inputElement->disabled() ? TRUE : FALSE;
    return S_OK;
}
    
weinig's avatar
weinig committed
1086
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setDisabled( 
aroben's avatar
aroben committed
1087 1088 1089 1090 1091 1092
        /* [in] */ BOOL /*disabled*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1093
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::maxLength( 
aroben's avatar
aroben committed
1094 1095 1096 1097 1098 1099
        /* [retval][out] */ int* /*result*/)
{
    ASSERT_NOT_REACHED();
    return E_NOTIMPL;
}
    
weinig's avatar
weinig committed
1100
HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setMaxLength( 
aroben's avatar
aroben committed
1101