OLD | NEW |
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 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 using namespace std; | 85 using namespace std; |
86 | 86 |
87 namespace WebCore { | 87 namespace WebCore { |
88 | 88 |
89 using namespace HTMLNames; | 89 using namespace HTMLNames; |
90 | 90 |
91 #if ENABLE(DATALIST_ELEMENT) | 91 #if ENABLE(DATALIST_ELEMENT) |
92 class ListAttributeTargetObserver : IdTargetObserver { | 92 class ListAttributeTargetObserver : IdTargetObserver { |
93 WTF_MAKE_FAST_ALLOCATED; | 93 WTF_MAKE_FAST_ALLOCATED; |
94 public: | 94 public: |
95 static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id
, HTMLInputElement*); | 95 static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id
, Handle<HTMLInputElement>); |
96 virtual void idTargetChanged() OVERRIDE; | 96 virtual void idTargetChanged() OVERRIDE; |
97 | 97 |
98 private: | 98 private: |
99 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); | 99 ListAttributeTargetObserver(const AtomicString& id, Handle<HTMLInputElement>
); |
100 | 100 |
| 101 // FIXME(oilpan): This creates a cycle if we use a Persistent. Implement a w
eak handle. |
101 HTMLInputElement* m_element; | 102 HTMLInputElement* m_element; |
102 }; | 103 }; |
103 #endif | 104 #endif |
104 | 105 |
105 // FIXME: According to HTML4, the length attribute's value can be arbitrarily | 106 // FIXME: According to HTML4, the length attribute's value can be arbitrarily |
106 // large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things | 107 // large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things |
107 // get rather sluggish when a text field has a larger number of characters than | 108 // get rather sluggish when a text field has a larger number of characters than |
108 // this, even when just clicking in the text field. | 109 // this, even when just clicking in the text field. |
109 const int HTMLInputElement::maximumLength = 524288; | 110 const int HTMLInputElement::maximumLength = 524288; |
110 const int defaultSize = 20; | 111 const int defaultSize = 20; |
(...skipping 13 matching lines...) Expand all Loading... |
124 , m_isAutofilled(false) | 125 , m_isAutofilled(false) |
125 #if ENABLE(DATALIST_ELEMENT) | 126 #if ENABLE(DATALIST_ELEMENT) |
126 , m_hasNonEmptyList(false) | 127 , m_hasNonEmptyList(false) |
127 #endif | 128 #endif |
128 , m_stateRestored(false) | 129 , m_stateRestored(false) |
129 , m_parsingInProgress(createdByParser) | 130 , m_parsingInProgress(createdByParser) |
130 , m_valueAttributeWasUpdatedAfterParsing(false) | 131 , m_valueAttributeWasUpdatedAfterParsing(false) |
131 , m_wasModifiedByUser(false) | 132 , m_wasModifiedByUser(false) |
132 , m_canReceiveDroppedFiles(false) | 133 , m_canReceiveDroppedFiles(false) |
133 , m_hasTouchEventHandler(false) | 134 , m_hasTouchEventHandler(false) |
134 , m_inputType(InputType::createText(this)) | 135 , m_inputType(InputType::createText(Handle<HTMLInputElement>(this))) |
135 { | 136 { |
136 ASSERT(hasTagName(inputTag) || hasTagName(isindexTag)); | 137 ASSERT(hasTagName(inputTag) || hasTagName(isindexTag)); |
137 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 138 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
138 setHasCustomStyleCallbacks(); | 139 setHasCustomStyleCallbacks(); |
139 #endif | 140 #endif |
140 ScriptWrappable::init(this); | 141 ScriptWrappable::init(this); |
141 } | 142 } |
142 | 143 |
143 PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagNa
me, Document* document, HTMLFormElement* form, bool createdByParser) | 144 Result<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagName,
Document* document, HTMLFormElement* form, bool createdByParser) |
144 { | 145 { |
145 RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(tagNam
e, document, form, createdByParser)); | 146 Handle<HTMLInputElement> inputElement = adoptNode(new HTMLInputElement(tagNa
me, document, form, createdByParser)); |
146 inputElement->ensureUserAgentShadowRoot(); | 147 inputElement->ensureUserAgentShadowRoot(); |
147 return inputElement.release(); | 148 return inputElement; |
148 } | 149 } |
149 | 150 |
150 HTMLImageLoader* HTMLInputElement::imageLoader() | 151 HTMLImageLoader* HTMLInputElement::imageLoader() |
151 { | 152 { |
152 if (!m_imageLoader) | 153 if (!m_imageLoader) |
153 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); | 154 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); |
154 return m_imageLoader.get(); | 155 return m_imageLoader.get(); |
155 } | 156 } |
156 | 157 |
157 void HTMLInputElement::didAddUserAgentShadowRoot(ShadowRoot*) | 158 void HTMLInputElement::didAddUserAgentShadowRoot(ShadowRoot*) |
158 { | 159 { |
159 m_inputType->createShadowSubtree(); | 160 m_inputType->createShadowSubtree(); |
160 } | 161 } |
161 | 162 |
162 HTMLInputElement::~HTMLInputElement() | 163 HTMLInputElement::~HTMLInputElement() |
163 { | 164 { |
164 // Need to remove form association while this is still an HTMLInputElement | 165 // Need to remove form association while this is still an HTMLInputElement |
165 // so that virtual functions are called correctly. | 166 // so that virtual functions are called correctly. |
166 setForm(0); | 167 setForm(0); |
167 // setForm(0) may register this to a document-level radio button group. | 168 // setForm(0) may register this to a document-level radio button group. |
168 // We should unregister it to avoid accessing a deleted object. | 169 // We should unregister it to avoid accessing a deleted object. |
169 if (isRadioButton()) | 170 if (isRadioButton()) |
170 document()->formController()->checkedRadioButtons().removeButton(this); | 171 document()->formController()->checkedRadioButtons().removeButton(Handle<
HTMLInputElement>(this)); |
171 if (m_hasTouchEventHandler) | 172 if (m_hasTouchEventHandler) |
172 document()->didRemoveEventTargetNode(this); | 173 document()->didRemoveEventTargetNode(this); |
173 } | 174 } |
174 | 175 |
175 const AtomicString& HTMLInputElement::name() const | 176 const AtomicString& HTMLInputElement::name() const |
176 { | 177 { |
177 return m_name.isNull() ? emptyAtom : m_name; | 178 return m_name.isNull() ? emptyAtom : m_name; |
178 } | 179 } |
179 | 180 |
180 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState
(const FormControlState& state) | 181 Vector<FileChooserFileInfo> HTMLInputElement::filesFromFileInputFormControlState
(const FormControlState& state) |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 // attribute in other browsers and then fix this. Note that setting to null
*does* remove | 442 // attribute in other browsers and then fix this. Note that setting to null
*does* remove |
442 // the attribute and setAttribute implements that. | 443 // the attribute and setAttribute implements that. |
443 if (type.isEmpty()) | 444 if (type.isEmpty()) |
444 removeAttribute(typeAttr); | 445 removeAttribute(typeAttr); |
445 else | 446 else |
446 setAttribute(typeAttr, type); | 447 setAttribute(typeAttr, type); |
447 } | 448 } |
448 | 449 |
449 void HTMLInputElement::updateType() | 450 void HTMLInputElement::updateType() |
450 { | 451 { |
451 OwnPtr<InputType> newType = InputType::create(this, fastGetAttribute(typeAtt
r)); | 452 OwnPtr<InputType> newType = InputType::create(Handle<HTMLInputElement>(this)
, fastGetAttribute(typeAttr)); |
452 bool hadType = m_hasType; | 453 bool hadType = m_hasType; |
453 m_hasType = true; | 454 m_hasType = true; |
454 if (m_inputType->formControlType() == newType->formControlType()) | 455 if (m_inputType->formControlType() == newType->formControlType()) |
455 return; | 456 return; |
456 | 457 |
457 if (hadType && !newType->canChangeFromAnotherType()) { | 458 if (hadType && !newType->canChangeFromAnotherType()) { |
458 // Set the attribute back to the old value. | 459 // Set the attribute back to the old value. |
459 // Useful in case we were called from inside parseAttribute. | 460 // Useful in case we were called from inside parseAttribute. |
460 setAttribute(typeAttr, type()); | 461 setAttribute(typeAttr, type()); |
461 return; | 462 return; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) | 850 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) |
850 { | 851 { |
851 if (checked() == nowChecked) | 852 if (checked() == nowChecked) |
852 return; | 853 return; |
853 | 854 |
854 m_reflectsCheckedAttribute = false; | 855 m_reflectsCheckedAttribute = false; |
855 m_isChecked = nowChecked; | 856 m_isChecked = nowChecked; |
856 setNeedsStyleRecalc(); | 857 setNeedsStyleRecalc(); |
857 | 858 |
858 if (CheckedRadioButtons* buttons = checkedRadioButtons()) | 859 if (CheckedRadioButtons* buttons = checkedRadioButtons()) |
859 buttons->updateCheckedState(this); | 860 buttons->updateCheckedState(Handle<HTMLInputElement>(this)); |
860 if (renderer() && renderer()->style()->hasAppearance()) | 861 if (renderer() && renderer()->style()->hasAppearance()) |
861 renderer()->theme()->stateChanged(renderer(), CheckedState); | 862 renderer()->theme()->stateChanged(renderer(), CheckedState); |
862 setNeedsValidityCheck(); | 863 setNeedsValidityCheck(); |
863 | 864 |
864 // Ideally we'd do this from the render tree (matching | 865 // Ideally we'd do this from the render tree (matching |
865 // RenderTextView), but it's not possible to do it at the moment | 866 // RenderTextView), but it's not possible to do it at the moment |
866 // because of the way the code is structured. | 867 // because of the way the code is structured. |
867 if (renderer()) { | 868 if (renderer()) { |
868 if (AXObjectCache* cache = renderer()->document()->existingAXObjectCache
()) | 869 if (AXObjectCache* cache = renderer()->document()->existingAXObjectCache
()) |
869 cache->checkedStateChanged(this); | 870 cache->checkedStateChanged(this); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 if (!predicate(trimmedType)) | 1248 if (!predicate(trimmedType)) |
1248 continue; | 1249 continue; |
1249 types.append(trimmedType.lower()); | 1250 types.append(trimmedType.lower()); |
1250 } | 1251 } |
1251 | 1252 |
1252 return types; | 1253 return types; |
1253 } | 1254 } |
1254 | 1255 |
1255 Vector<String> HTMLInputElement::acceptMIMETypes() | 1256 Vector<String> HTMLInputElement::acceptMIMETypes() |
1256 { | 1257 { |
1257 return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidMIMEType); | 1258 return parseAcceptAttribute(fastGetAttribute(accept_Attr), isValidMIMEType); |
1258 } | 1259 } |
1259 | 1260 |
1260 Vector<String> HTMLInputElement::acceptFileExtensions() | 1261 Vector<String> HTMLInputElement::acceptFileExtensions() |
1261 { | 1262 { |
1262 return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidFileExtensi
on); | 1263 return parseAcceptAttribute(fastGetAttribute(accept_Attr), isValidFileExtens
ion); |
1263 } | 1264 } |
1264 | 1265 |
1265 String HTMLInputElement::accept() const | 1266 String HTMLInputElement::acceptAttribute() const |
1266 { | 1267 { |
1267 return fastGetAttribute(acceptAttr); | 1268 return fastGetAttribute(accept_Attr); |
1268 } | 1269 } |
1269 | 1270 |
1270 String HTMLInputElement::alt() const | 1271 String HTMLInputElement::alt() const |
1271 { | 1272 { |
1272 return fastGetAttribute(altAttr); | 1273 return fastGetAttribute(altAttr); |
1273 } | 1274 } |
1274 | 1275 |
1275 int HTMLInputElement::maxLength() const | 1276 int HTMLInputElement::maxLength() const |
1276 { | 1277 { |
1277 return m_maxLength; | 1278 return m_maxLength; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 #endif | 1453 #endif |
1453 } | 1454 } |
1454 | 1455 |
1455 void HTMLInputElement::didMoveToNewDocument(Document* oldDocument) | 1456 void HTMLInputElement::didMoveToNewDocument(Document* oldDocument) |
1456 { | 1457 { |
1457 if (hasImageLoader()) | 1458 if (hasImageLoader()) |
1458 imageLoader()->elementDidMoveToNewDocument(); | 1459 imageLoader()->elementDidMoveToNewDocument(); |
1459 | 1460 |
1460 if (oldDocument) { | 1461 if (oldDocument) { |
1461 if (isRadioButton()) | 1462 if (isRadioButton()) |
1462 oldDocument->formController()->checkedRadioButtons().removeButton(th
is); | 1463 oldDocument->formController()->checkedRadioButtons().removeButton(Ha
ndle<HTMLInputElement>(this)); |
1463 if (m_hasTouchEventHandler) | 1464 if (m_hasTouchEventHandler) |
1464 oldDocument->didRemoveEventTargetNode(this); | 1465 oldDocument->didRemoveEventTargetNode(this); |
1465 } | 1466 } |
1466 | 1467 |
1467 if (m_hasTouchEventHandler) | 1468 if (m_hasTouchEventHandler) |
1468 document()->didAddTouchEventHandler(this); | 1469 document()->didAddTouchEventHandler(this); |
1469 | 1470 |
1470 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument); | 1471 HTMLTextFormControlElement::didMoveToNewDocument(oldDocument); |
1471 } | 1472 } |
1472 | 1473 |
1473 void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
t | 1474 void HTMLInputElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) cons
t |
1474 { | 1475 { |
1475 HTMLTextFormControlElement::addSubresourceAttributeURLs(urls); | 1476 HTMLTextFormControlElement::addSubresourceAttributeURLs(urls); |
1476 | 1477 |
1477 addSubresourceURL(urls, src()); | 1478 addSubresourceURL(urls, src()); |
1478 } | 1479 } |
1479 | 1480 |
1480 bool HTMLInputElement::recalcWillValidate() const | 1481 bool HTMLInputElement::recalcWillValidate() const |
1481 { | 1482 { |
1482 return m_inputType->supportsValidation() && HTMLTextFormControlElement::reca
lcWillValidate(); | 1483 return m_inputType->supportsValidation() && HTMLTextFormControlElement::reca
lcWillValidate(); |
1483 } | 1484 } |
1484 | 1485 |
1485 void HTMLInputElement::requiredAttributeChanged() | 1486 void HTMLInputElement::requiredAttributeChanged() |
1486 { | 1487 { |
1487 HTMLTextFormControlElement::requiredAttributeChanged(); | 1488 HTMLTextFormControlElement::requiredAttributeChanged(); |
1488 if (CheckedRadioButtons* buttons = checkedRadioButtons()) | 1489 if (CheckedRadioButtons* buttons = checkedRadioButtons()) |
1489 buttons->requiredAttributeChanged(this); | 1490 buttons->requiredAttributeChanged(Handle<HTMLInputElement>(this)); |
1490 m_inputType->requiredAttributeChanged(); | 1491 m_inputType->requiredAttributeChanged(); |
1491 } | 1492 } |
1492 | 1493 |
1493 #if ENABLE(INPUT_TYPE_COLOR) | 1494 #if ENABLE(INPUT_TYPE_COLOR) |
1494 void HTMLInputElement::selectColorInColorChooser(const Color& color) | 1495 void HTMLInputElement::selectColorInColorChooser(const Color& color) |
1495 { | 1496 { |
1496 if (!m_inputType->isColorControl()) | 1497 if (!m_inputType->isColorControl()) |
1497 return; | 1498 return; |
1498 static_cast<ColorInputType*>(m_inputType.get())->didChooseColor(color); | 1499 static_cast<ColorInputType*>(m_inputType.get())->didChooseColor(color); |
1499 } | 1500 } |
(...skipping 18 matching lines...) Expand all Loading... |
1518 return 0; | 1519 return 0; |
1519 if (!element->hasTagName(datalistTag)) | 1520 if (!element->hasTagName(datalistTag)) |
1520 return 0; | 1521 return 0; |
1521 | 1522 |
1522 return static_cast<HTMLDataListElement*>(element); | 1523 return static_cast<HTMLDataListElement*>(element); |
1523 } | 1524 } |
1524 | 1525 |
1525 void HTMLInputElement::resetListAttributeTargetObserver() | 1526 void HTMLInputElement::resetListAttributeTargetObserver() |
1526 { | 1527 { |
1527 if (inDocument()) | 1528 if (inDocument()) |
1528 m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fast
GetAttribute(listAttr), this); | 1529 m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fast
GetAttribute(listAttr), Handle<HTMLInputElement>(this)); |
1529 else | 1530 else |
1530 m_listAttributeTargetObserver = nullptr; | 1531 m_listAttributeTargetObserver = nullptr; |
1531 } | 1532 } |
1532 | 1533 |
1533 void HTMLInputElement::listAttributeTargetChanged() | 1534 void HTMLInputElement::listAttributeTargetChanged() |
1534 { | 1535 { |
1535 m_inputType->listAttributeTargetChanged(); | 1536 m_inputType->listAttributeTargetChanged(); |
1536 } | 1537 } |
1537 #endif // ENABLE(DATALIST_ELEMENT) | 1538 #endif // ENABLE(DATALIST_ELEMENT) |
1538 | 1539 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 { | 1742 { |
1742 setAttribute(captureAttr, value); | 1743 setAttribute(captureAttr, value); |
1743 } | 1744 } |
1744 | 1745 |
1745 #endif | 1746 #endif |
1746 | 1747 |
1747 bool HTMLInputElement::isInRequiredRadioButtonGroup() | 1748 bool HTMLInputElement::isInRequiredRadioButtonGroup() |
1748 { | 1749 { |
1749 ASSERT(isRadioButton()); | 1750 ASSERT(isRadioButton()); |
1750 if (CheckedRadioButtons* buttons = checkedRadioButtons()) | 1751 if (CheckedRadioButtons* buttons = checkedRadioButtons()) |
1751 return buttons->isInRequiredGroup(this); | 1752 return buttons->isInRequiredGroup(Handle<HTMLInputElement>(this)); |
1752 return false; | 1753 return false; |
1753 } | 1754 } |
1754 | 1755 |
1755 HTMLInputElement* HTMLInputElement::checkedRadioButtonForGroup() const | 1756 Result<HTMLInputElement> HTMLInputElement::checkedRadioButtonForGroup() const |
1756 { | 1757 { |
1757 if (CheckedRadioButtons* buttons = checkedRadioButtons()) | 1758 if (CheckedRadioButtons* buttons = checkedRadioButtons()) |
1758 return buttons->checkedButtonForGroup(name()); | 1759 return buttons->checkedButtonForGroup(name()); |
1759 return 0; | 1760 return nullptr; |
1760 } | 1761 } |
1761 | 1762 |
1762 CheckedRadioButtons* HTMLInputElement::checkedRadioButtons() const | 1763 CheckedRadioButtons* HTMLInputElement::checkedRadioButtons() const |
1763 { | 1764 { |
1764 if (!isRadioButton()) | 1765 if (!isRadioButton()) |
1765 return 0; | 1766 return 0; |
1766 if (HTMLFormElement* formElement = form()) | 1767 if (HTMLFormElement* formElement = form()) |
1767 return &formElement->checkedRadioButtons(); | 1768 return &formElement->checkedRadioButtons(); |
1768 if (inDocument()) | 1769 if (inDocument()) |
1769 return &document()->formController()->checkedRadioButtons(); | 1770 return &document()->formController()->checkedRadioButtons(); |
1770 return 0; | 1771 return 0; |
1771 } | 1772 } |
1772 | 1773 |
1773 inline void HTMLInputElement::addToRadioButtonGroup() | 1774 inline void HTMLInputElement::addToRadioButtonGroup() |
1774 { | 1775 { |
1775 if (CheckedRadioButtons* buttons = checkedRadioButtons()) | 1776 if (CheckedRadioButtons* buttons = checkedRadioButtons()) |
1776 buttons->addButton(this); | 1777 buttons->addButton(Handle<HTMLInputElement>(this)); |
1777 } | 1778 } |
1778 | 1779 |
1779 inline void HTMLInputElement::removeFromRadioButtonGroup() | 1780 inline void HTMLInputElement::removeFromRadioButtonGroup() |
1780 { | 1781 { |
1781 if (CheckedRadioButtons* buttons = checkedRadioButtons()) | 1782 if (CheckedRadioButtons* buttons = checkedRadioButtons()) |
1782 buttons->removeButton(this); | 1783 buttons->removeButton(Handle<HTMLInputElement>(this)); |
1783 } | 1784 } |
1784 | 1785 |
1785 unsigned HTMLInputElement::height() const | 1786 unsigned HTMLInputElement::height() const |
1786 { | 1787 { |
1787 return m_inputType->height(); | 1788 return m_inputType->height(); |
1788 } | 1789 } |
1789 | 1790 |
1790 unsigned HTMLInputElement::width() const | 1791 unsigned HTMLInputElement::width() const |
1791 { | 1792 { |
1792 return m_inputType->width(); | 1793 return m_inputType->width(); |
1793 } | 1794 } |
1794 | 1795 |
1795 void HTMLInputElement::setHeight(unsigned height) | 1796 void HTMLInputElement::setHeight(unsigned height) |
1796 { | 1797 { |
1797 setAttribute(heightAttr, String::number(height)); | 1798 setAttribute(heightAttr, String::number(height)); |
1798 } | 1799 } |
1799 | 1800 |
1800 void HTMLInputElement::setWidth(unsigned width) | 1801 void HTMLInputElement::setWidth(unsigned width) |
1801 { | 1802 { |
1802 setAttribute(widthAttr, String::number(width)); | 1803 setAttribute(widthAttr, String::number(width)); |
1803 } | 1804 } |
1804 | 1805 |
1805 #if ENABLE(DATALIST_ELEMENT) | 1806 #if ENABLE(DATALIST_ELEMENT) |
1806 PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(cons
t AtomicString& id, HTMLInputElement* element) | 1807 PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(cons
t AtomicString& id, Handle<HTMLInputElement> element) |
1807 { | 1808 { |
1808 return adoptPtr(new ListAttributeTargetObserver(id, element)); | 1809 return adoptPtr(new ListAttributeTargetObserver(id, element)); |
1809 } | 1810 } |
1810 | 1811 |
1811 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id,
HTMLInputElement* element) | 1812 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id,
Handle<HTMLInputElement> element) |
1812 : IdTargetObserver(element->treeScope()->idTargetObserverRegistry(), id) | 1813 : IdTargetObserver(element->treeScope()->idTargetObserverRegistry(), id) |
1813 , m_element(element) | 1814 , m_element(element.raw()) |
1814 { | 1815 { |
1815 } | 1816 } |
1816 | 1817 |
1817 void ListAttributeTargetObserver::idTargetChanged() | 1818 void ListAttributeTargetObserver::idTargetChanged() |
1818 { | 1819 { |
1819 m_element->listAttributeTargetChanged(); | 1820 m_element->listAttributeTargetChanged(); |
1820 } | 1821 } |
1821 #endif | 1822 #endif |
1822 | 1823 |
1823 void HTMLInputElement::setRangeText(const String& replacement, ExceptionCode& ec
) | 1824 void HTMLInputElement::setRangeText(const String& replacement, ExceptionCode& ec
) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 #endif | 1897 #endif |
1897 } | 1898 } |
1898 | 1899 |
1899 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1900 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
1900 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1901 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
1901 { | 1902 { |
1902 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); | 1903 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); |
1903 } | 1904 } |
1904 #endif | 1905 #endif |
1905 | 1906 |
| 1907 void HTMLInputElement::acceptHeapVisitor(Visitor* visitor) const |
| 1908 { |
| 1909 HTMLTextFormControlElement::acceptHeapVisitor(visitor); |
| 1910 } |
| 1911 |
1906 } // namespace | 1912 } // namespace |
OLD | NEW |