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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 Document& document, | 551 Document& document, |
552 EditControlOwner& editControlOwner) { | 552 EditControlOwner& editControlOwner) { |
553 DateTimeEditElement* container = | 553 DateTimeEditElement* container = |
554 new DateTimeEditElement(document, editControlOwner); | 554 new DateTimeEditElement(document, editControlOwner); |
555 container->setShadowPseudoId(AtomicString("-webkit-datetime-edit")); | 555 container->setShadowPseudoId(AtomicString("-webkit-datetime-edit")); |
556 container->setAttribute(idAttr, ShadowElementNames::dateTimeEdit()); | 556 container->setAttribute(idAttr, ShadowElementNames::dateTimeEdit()); |
557 return container; | 557 return container; |
558 } | 558 } |
559 | 559 |
560 PassRefPtr<ComputedStyle> DateTimeEditElement::customStyleForLayoutObject() { | 560 PassRefPtr<ComputedStyle> DateTimeEditElement::customStyleForLayoutObject() { |
561 // FIXME: This is a kind of layout. We might want to introduce new layoutObjec
t. | 561 // FIXME: This is a kind of layout. We might want to introduce new |
| 562 // layoutObject. |
562 RefPtr<ComputedStyle> originalStyle = originalStyleForLayoutObject(); | 563 RefPtr<ComputedStyle> originalStyle = originalStyleForLayoutObject(); |
563 RefPtr<ComputedStyle> style = ComputedStyle::clone(*originalStyle); | 564 RefPtr<ComputedStyle> style = ComputedStyle::clone(*originalStyle); |
564 float width = 0; | 565 float width = 0; |
565 for (Node* child = fieldsWrapperElement()->firstChild(); child; | 566 for (Node* child = fieldsWrapperElement()->firstChild(); child; |
566 child = child->nextSibling()) { | 567 child = child->nextSibling()) { |
567 if (!child->isElementNode()) | 568 if (!child->isElementNode()) |
568 continue; | 569 continue; |
569 Element* childElement = toElement(child); | 570 Element* childElement = toElement(child); |
570 if (childElement->isDateTimeFieldElement()) { | 571 if (childElement->isDateTimeFieldElement()) { |
571 // We need to pass the ComputedStyle of this element because child | 572 // We need to pass the ComputedStyle of this element because child |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 } | 849 } |
849 | 850 |
850 DateTimeFieldsState DateTimeEditElement::valueAsDateTimeFieldsState() const { | 851 DateTimeFieldsState DateTimeEditElement::valueAsDateTimeFieldsState() const { |
851 DateTimeFieldsState dateTimeFieldsState; | 852 DateTimeFieldsState dateTimeFieldsState; |
852 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex) | 853 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex) |
853 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState); | 854 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState); |
854 return dateTimeFieldsState; | 855 return dateTimeFieldsState; |
855 } | 856 } |
856 | 857 |
857 } // namespace blink | 858 } // namespace blink |
OLD | NEW |