| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "platform/PlatformMouseEvent.h" | 72 #include "platform/PlatformMouseEvent.h" |
| 73 #include "platform/RuntimeEnabledFeatures.h" | 73 #include "platform/RuntimeEnabledFeatures.h" |
| 74 #include "platform/text/PlatformLocale.h" | 74 #include "platform/text/PlatformLocale.h" |
| 75 #include "wtf/MathExtras.h" | 75 #include "wtf/MathExtras.h" |
| 76 | 76 |
| 77 namespace blink { | 77 namespace blink { |
| 78 | 78 |
| 79 using namespace HTMLNames; | 79 using namespace HTMLNames; |
| 80 | 80 |
| 81 class ListAttributeTargetObserver : public IdTargetObserver { | 81 class ListAttributeTargetObserver : public IdTargetObserver { |
| 82 USING_FAST_MALLOC_WILL_BE_REMOVED(ListAttributeTargetObserver); | |
| 83 public: | 82 public: |
| 84 static PassOwnPtrWillBeRawPtr<ListAttributeTargetObserver> create(const Atom
icString& id, HTMLInputElement*); | 83 static RawPtr<ListAttributeTargetObserver> create(const AtomicString& id, HT
MLInputElement*); |
| 85 DECLARE_VIRTUAL_TRACE(); | 84 DECLARE_VIRTUAL_TRACE(); |
| 86 void idTargetChanged() override; | 85 void idTargetChanged() override; |
| 87 | 86 |
| 88 private: | 87 private: |
| 89 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); | 88 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); |
| 90 | 89 |
| 91 RawPtrWillBeMember<HTMLInputElement> m_element; | 90 Member<HTMLInputElement> m_element; |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 // FIXME: According to HTML4, the length attribute's value can be arbitrarily | 93 // FIXME: According to HTML4, the length attribute's value can be arbitrarily |
| 95 // large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things | 94 // large. However, due to https://bugs.webkit.org/show_bug.cgi?id=14536 things |
| 96 // get rather sluggish when a text field has a larger number of characters than | 95 // get rather sluggish when a text field has a larger number of characters than |
| 97 // this, even when just clicking in the text field. | 96 // this, even when just clicking in the text field. |
| 98 const int HTMLInputElement::maximumLength = 524288; | 97 const int HTMLInputElement::maximumLength = 524288; |
| 99 const int defaultSize = 20; | 98 const int defaultSize = 20; |
| 100 const int maxSavedResults = 256; | 99 const int maxSavedResults = 256; |
| 101 | 100 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 122 // |m_inputType| is lazily created when constructed by the parser to avoid | 121 // |m_inputType| is lazily created when constructed by the parser to avoid |
| 123 // constructing unnecessarily a text inputType and its shadow subtree, just | 122 // constructing unnecessarily a text inputType and its shadow subtree, just |
| 124 // to destroy them when the |type| attribute gets set by the parser to | 123 // to destroy them when the |type| attribute gets set by the parser to |
| 125 // something else than 'text'. | 124 // something else than 'text'. |
| 126 , m_inputType(createdByParser ? nullptr : InputType::createText(*this)) | 125 , m_inputType(createdByParser ? nullptr : InputType::createText(*this)) |
| 127 , m_inputTypeView(m_inputType) | 126 , m_inputTypeView(m_inputType) |
| 128 { | 127 { |
| 129 setHasCustomStyleCallbacks(); | 128 setHasCustomStyleCallbacks(); |
| 130 } | 129 } |
| 131 | 130 |
| 132 PassRefPtrWillBeRawPtr<HTMLInputElement> HTMLInputElement::create(Document& docu
ment, HTMLFormElement* form, bool createdByParser) | 131 RawPtr<HTMLInputElement> HTMLInputElement::create(Document& document, HTMLFormEl
ement* form, bool createdByParser) |
| 133 { | 132 { |
| 134 RefPtrWillBeRawPtr<HTMLInputElement> inputElement = adoptRefWillBeNoop(new H
TMLInputElement(document, form, createdByParser)); | 133 RawPtr<HTMLInputElement> inputElement = (new HTMLInputElement(document, form
, createdByParser)); |
| 135 if (!createdByParser) | 134 if (!createdByParser) |
| 136 inputElement->ensureUserAgentShadowRoot(); | 135 inputElement->ensureUserAgentShadowRoot(); |
| 137 return inputElement.release(); | 136 return inputElement.release(); |
| 138 } | 137 } |
| 139 | 138 |
| 140 DEFINE_TRACE(HTMLInputElement) | 139 DEFINE_TRACE(HTMLInputElement) |
| 141 { | 140 { |
| 142 visitor->trace(m_inputType); | 141 visitor->trace(m_inputType); |
| 143 visitor->trace(m_inputTypeView); | 142 visitor->trace(m_inputTypeView); |
| 144 visitor->trace(m_listAttributeTargetObserver); | 143 visitor->trace(m_listAttributeTargetObserver); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 460 |
| 462 void HTMLInputElement::updateType() | 461 void HTMLInputElement::updateType() |
| 463 { | 462 { |
| 464 ASSERT(m_inputType); | 463 ASSERT(m_inputType); |
| 465 ASSERT(m_inputTypeView); | 464 ASSERT(m_inputTypeView); |
| 466 | 465 |
| 467 const AtomicString& newTypeName = InputType::normalizeTypeName(fastGetAttrib
ute(typeAttr)); | 466 const AtomicString& newTypeName = InputType::normalizeTypeName(fastGetAttrib
ute(typeAttr)); |
| 468 if (m_inputType->formControlType() == newTypeName) | 467 if (m_inputType->formControlType() == newTypeName) |
| 469 return; | 468 return; |
| 470 | 469 |
| 471 RefPtrWillBeRawPtr<InputType> newType = InputType::create(*this, newTypeName
); | 470 RawPtr<InputType> newType = InputType::create(*this, newTypeName); |
| 472 removeFromRadioButtonGroup(); | 471 removeFromRadioButtonGroup(); |
| 473 | 472 |
| 474 bool didStoreValue = m_inputType->storesValueSeparateFromAttribute(); | 473 bool didStoreValue = m_inputType->storesValueSeparateFromAttribute(); |
| 475 bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttr
ibutes(); | 474 bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttr
ibutes(); |
| 476 | 475 |
| 477 m_inputTypeView->destroyShadowSubtree(); | 476 m_inputTypeView->destroyShadowSubtree(); |
| 478 lazyReattachIfAttached(); | 477 lazyReattachIfAttached(); |
| 479 | 478 |
| 480 m_inputType = newType.release(); | 479 m_inputType = newType.release(); |
| 481 if (openShadowRoot()) | 480 if (openShadowRoot()) |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 { | 907 { |
| 909 m_inputType->readingChecked(); | 908 m_inputType->readingChecked(); |
| 910 return m_isChecked; | 909 return m_isChecked; |
| 911 } | 910 } |
| 912 | 911 |
| 913 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) | 912 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) |
| 914 { | 913 { |
| 915 if (checked() == nowChecked) | 914 if (checked() == nowChecked) |
| 916 return; | 915 return; |
| 917 | 916 |
| 918 RefPtrWillBeRawPtr<HTMLInputElement> protector(this); | 917 RawPtr<HTMLInputElement> protector(this); |
| 919 m_reflectsCheckedAttribute = false; | 918 m_reflectsCheckedAttribute = false; |
| 920 m_isChecked = nowChecked; | 919 m_isChecked = nowChecked; |
| 921 | 920 |
| 922 if (RadioButtonGroupScope* scope = radioButtonGroupScope()) | 921 if (RadioButtonGroupScope* scope = radioButtonGroupScope()) |
| 923 scope->updateCheckedState(this); | 922 scope->updateCheckedState(this); |
| 924 if (layoutObject()) | 923 if (layoutObject()) |
| 925 LayoutTheme::theme().controlStateChanged(*layoutObject(), CheckedControl
State); | 924 LayoutTheme::theme().controlStateChanged(*layoutObject(), CheckedControl
State); |
| 926 | 925 |
| 927 setNeedsValidityCheck(); | 926 setNeedsValidityCheck(); |
| 928 | 927 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 } | 1064 } |
| 1066 setValue(value, eventBehavior); | 1065 setValue(value, eventBehavior); |
| 1067 } | 1066 } |
| 1068 | 1067 |
| 1069 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
tBehavior) | 1068 void HTMLInputElement::setValue(const String& value, TextFieldEventBehavior even
tBehavior) |
| 1070 { | 1069 { |
| 1071 m_inputType->warnIfValueIsInvalidAndElementIsVisible(value); | 1070 m_inputType->warnIfValueIsInvalidAndElementIsVisible(value); |
| 1072 if (!m_inputType->canSetValue(value)) | 1071 if (!m_inputType->canSetValue(value)) |
| 1073 return; | 1072 return; |
| 1074 | 1073 |
| 1075 RefPtrWillBeRawPtr<HTMLInputElement> protector(this); | 1074 RawPtr<HTMLInputElement> protector(this); |
| 1076 EventQueueScope scope; | 1075 EventQueueScope scope; |
| 1077 String sanitizedValue = sanitizeValue(value); | 1076 String sanitizedValue = sanitizeValue(value); |
| 1078 bool valueChanged = sanitizedValue != this->value(); | 1077 bool valueChanged = sanitizedValue != this->value(); |
| 1079 | 1078 |
| 1080 setLastChangeWasNotUserEdit(); | 1079 setLastChangeWasNotUserEdit(); |
| 1081 m_needsToUpdateViewValue = true; | 1080 m_needsToUpdateViewValue = true; |
| 1082 m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from us
ing the suggested value. | 1081 m_suggestedValue = String(); // Prevent TextFieldInputType::setValue from us
ing the suggested value. |
| 1083 | 1082 |
| 1084 m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior); | 1083 m_inputType->setValue(sanitizedValue, valueChanged, eventBehavior); |
| 1085 | 1084 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 #if ENABLE(OILPAN) | 1173 #if ENABLE(OILPAN) |
| 1175 return m_inputTypeView->willDispatchClick(); | 1174 return m_inputTypeView->willDispatchClick(); |
| 1176 #else | 1175 #else |
| 1177 // FIXME: Check whether there are any cases where this actually ends up leak
ing. | 1176 // FIXME: Check whether there are any cases where this actually ends up leak
ing. |
| 1178 return m_inputTypeView->willDispatchClick().leakPtr(); | 1177 return m_inputTypeView->willDispatchClick().leakPtr(); |
| 1179 #endif | 1178 #endif |
| 1180 } | 1179 } |
| 1181 | 1180 |
| 1182 void HTMLInputElement::postDispatchEventHandler(Event* event, void* dataFromPreD
ispatch) | 1181 void HTMLInputElement::postDispatchEventHandler(Event* event, void* dataFromPreD
ispatch) |
| 1183 { | 1182 { |
| 1184 OwnPtrWillBeRawPtr<ClickHandlingState> state = adoptPtrWillBeNoop(static_cas
t<ClickHandlingState*>(dataFromPreDispatch)); | 1183 RawPtr<ClickHandlingState> state = (static_cast<ClickHandlingState*>(dataFro
mPreDispatch)); |
| 1185 if (!state) | 1184 if (!state) |
| 1186 return; | 1185 return; |
| 1187 // m_inputTypeView could be freed if the type attribute is modified through
a change event handler. | 1186 // m_inputTypeView could be freed if the type attribute is modified through
a change event handler. |
| 1188 RefPtrWillBeRawPtr<InputTypeView> protect(m_inputTypeView.get()); | 1187 RawPtr<InputTypeView> protect(m_inputTypeView.get()); |
| 1189 m_inputTypeView->didDispatchClick(event, *state); | 1188 m_inputTypeView->didDispatchClick(event, *state); |
| 1190 } | 1189 } |
| 1191 | 1190 |
| 1192 void HTMLInputElement::defaultEventHandler(Event* evt) | 1191 void HTMLInputElement::defaultEventHandler(Event* evt) |
| 1193 { | 1192 { |
| 1194 if (evt->isMouseEvent() && evt->type() == EventTypeNames::click && toMouseEv
ent(evt)->button() == LeftButton) { | 1193 if (evt->isMouseEvent() && evt->type() == EventTypeNames::click && toMouseEv
ent(evt)->button() == LeftButton) { |
| 1195 m_inputTypeView->handleClickEvent(toMouseEvent(evt)); | 1194 m_inputTypeView->handleClickEvent(toMouseEvent(evt)); |
| 1196 if (evt->defaultHandled()) | 1195 if (evt->defaultHandled()) |
| 1197 return; | 1196 return; |
| 1198 } | 1197 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 | 1237 |
| 1239 if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keyup) { | 1238 if (evt->isKeyboardEvent() && evt->type() == EventTypeNames::keyup) { |
| 1240 m_inputTypeView->handleKeyupEvent(toKeyboardEvent(evt)); | 1239 m_inputTypeView->handleKeyupEvent(toKeyboardEvent(evt)); |
| 1241 if (evt->defaultHandled()) | 1240 if (evt->defaultHandled()) |
| 1242 return; | 1241 return; |
| 1243 } | 1242 } |
| 1244 | 1243 |
| 1245 if (m_inputTypeView->shouldSubmitImplicitly(evt)) { | 1244 if (m_inputTypeView->shouldSubmitImplicitly(evt)) { |
| 1246 // FIXME: Remove type check. | 1245 // FIXME: Remove type check. |
| 1247 if (type() == InputTypeNames::search) | 1246 if (type() == InputTypeNames::search) |
| 1248 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLInput
Element::onSearch, PassRefPtrWillBeRawPtr<HTMLInputElement>(this))); | 1247 document().postTask(BLINK_FROM_HERE, createSameThreadTask(&HTMLInput
Element::onSearch, RawPtr<HTMLInputElement>(this))); |
| 1249 // Form submission finishes editing, just as loss of focus does. | 1248 // Form submission finishes editing, just as loss of focus does. |
| 1250 // If there was a change, send the event now. | 1249 // If there was a change, send the event now. |
| 1251 if (wasChangedSinceLastFormControlChangeEvent()) | 1250 if (wasChangedSinceLastFormControlChangeEvent()) |
| 1252 dispatchFormControlChangeEvent(); | 1251 dispatchFormControlChangeEvent(); |
| 1253 | 1252 |
| 1254 RefPtrWillBeRawPtr<HTMLFormElement> formForSubmission = m_inputTypeView-
>formForSubmission(); | 1253 RawPtr<HTMLFormElement> formForSubmission = m_inputTypeView->formForSubm
ission(); |
| 1255 // Form may never have been present, or may have been destroyed by code
responding to the change event. | 1254 // Form may never have been present, or may have been destroyed by code
responding to the change event. |
| 1256 if (formForSubmission) | 1255 if (formForSubmission) |
| 1257 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmissio
n()); | 1256 formForSubmission->submitImplicitly(evt, canTriggerImplicitSubmissio
n()); |
| 1258 | 1257 |
| 1259 evt->setDefaultHandled(); | 1258 evt->setDefaultHandled(); |
| 1260 return; | 1259 return; |
| 1261 } | 1260 } |
| 1262 | 1261 |
| 1263 if (evt->isBeforeTextInsertedEvent()) | 1262 if (evt->isBeforeTextInsertedEvent()) |
| 1264 m_inputTypeView->handleBeforeTextInsertedEvent(static_cast<BeforeTextIns
ertedEvent*>(evt)); | 1263 m_inputTypeView->handleBeforeTextInsertedEvent(static_cast<BeforeTextIns
ertedEvent*>(evt)); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 return nullptr; | 1595 return nullptr; |
| 1597 | 1596 |
| 1598 return toHTMLDataListElement(element); | 1597 return toHTMLDataListElement(element); |
| 1599 } | 1598 } |
| 1600 | 1599 |
| 1601 bool HTMLInputElement::hasValidDataListOptions() const | 1600 bool HTMLInputElement::hasValidDataListOptions() const |
| 1602 { | 1601 { |
| 1603 HTMLDataListElement* dataList = this->dataList(); | 1602 HTMLDataListElement* dataList = this->dataList(); |
| 1604 if (!dataList) | 1603 if (!dataList) |
| 1605 return false; | 1604 return false; |
| 1606 RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->option
s(); | 1605 RawPtr<HTMLDataListOptionsCollection> options = dataList->options(); |
| 1607 for (unsigned i = 0; HTMLOptionElement* option = options->item(i); ++i) { | 1606 for (unsigned i = 0; HTMLOptionElement* option = options->item(i); ++i) { |
| 1608 if (isValidValue(option->value())) | 1607 if (isValidValue(option->value())) |
| 1609 return true; | 1608 return true; |
| 1610 } | 1609 } |
| 1611 return false; | 1610 return false; |
| 1612 } | 1611 } |
| 1613 | 1612 |
| 1614 void HTMLInputElement::setListAttributeTargetObserver(PassOwnPtrWillBeRawPtr<Lis
tAttributeTargetObserver> newObserver) | 1613 void HTMLInputElement::setListAttributeTargetObserver(RawPtr<ListAttributeTarget
Observer> newObserver) |
| 1615 { | 1614 { |
| 1616 if (m_listAttributeTargetObserver) | 1615 if (m_listAttributeTargetObserver) |
| 1617 m_listAttributeTargetObserver->unregister(); | 1616 m_listAttributeTargetObserver->unregister(); |
| 1618 m_listAttributeTargetObserver = newObserver; | 1617 m_listAttributeTargetObserver = newObserver; |
| 1619 } | 1618 } |
| 1620 | 1619 |
| 1621 void HTMLInputElement::resetListAttributeTargetObserver() | 1620 void HTMLInputElement::resetListAttributeTargetObserver() |
| 1622 { | 1621 { |
| 1623 if (inDocument()) | 1622 if (inDocument()) |
| 1624 setListAttributeTargetObserver(ListAttributeTargetObserver::create(fastG
etAttribute(listAttr), this)); | 1623 setListAttributeTargetObserver(ListAttributeTargetObserver::create(fastG
etAttribute(listAttr), this)); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 void HTMLInputElement::setHeight(unsigned height) | 1783 void HTMLInputElement::setHeight(unsigned height) |
| 1785 { | 1784 { |
| 1786 setUnsignedIntegralAttribute(heightAttr, height); | 1785 setUnsignedIntegralAttribute(heightAttr, height); |
| 1787 } | 1786 } |
| 1788 | 1787 |
| 1789 void HTMLInputElement::setWidth(unsigned width) | 1788 void HTMLInputElement::setWidth(unsigned width) |
| 1790 { | 1789 { |
| 1791 setUnsignedIntegralAttribute(widthAttr, width); | 1790 setUnsignedIntegralAttribute(widthAttr, width); |
| 1792 } | 1791 } |
| 1793 | 1792 |
| 1794 PassOwnPtrWillBeRawPtr<ListAttributeTargetObserver> ListAttributeTargetObserver:
:create(const AtomicString& id, HTMLInputElement* element) | 1793 RawPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(const At
omicString& id, HTMLInputElement* element) |
| 1795 { | 1794 { |
| 1796 return adoptPtrWillBeNoop(new ListAttributeTargetObserver(id, element)); | 1795 return (new ListAttributeTargetObserver(id, element)); |
| 1797 } | 1796 } |
| 1798 | 1797 |
| 1799 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id,
HTMLInputElement* element) | 1798 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id,
HTMLInputElement* element) |
| 1800 : IdTargetObserver(element->treeScope().idTargetObserverRegistry(), id) | 1799 : IdTargetObserver(element->treeScope().idTargetObserverRegistry(), id) |
| 1801 , m_element(element) | 1800 , m_element(element) |
| 1802 { | 1801 { |
| 1803 } | 1802 } |
| 1804 | 1803 |
| 1805 DEFINE_TRACE(ListAttributeTargetObserver) | 1804 DEFINE_TRACE(ListAttributeTargetObserver) |
| 1806 { | 1805 { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 parameters.step = 1.0; | 1856 parameters.step = 1.0; |
| 1858 parameters.stepBase = 0; | 1857 parameters.stepBase = 0; |
| 1859 } | 1858 } |
| 1860 | 1859 |
| 1861 parameters.anchorRectInRootFrame = document().view()->contentsToRootFrame(pi
xelSnappedBoundingBox()); | 1860 parameters.anchorRectInRootFrame = document().view()->contentsToRootFrame(pi
xelSnappedBoundingBox()); |
| 1862 parameters.anchorRectInScreen = document().view()->contentsToScreen(pixelSna
ppedBoundingBox()); | 1861 parameters.anchorRectInScreen = document().view()->contentsToScreen(pixelSna
ppedBoundingBox()); |
| 1863 parameters.currentValue = value(); | 1862 parameters.currentValue = value(); |
| 1864 parameters.doubleValue = m_inputType->valueAsDouble(); | 1863 parameters.doubleValue = m_inputType->valueAsDouble(); |
| 1865 parameters.isAnchorElementRTL = m_inputType->computedTextDirection() == RTL; | 1864 parameters.isAnchorElementRTL = m_inputType->computedTextDirection() == RTL; |
| 1866 if (HTMLDataListElement* dataList = this->dataList()) { | 1865 if (HTMLDataListElement* dataList = this->dataList()) { |
| 1867 RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->op
tions(); | 1866 RawPtr<HTMLDataListOptionsCollection> options = dataList->options(); |
| 1868 for (unsigned i = 0; HTMLOptionElement* option = options->item(i); ++i)
{ | 1867 for (unsigned i = 0; HTMLOptionElement* option = options->item(i); ++i)
{ |
| 1869 if (!isValidValue(option->value())) | 1868 if (!isValidValue(option->value())) |
| 1870 continue; | 1869 continue; |
| 1871 DateTimeSuggestion suggestion; | 1870 DateTimeSuggestion suggestion; |
| 1872 suggestion.value = m_inputType->parseToNumber(option->value(), Decim
al::nan()).toDouble(); | 1871 suggestion.value = m_inputType->parseToNumber(option->value(), Decim
al::nan()).toDouble(); |
| 1873 if (std::isnan(suggestion.value)) | 1872 if (std::isnan(suggestion.value)) |
| 1874 continue; | 1873 continue; |
| 1875 suggestion.localizedValue = localizeValue(option->value()); | 1874 suggestion.localizedValue = localizeValue(option->value()); |
| 1876 suggestion.label = option->value() == option->label() ? String() : o
ption->label(); | 1875 suggestion.label = option->value() == option->label() ? String() : o
ption->label(); |
| 1877 parameters.suggestions.append(suggestion); | 1876 parameters.suggestions.append(suggestion); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 void HTMLInputElement::ensurePrimaryContent() | 1930 void HTMLInputElement::ensurePrimaryContent() |
| 1932 { | 1931 { |
| 1933 m_inputTypeView->ensurePrimaryContent(); | 1932 m_inputTypeView->ensurePrimaryContent(); |
| 1934 } | 1933 } |
| 1935 | 1934 |
| 1936 bool HTMLInputElement::hasFallbackContent() const | 1935 bool HTMLInputElement::hasFallbackContent() const |
| 1937 { | 1936 { |
| 1938 return m_inputTypeView->hasFallbackContent(); | 1937 return m_inputTypeView->hasFallbackContent(); |
| 1939 } | 1938 } |
| 1940 } // namespace blink | 1939 } // namespace blink |
| OLD | NEW |