| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 LayoutParameters(Locale& locale, const StepRange& stepRange) | 75 LayoutParameters(Locale& locale, const StepRange& stepRange) |
| 76 : locale(locale) | 76 : locale(locale) |
| 77 , stepRange(stepRange) | 77 , stepRange(stepRange) |
| 78 { | 78 { |
| 79 } | 79 } |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 static PassRefPtrWillBeRawPtr<DateTimeEditElement> create(Document&, EditCon
trolOwner&); | 82 static PassRefPtrWillBeRawPtr<DateTimeEditElement> create(Document&, EditCon
trolOwner&); |
| 83 | 83 |
| 84 virtual ~DateTimeEditElement(); | 84 ~DateTimeEditElement() override; |
| 85 DECLARE_VIRTUAL_TRACE(); | 85 DECLARE_VIRTUAL_TRACE(); |
| 86 | 86 |
| 87 void addField(PassRefPtrWillBeRawPtr<DateTimeFieldElement>); | 87 void addField(PassRefPtrWillBeRawPtr<DateTimeFieldElement>); |
| 88 bool anyEditableFieldsHaveValues() const; | 88 bool anyEditableFieldsHaveValues() const; |
| 89 void blurByOwner(); | 89 void blurByOwner(); |
| 90 virtual void defaultEventHandler(Event*) override; | 90 void defaultEventHandler(Event*) override; |
| 91 void disabledStateChanged(); | 91 void disabledStateChanged(); |
| 92 Element* fieldsWrapperElement() const; | 92 Element* fieldsWrapperElement() const; |
| 93 void focusIfNoFocus(); | 93 void focusIfNoFocus(); |
| 94 // If oldFocusedNode is one of sub-fields, focus on it. Otherwise focus on | 94 // If oldFocusedNode is one of sub-fields, focus on it. Otherwise focus on |
| 95 // the first sub-field. | 95 // the first sub-field. |
| 96 void focusByOwner(Element* oldFocusedElement = 0); | 96 void focusByOwner(Element* oldFocusedElement = 0); |
| 97 bool hasFocusedField(); | 97 bool hasFocusedField(); |
| 98 void readOnlyStateChanged(); | 98 void readOnlyStateChanged(); |
| 99 void removeEditControlOwner() { m_editControlOwner = nullptr; } | 99 void removeEditControlOwner() { m_editControlOwner = nullptr; } |
| 100 void resetFields(); | 100 void resetFields(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 127 size_t fieldIndexOf(const DateTimeFieldElement&) const; | 127 size_t fieldIndexOf(const DateTimeFieldElement&) const; |
| 128 DateTimeFieldElement* focusedField() const; | 128 DateTimeFieldElement* focusedField() const; |
| 129 size_t focusedFieldIndex() const; | 129 size_t focusedFieldIndex() const; |
| 130 bool focusOnNextFocusableField(size_t startIndex); | 130 bool focusOnNextFocusableField(size_t startIndex); |
| 131 bool isDisabled() const; | 131 bool isDisabled() const; |
| 132 bool isReadOnly() const; | 132 bool isReadOnly() const; |
| 133 void layout(const LayoutParameters&, const DateComponents&); | 133 void layout(const LayoutParameters&, const DateComponents&); |
| 134 void updateUIState(); | 134 void updateUIState(); |
| 135 | 135 |
| 136 // Element function. | 136 // Element function. |
| 137 virtual PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; | 137 PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; |
| 138 virtual bool isDateTimeEditElement() const override; | 138 bool isDateTimeEditElement() const override; |
| 139 | 139 |
| 140 // DateTimeFieldElement::FieldOwner functions. | 140 // DateTimeFieldElement::FieldOwner functions. |
| 141 virtual void didBlurFromField() override; | 141 void didBlurFromField() override; |
| 142 virtual void didFocusOnField() override; | 142 void didFocusOnField() override; |
| 143 virtual void fieldValueChanged() override; | 143 void fieldValueChanged() override; |
| 144 virtual bool focusOnNextField(const DateTimeFieldElement&) override; | 144 bool focusOnNextField(const DateTimeFieldElement&) override; |
| 145 virtual bool focusOnPreviousField(const DateTimeFieldElement&) override; | 145 bool focusOnPreviousField(const DateTimeFieldElement&) override; |
| 146 virtual bool isFieldOwnerDisabled() const override; | 146 bool isFieldOwnerDisabled() const override; |
| 147 virtual bool isFieldOwnerReadOnly() const override; | 147 bool isFieldOwnerReadOnly() const override; |
| 148 virtual AtomicString localeIdentifier() const override; | 148 AtomicString localeIdentifier() const override; |
| 149 virtual void fieldDidChangeValueByKeyboard() override; | 149 void fieldDidChangeValueByKeyboard() override; |
| 150 | 150 |
| 151 WillBeHeapVector<RawPtrWillBeMember<DateTimeFieldElement>, maximumNumberOfFi
elds> m_fields; | 151 WillBeHeapVector<RawPtrWillBeMember<DateTimeFieldElement>, maximumNumberOfFi
elds> m_fields; |
| 152 RawPtrWillBeMember<EditControlOwner> m_editControlOwner; | 152 RawPtrWillBeMember<EditControlOwner> m_editControlOwner; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 DEFINE_TYPE_CASTS(DateTimeEditElement, Element, element, element->isDateTimeEdit
Element(), element.isDateTimeEditElement()); | 155 DEFINE_TYPE_CASTS(DateTimeEditElement, Element, element, element->isDateTimeEdit
Element(), element.isDateTimeEditElement()); |
| 156 | 156 |
| 157 } // namespace blink | 157 } // namespace blink |
| 158 | 158 |
| 159 #endif | 159 #endif |
| 160 #endif | 160 #endif |
| OLD | NEW |