| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 // Element must not have a renderer here, because if it did | 324 // Element must not have a renderer here, because if it did |
| 325 // DateTimeEditElement::customStyleForRenderer() is called in appendChild() | 325 // DateTimeEditElement::customStyleForRenderer() is called in appendChild() |
| 326 // before the field wrapper element is created. | 326 // before the field wrapper element is created. |
| 327 // FIXME: This code should not depend on such craziness. | 327 // FIXME: This code should not depend on such craziness. |
| 328 ASSERT(!element()->renderer()); | 328 ASSERT(!element()->renderer()); |
| 329 | 329 |
| 330 Document* document = element()->document(); | 330 Document* document = element()->document(); |
| 331 ContainerNode* container = element()->userAgentShadowRoot(); | 331 ContainerNode* container = element()->userAgentShadowRoot(); |
| 332 | 332 |
| 333 container->appendChild(DateTimeEditElement::create(document, *this)); | 333 container->appendChild(DateTimeEditElement::create(document, *this), ASSERT_
NO_EXCEPTION, DeprecatedAttachNow); |
| 334 updateInnerTextValue(); | 334 updateInnerTextValue(); |
| 335 container->appendChild(ClearButtonElement::create(document, *this)); | 335 container->appendChild(ClearButtonElement::create(document, *this), ASSERT_N
O_EXCEPTION, DeprecatedAttachNow); |
| 336 container->appendChild(SpinButtonElement::create(document, *this)); | 336 container->appendChild(SpinButtonElement::create(document, *this), ASSERT_NO
_EXCEPTION, DeprecatedAttachNow); |
| 337 | 337 |
| 338 bool shouldAddPickerIndicator = false; | 338 bool shouldAddPickerIndicator = false; |
| 339 if (InputType::themeSupportsDataListUI(this)) | 339 if (InputType::themeSupportsDataListUI(this)) |
| 340 shouldAddPickerIndicator = true; | 340 shouldAddPickerIndicator = true; |
| 341 RefPtr<RenderTheme> theme = document->page() ? document->page()->theme() : R
enderTheme::defaultTheme(); | 341 RefPtr<RenderTheme> theme = document->page() ? document->page()->theme() : R
enderTheme::defaultTheme(); |
| 342 if (theme->supportsCalendarPicker(formControlType())) { | 342 if (theme->supportsCalendarPicker(formControlType())) { |
| 343 shouldAddPickerIndicator = true; | 343 shouldAddPickerIndicator = true; |
| 344 m_pickerIndicatorIsAlwaysVisible = true; | 344 m_pickerIndicatorIsAlwaysVisible = true; |
| 345 } | 345 } |
| 346 if (shouldAddPickerIndicator) { | 346 if (shouldAddPickerIndicator) { |
| 347 container->appendChild(PickerIndicatorElement::create(document, *this)); | 347 container->appendChild(PickerIndicatorElement::create(document, *this),
ASSERT_NO_EXCEPTION, DeprecatedAttachNow); |
| 348 m_pickerIndicatorIsVisible = true; | 348 m_pickerIndicatorIsVisible = true; |
| 349 updatePickerIndicatorVisibility(); | 349 updatePickerIndicatorVisibility(); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 | 352 |
| 353 void BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree() | 353 void BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree() |
| 354 { | 354 { |
| 355 ASSERT(!m_isDestroyingShadowSubtree); | 355 ASSERT(!m_isDestroyingShadowSubtree); |
| 356 m_isDestroyingShadowSubtree = true; | 356 m_isDestroyingShadowSubtree = true; |
| 357 if (SpinButtonElement* element = spinButtonElement()) | 357 if (SpinButtonElement* element = spinButtonElement()) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 598 |
| 599 if (element()->isRequired() || !dateTimeEditElement()->anyEditableFieldsHave
Values()) | 599 if (element()->isRequired() || !dateTimeEditElement()->anyEditableFieldsHave
Values()) |
| 600 clearButton->setInlineStyleProperty(CSSPropertyVisibility, CSSValueHidde
n); | 600 clearButton->setInlineStyleProperty(CSSPropertyVisibility, CSSValueHidde
n); |
| 601 else | 601 else |
| 602 clearButton->removeInlineStyleProperty(CSSPropertyVisibility); | 602 clearButton->removeInlineStyleProperty(CSSPropertyVisibility); |
| 603 } | 603 } |
| 604 | 604 |
| 605 } // namespace WebCore | 605 } // namespace WebCore |
| 606 | 606 |
| 607 #endif | 607 #endif |
| OLD | NEW |