diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 11:52:57 +1000 |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 11:52:57 +1000 |
commit | aa9cf406d62004519ad54596e1c391f9a6439210 (patch) | |
tree | dd562b9c296981f2761b76623911be8496c7af84 /src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp | |
parent | 987aec28b950e1c9817a20a9dd71afc071cd93ea (diff) | |
parent | 56b6a5924008ab5cdbae36e9662eddba923acd5e (diff) |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp index 9e818ff68..2b8bd5d97 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSOptionConstructor.cpp @@ -35,24 +35,16 @@ ASSERT_CLASS_FITS_IN_CELL(JSOptionConstructor); const ClassInfo JSOptionConstructor::s_info = { "OptionConstructor", 0, 0, 0 }; JSOptionConstructor::JSOptionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) - : DOMObject(JSOptionConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype())) - , m_globalObject(globalObject) + : DOMConstructorWithDocument(JSOptionConstructor::createStructure(globalObject->objectPrototype()), globalObject) { - ASSERT(globalObject->scriptExecutionContext()); - ASSERT(globalObject->scriptExecutionContext()->isDocument()); - - putDirect(exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, exec->lexicalGlobalObject()), None); + putDirect(exec->propertyNames().prototype, JSHTMLOptionElementPrototype::self(exec, globalObject), None); putDirect(exec->propertyNames().length, jsNumber(exec, 4), ReadOnly|DontDelete|DontEnum); } -Document* JSOptionConstructor::document() const -{ - return static_cast<Document*>(m_globalObject->scriptExecutionContext()); -} - static JSObject* constructHTMLOptionElement(ExecState* exec, JSObject* constructor, const ArgList& args) { - Document* document = static_cast<JSOptionConstructor*>(constructor)->document(); + JSOptionConstructor* jsConstructor = static_cast<JSOptionConstructor*>(constructor); + Document* document = jsConstructor->document(); if (!document) return throwError(exec, ReferenceError, "Option constructor associated document is unavailable"); @@ -76,7 +68,7 @@ static JSObject* constructHTMLOptionElement(ExecState* exec, JSObject* construct return 0; } - return asObject(toJS(exec, element.release())); + return asObject(toJS(exec, jsConstructor->globalObject(), element.release())); } ConstructType JSOptionConstructor::getConstructData(ConstructData& constructData) @@ -85,11 +77,5 @@ ConstructType JSOptionConstructor::getConstructData(ConstructData& constructData return ConstructTypeHost; } -void JSOptionConstructor::mark() -{ - DOMObject::mark(); - if (!m_globalObject->marked()) - m_globalObject->mark(); -} } // namespace WebCore |