Changeset 54999 in webkit
- Timestamp:
- Feb 18, 2010 9:00:52 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r54993 r54999 1 2010-02-18 Yaar Schnitman <yaar@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Normalize custom ctors for Image, Option, Audio 6 https://bugs.webkit.org/show_bug.cgi?id=34782 7 8 * fast/js/custom-constructors-expected.txt: Added. 9 * fast/js/custom-constructors.html: Added. 10 * fast/js/script-tests/custom-constructors.js: Added. 11 1 12 2010-02-18 Alexey Proskuryakov <ap@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r54997 r54999 1 2010-02-18 Yaar Schnitman <yaar@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Normalize custom ctors for Image, Option, Audio 6 https://bugs.webkit.org/show_bug.cgi?id=34782 7 8 Test: fast/js/custom-constructors.html 9 10 * bindings/js/JSAudioConstructor.cpp: 11 (WebCore::JSAudioConstructor::JSAudioConstructor): 12 (WebCore::constructAudio): 13 * bindings/js/JSImageConstructor.cpp: 14 (WebCore::constructImage): 15 * bindings/js/JSOptionConstructor.cpp: 16 (WebCore::constructHTMLOptionElement): 17 * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp: 18 (WebCore::v8HTMLAudioElementConstructorCallback): 19 * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: 20 (WebCore::v8HTMLImageElementConstructorCallback): 21 * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp: 22 (WebCore::v8HTMLOptionElementConstructorCallback): 23 * html/HTMLAudioElement.cpp: 24 (WebCore::HTMLAudioElement::HTMLAudioElement): 25 (WebCore::HTMLAudioElement::createForJSConstructor): 26 * html/HTMLAudioElement.h: 27 * html/HTMLImageElement.cpp: 28 (WebCore::HTMLImageElement::createForJSConstructor): 29 (WebCore::HTMLImageElement::mapToEntry): 30 (WebCore::HTMLImageElement::createRenderer): 31 (WebCore::HTMLImageElement::attach): 32 (WebCore::HTMLImageElement::width): 33 (WebCore::HTMLImageElement::height): 34 (WebCore::HTMLImageElement::naturalHeight): 35 * html/HTMLImageElement.h: 36 * html/HTMLOptionElement.cpp: 37 (WebCore::HTMLOptionElement::HTMLOptionElement): 38 (WebCore::HTMLOptionElement::createForJSConstructor): 39 (WebCore::HTMLOptionElement::ownerSelectElement): 40 (WebCore::HTMLOptionElement::nonRendererRenderStyle): 41 (WebCore::HTMLOptionElement::disabled): 42 (WebCore::HTMLOptionElement::insertedIntoTree): 43 * html/HTMLOptionElement.h: 44 1 45 2010-02-12 Brett Wilson <brettw@chromium.org> 2 46 -
trunk/WebCore/bindings/js/JSAudioConstructor.cpp
r47236 r54999 1 1 /* 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 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. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 … … 31 31 32 32 #include "HTMLAudioElement.h" 33 #include "HTMLNames.h"34 33 #include "JSHTMLAudioElement.h" 35 #include "ScriptExecutionContext.h"36 #include "Text.h"37 34 #include <runtime/Error.h> 38 35 … … 47 44 { 48 45 putDirect(exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), None); 49 putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly |DontDelete|DontEnum);46 putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum); 50 47 } 51 48 52 49 static JSObject* constructAudio(ExecState* exec, JSObject* constructor, const ArgList& args) 53 50 { 54 JSAudioConstructor* js Audio= static_cast<JSAudioConstructor*>(constructor);55 // FIXME: Why doesn't this need the call toJS on the document like JSImageConstructor? 56 Document* document = js Audio->document();51 JSAudioConstructor* jsConstructor = static_cast<JSAudioConstructor*>(constructor); 52 53 Document* document = jsConstructor->document(); 57 54 if (!document) 58 55 return throwError(exec, ReferenceError, "Audio constructor associated document is unavailable"); 59 56 60 RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(HTMLNames::audioTag, document); 61 audio->setAutobuffer(true); 62 if (args.size() > 0) { 63 audio->setSrc(args.at(0).toString(exec)); 64 audio->scheduleLoad(); 65 } 66 return asObject(toJS(exec, jsAudio->globalObject(), audio.release())); 57 // Calling toJS on the document causes the JS document wrapper to be 58 // added to the window object. This is done to ensure that JSDocument::markChildren 59 // will be called, which will cause the audio element to be marked if necessary. 60 toJS(exec, jsConstructor->globalObject(), document); 61 62 // FIXME: This converts an undefined argument to the string "undefined", but possibly we 63 // should treat it as if no argument was passed instead, by checking the value of args.at 64 // rather than looking at args.size. 65 String src; 66 if (args.size() > 0) 67 src = args.at(0).toString(exec); 68 return asObject(toJS(exec, jsConstructor->globalObject(), 69 HTMLAudioElement::createForJSConstructor(document, src))); 67 70 } 68 71 -
trunk/WebCore/bindings/js/JSImageConstructor.cpp
r47236 r54999 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 25 25 #include "JSHTMLImageElement.h" 26 26 #include "JSNode.h" 27 #include "ScriptExecutionContext.h"28 27 #include <runtime/Error.h> 29 28 … … 44 43 static JSObject* constructImage(ExecState* exec, JSObject* constructor, const ArgList& args) 45 44 { 46 bool widthSet = false;47 bool heightSet = false;48 int width = 0;49 int height = 0;50 if (args.size() > 0) {51 widthSet = true;52 width = args.at(0).toInt32(exec);53 }54 if (args.size() > 1) {55 heightSet = true;56 height = args.at(1).toInt32(exec);57 }58 59 45 JSImageConstructor* jsConstructor = static_cast<JSImageConstructor*>(constructor); 60 46 Document* document = jsConstructor->document(); … … 63 49 64 50 // Calling toJS on the document causes the JS document wrapper to be 65 // added to the window object. This is done to ensure that JSDocument::mark 66 // will be called (which will cause the image element to be marked if necessary).51 // added to the window object. This is done to ensure that JSDocument::markChildren 52 // will be called, which will cause the image element to be marked if necessary. 67 53 toJS(exec, jsConstructor->globalObject(), document); 54 int width; 55 int height; 56 int* optionalWidth = 0; 57 int* optionalHeight = 0; 58 if (args.size() > 0) { 59 width = args.at(0).toInt32(exec); 60 optionalWidth = &width; 61 } 62 if (args.size() > 1) { 63 height = args.at(1).toInt32(exec); 64 optionalHeight = &height; 65 } 68 66 69 RefPtr<HTMLImageElement> image = new HTMLImageElement(HTMLNames::imgTag, document); 70 if (widthSet) 71 image->setWidth(width); 72 if (heightSet) 73 image->setHeight(height); 74 return asObject(toJS(exec, jsConstructor->globalObject(), image.release())); 67 return asObject(toJS(exec, jsConstructor->globalObject(), 68 HTMLImageElement::createForJSConstructor(document, optionalWidth, optionalHeight))); 75 69 } 76 70 -
trunk/WebCore/bindings/js/JSOptionConstructor.cpp
r47236 r54999 50 50 return throwError(exec, ReferenceError, "Option constructor associated document is unavailable"); 51 51 52 RefPtr<HTMLOptionElement> element = static_pointer_cast<HTMLOptionElement>(document->createElement(HTMLNames::optionTag, false)); 52 String data; 53 if (!args.at(0).isUndefined()) 54 data = args.at(0).toString(exec); 55 56 String value; 57 if (!args.at(1).isUndefined()) 58 value = args.at(1).toString(exec); 59 bool defaultSelected = args.at(2).toBoolean(exec); 60 bool selected = args.at(3).toBoolean(exec); 53 61 54 62 ExceptionCode ec = 0; 55 RefPtr<Text> text = document->createTextNode(""); 56 if (!args.at(0).isUndefined()) 57 text->setData(args.at(0).toString(exec), ec); 58 if (ec == 0) 59 element->appendChild(text.release(), ec); 60 if (ec == 0 && !args.at(1).isUndefined()) 61 element->setValue(args.at(1).toString(exec)); 62 if (ec == 0) 63 element->setDefaultSelected(args.at(2).toBoolean(exec)); 64 if (ec == 0) 65 element->setSelected(args.at(3).toBoolean(exec)); 66 63 RefPtr<HTMLOptionElement> element = HTMLOptionElement::createForJSConstructor(document, data, value, defaultSelected, selected, ec); 67 64 if (ec) { 68 65 setDOMException(exec, ec); -
trunk/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
r54425 r54999 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 61 61 62 62 // Make sure the document is added to the DOM Node map. Otherwise, the HTMLAudioElement instance 63 // may end up being the only node in the map and get garbage-c collected prematurely.63 // may end up being the only node in the map and get garbage-collected prematurely. 64 64 toV8(document); 65 65 66 RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(HTMLNames::audioTag, document); 67 audio->setAutobuffer(true); 68 if (args.Length() > 0) { 69 audio->setSrc(toWebCoreString(args[0])); 70 audio->scheduleLoad(); 71 } 66 67 String src; 68 if (args.Length() > 0) 69 src = toWebCoreString(args[0]); 70 RefPtr<HTMLAudioElement> audio = HTMLAudioElement::createForJSConstructor(document, src); 72 71 73 72 V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::AUDIO), audio.get()); -
trunk/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
r54425 r54999 1 1 /* 2 * Copyright (C) 2009 Google Inc. All rights reserved.2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 62 62 // Make sure the document is added to the DOM Node map. Otherwise, the HTMLImageElement instance 63 63 // may end up being the only node in the map and get garbage-ccollected prematurely. 64 // FIXME: The correct way to do this would be to make HTMLImageElement derive from 65 // ActiveDOMObject and use its interface to keep its wrapper alive. Then we would 66 // remove this code and the special case in isObservableThroughDOM. 64 67 toV8(document); 65 68 66 RefPtr<HTMLImageElement> image = new HTMLImageElement(HTMLNames::imgTag, document); 69 int width; 70 int height; 71 int* optionalWidth = 0; 72 int* optionalHeight = 0; 67 73 if (args.Length() > 0) { 68 image->setWidth(toInt32(args[0])); 69 if (args.Length() > 1) 70 image->setHeight(toInt32(args[1])); 74 width = toInt32(args[0]); 75 optionalWidth = &width; 76 } 77 if (args.Length() > 1) { 78 height = toInt32(args[1]); 79 optionalHeight = &height; 71 80 } 72 81 82 RefPtr<HTMLImageElement> image = HTMLImageElement::createForJSConstructor(document, optionalWidth, optionalHeight); 73 83 V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::IMAGE), image.get()); 74 84 image->ref(); -
trunk/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
r54425 r54999 15 15 * contributors may be used to endorse or promote products derived from 16 16 * this software without specific prior written permission. 17 * 17 * 18 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT … … 60 60 return throwError("Option constructor associated document is unavailable", V8Proxy::ReferenceError); 61 61 62 RefPtr<HTMLOptionElement> option = new HTMLOptionElement(HTMLNames::optionTag, document); 62 String data; 63 String value; 64 bool defaultSelected = false; 65 bool selected = false; 66 if (args.Length() > 0 && !args[0]->IsUndefined()) 67 data = toWebCoreString(args[0]); 68 if (args.Length() > 1 && !args[1]->IsUndefined()) 69 value = toWebCoreString(args[1]); 70 if (args.Length() > 2) 71 defaultSelected = args[2]->BooleanValue(); 72 if (args.Length() > 3) 73 selected = args[3]->BooleanValue(); 63 74 64 75 ExceptionCode ec = 0; 65 RefPtr<Text> text = document->createTextNode(""); 66 if (args.Length() > 0) { 67 if (!args[0]->IsUndefined()) { 68 text->setData(toWebCoreString(args[0]), ec); 69 if (ec) 70 throwError(ec); 71 } 76 RefPtr<HTMLOptionElement> option = HTMLOptionElement::createForJSConstructor(document, data, value, defaultSelected, selected, ec); 72 77 73 option->appendChild(text.release(), ec); 74 if (ec) 75 throwError(ec); 76 77 if (args.Length() > 1) { 78 if (!args[1]->IsUndefined()) 79 option->setValue(toWebCoreString(args[1])); 80 81 if (args.Length() > 2) { 82 option->setDefaultSelected(args[2]->BooleanValue()); 83 if (args.Length() > 3) 84 option->setSelected(args[3]->BooleanValue()); 85 } 86 } 87 } 78 if (ec) 79 throwError(ec); 88 80 89 81 V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::OPTION), option.get()); -
trunk/WebCore/html/HTMLAudioElement.cpp
r38881 r54999 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 21 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 23 * (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 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 25 */ 25 26 … … 35 36 using namespace HTMLNames; 36 37 37 HTMLAudioElement::HTMLAudioElement(const QualifiedName& tagName, Document* doc )38 : HTMLMediaElement(tagName, doc )38 HTMLAudioElement::HTMLAudioElement(const QualifiedName& tagName, Document* document) 39 : HTMLMediaElement(tagName, document) 39 40 { 40 41 ASSERT(hasTagName(audioTag)); 41 42 } 42 43 44 PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document* document, const String& src) 45 { 46 RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(audioTag, document); 47 audio->setAutobuffer(true); 48 if (!src.isNull()) { 49 audio->setSrc(src); 50 audio->scheduleLoad(); 51 } 52 return audio.release(); 53 } 54 43 55 } 44 56 #endif -
trunk/WebCore/html/HTMLAudioElement.h
r54849 r54999 1 1 /* 2 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 21 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 23 * (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 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 25 */ 25 26 … … 29 30 #if ENABLE(VIDEO) 30 31 32 #include "Document.h" 31 33 #include "HTMLMediaElement.h" 32 34 … … 35 37 class HTMLAudioElement : public HTMLMediaElement { 36 38 public: 39 static PassRefPtr<HTMLAudioElement> createForJSConstructor(Document*, const String& src); 37 40 HTMLAudioElement(const QualifiedName&, Document*); 38 39 41 private: 40 42 virtual bool isVideo() const { return false; } -
trunk/WebCore/html/HTMLImageElement.cpp
r54242 r54999 2 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 59 60 } 60 61 62 PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document* document, const int* optionalWidth, const int* optionalHeight) 63 { 64 RefPtr<HTMLImageElement> image = new HTMLImageElement(imgTag, document); 65 if (optionalWidth) 66 image->setWidth(*optionalWidth); 67 if (optionalHeight > 0) 68 image->setHeight(*optionalHeight); 69 return image.release(); 70 } 71 61 72 bool HTMLImageElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const 62 73 { … … 69 80 return false; 70 81 } 71 82 72 83 if (attrName == borderAttr || attrName == alignAttr) { 73 84 result = eReplaced; // Shared with embed and iframe elements. … … 162 173 if (style->contentData()) 163 174 return RenderObject::createObject(this, style); 164 175 165 176 return new (arena) RenderImage(this); 166 177 } … … 175 186 return; 176 187 imageObj->setCachedImage(m_imageLoader.image()); 177 188 178 189 // If we have no image at all because we have no src attribute, set 179 190 // image height and width for the alt text instead. … … 242 253 if (ok) 243 254 return width; 244 255 245 256 // if the image is available, use its width 246 257 if (m_imageLoader.image()) { … … 266 277 if (ok) 267 278 return height; 268 279 269 280 // if the image is available, use its height 270 281 if (m_imageLoader.image()) { … … 294 305 if (!m_imageLoader.image()) 295 306 return 0; 296 307 297 308 return m_imageLoader.image()->imageSize(1.0f).height(); 298 309 } 299 310 300 311 bool HTMLImageElement::isURLAttribute(Attribute* attr) const 301 312 { -
trunk/WebCore/html/HTMLImageElement.h
r53812 r54999 2 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 35 36 friend class HTMLFormElement; 36 37 public: 38 static PassRefPtr<HTMLImageElement> createForJSConstructor(Document*, const int* optionalWidth, const int* optionalHeight); 39 37 40 HTMLImageElement(const QualifiedName&, Document*, HTMLFormElement* = 0); 38 41 ~HTMLImageElement(); … … 54 57 int naturalWidth() const; 55 58 int naturalHeight() const; 56 59 57 60 bool isServerMap() const { return ismap && usemap.isEmpty(); } 58 61 -
trunk/WebCore/html/HTMLOptionElement.cpp
r53761 r54999 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.6 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 42 43 using namespace HTMLNames; 43 44 44 HTMLOptionElement::HTMLOptionElement(const QualifiedName& tagName, Document* doc , HTMLFormElement* f)45 : HTMLFormControlElement(tagName, doc , f)45 HTMLOptionElement::HTMLOptionElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 46 : HTMLFormControlElement(tagName, document, form) 46 47 , m_style(0) 47 48 { 48 49 ASSERT(hasTagName(optionTag)); 50 } 51 52 PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document* document, const String& data, const String& value, 53 bool defaultSelected, bool selected, ExceptionCode& ec) 54 { 55 RefPtr<HTMLOptionElement> element = new HTMLOptionElement(optionTag, document); 56 57 RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data); 58 59 ec = 0; 60 element->appendChild(text.release(), ec); 61 if (ec) 62 return 0; 63 64 if (!value.isNull()) 65 element->setValue(value); 66 element->setDefaultSelected(defaultSelected); 67 element->setSelected(selected); 68 69 return element.release(); 49 70 } 50 71 … … 175 196 if (!select) 176 197 return 0; 177 198 178 199 return static_cast<HTMLSelectElement*>(select); 179 200 } … … 204 225 } 205 226 206 RenderStyle* HTMLOptionElement::nonRendererRenderStyle() const 207 { 208 return m_style.get(); 227 RenderStyle* HTMLOptionElement::nonRendererRenderStyle() const 228 { 229 return m_style.get(); 209 230 } 210 231 … … 215 236 216 237 bool HTMLOptionElement::disabled() const 217 { 218 return ownElementDisabled() || (parentNode() && static_cast<HTMLFormControlElement*>(parentNode())->disabled()); 238 { 239 return ownElementDisabled() || (parentNode() && static_cast<HTMLFormControlElement*>(parentNode())->disabled()); 219 240 } 220 241 … … 228 249 select->scrollToSelection(); 229 250 } 230 251 231 252 HTMLFormControlElement::insertedIntoTree(deep); 232 253 } -
trunk/WebCore/html/HTMLOptionElement.h
r53512 r54999 4 4 * (C) 2000 Dirk Mueller (mueller@kde.org) 5 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 6 * Copyright (C) 2010 Google Inc. All rights reserved. 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 40 41 HTMLOptionElement(const QualifiedName&, Document*, HTMLFormElement* = 0); 41 42 43 static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document*, const String& data, const String& value, 44 bool defaultSelected, bool selected, ExceptionCode&); 45 42 46 virtual HTMLTagStatus endTagRequirement() const { return TagStatusOptional; } 43 47 virtual int tagPriority() const { return 2; } … … 49 53 virtual void detach(); 50 54 virtual void setRenderStyle(PassRefPtr<RenderStyle>); 51 55 52 56 virtual const AtomicString& formControlType() const; 53 57 … … 79 83 bool ownElementDisabled() const { return HTMLFormControlElement::disabled(); } 80 84 virtual bool disabled() const; 81 85 82 86 virtual void insertedIntoTree(bool); 83 87 virtual void accessKeyAction(bool); 84 88 85 89 private: 86 90 virtual RenderStyle* nonRendererRenderStyle() const;
Note: See TracChangeset
for help on using the changeset viewer.