Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: Source/core/html/HTMLOptionElement.cpp

Issue 66643004: Remove QualifiedName argument from most HTMLElement::create functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Hack for XML prefix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 28 matching lines...) Expand all
39 #include "core/html/HTMLSelectElement.h" 39 #include "core/html/HTMLSelectElement.h"
40 #include "core/html/parser/HTMLParserIdioms.h" 40 #include "core/html/parser/HTMLParserIdioms.h"
41 #include "core/rendering/RenderTheme.h" 41 #include "core/rendering/RenderTheme.h"
42 #include "wtf/Vector.h" 42 #include "wtf/Vector.h"
43 #include "wtf/text/StringBuilder.h" 43 #include "wtf/text/StringBuilder.h"
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 using namespace HTMLNames; 47 using namespace HTMLNames;
48 48
49 HTMLOptionElement::HTMLOptionElement(const QualifiedName& tagName, Document& doc ument) 49 HTMLOptionElement::HTMLOptionElement(Document& document)
50 : HTMLElement(tagName, document) 50 : HTMLElement(optionTag, document)
51 , m_disabled(false) 51 , m_disabled(false)
52 , m_isSelected(false) 52 , m_isSelected(false)
53 { 53 {
54 ASSERT(hasTagName(optionTag));
55 setHasCustomStyleCallbacks(); 54 setHasCustomStyleCallbacks();
56 ScriptWrappable::init(this); 55 ScriptWrappable::init(this);
57 } 56 }
58 57
59 PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(Document& document) 58 PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(Document& document)
60 { 59 {
61 return adoptRef(new HTMLOptionElement(optionTag, document)); 60 return adoptRef(new HTMLOptionElement(document));
62 }
63
64 PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(const QualifiedName& tag Name, Document& document)
65 {
66 return adoptRef(new HTMLOptionElement(tagName, document));
67 } 61 }
68 62
69 PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document & document, const String& data, const String& value, 63 PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document & document, const String& data, const String& value,
70 bool defaultSelected, bool selected, ExceptionState& es) 64 bool defaultSelected, bool selected, ExceptionState& es)
71 { 65 {
72 RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(optionTag , document)); 66 RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(document) );
73 67
74 RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data); 68 RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data);
75 69
76 element->appendChild(text.release(), es); 70 element->appendChild(text.release(), es);
77 if (es.hadException()) 71 if (es.hadException())
78 return 0; 72 return 0;
79 73
80 if (!value.isNull()) 74 if (!value.isNull())
81 element->setValue(value); 75 element->setValue(value);
82 if (defaultSelected) 76 if (defaultSelected)
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // Text nodes inside script elements are not part of the option text. 360 // Text nodes inside script elements are not part of the option text.
367 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node))) 361 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node)))
368 node = NodeTraversal::nextSkippingChildren(node, this); 362 node = NodeTraversal::nextSkippingChildren(node, this);
369 else 363 else
370 node = NodeTraversal::next(node, this); 364 node = NodeTraversal::next(node, this);
371 } 365 }
372 return text.toString(); 366 return text.toString();
373 } 367 }
374 368
375 } // namespace WebCore 369 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698