Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: Source/core/html/shadow/DateTimeEditElement.cpp

Issue 428533006: Use ContainerNode::hasChildren() instead of firstChild() in conditionals (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 655 }
656 656
657 bool DateTimeEditElement::isReadOnly() const 657 bool DateTimeEditElement::isReadOnly() const
658 { 658 {
659 return m_editControlOwner && m_editControlOwner->isEditControlOwnerReadOnly( ); 659 return m_editControlOwner && m_editControlOwner->isEditControlOwnerReadOnly( );
660 } 660 }
661 661
662 void DateTimeEditElement::layout(const LayoutParameters& layoutParameters, const DateComponents& dateValue) 662 void DateTimeEditElement::layout(const LayoutParameters& layoutParameters, const DateComponents& dateValue)
663 { 663 {
664 DEFINE_STATIC_LOCAL(AtomicString, fieldsWrapperPseudoId, ("-webkit-datetime- edit-fields-wrapper", AtomicString::ConstructFromLiteral)); 664 DEFINE_STATIC_LOCAL(AtomicString, fieldsWrapperPseudoId, ("-webkit-datetime- edit-fields-wrapper", AtomicString::ConstructFromLiteral));
665 if (!firstChild()) { 665 if (!hasChildren()) {
666 RefPtrWillBeRawPtr<HTMLDivElement> element = HTMLDivElement::create(docu ment()); 666 RefPtrWillBeRawPtr<HTMLDivElement> element = HTMLDivElement::create(docu ment());
667 element->setShadowPseudoId(fieldsWrapperPseudoId); 667 element->setShadowPseudoId(fieldsWrapperPseudoId);
668 appendChild(element.get()); 668 appendChild(element.get());
669 } 669 }
670 Element* fieldsWrapper = fieldsWrapperElement(); 670 Element* fieldsWrapper = fieldsWrapperElement();
671 671
672 size_t focusedFieldIndex = this->focusedFieldIndex(); 672 size_t focusedFieldIndex = this->focusedFieldIndex();
673 DateTimeFieldElement* const focusedField = fieldAt(focusedFieldIndex); 673 DateTimeFieldElement* const focusedField = fieldAt(focusedFieldIndex);
674 const AtomicString focusedFieldId = focusedField ? focusedField->shadowPseud oId() : nullAtom; 674 const AtomicString focusedFieldId = focusedField ? focusedField->shadowPseud oId() : nullAtom;
675 675
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 { 808 {
809 DateTimeFieldsState dateTimeFieldsState; 809 DateTimeFieldsState dateTimeFieldsState;
810 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex) 810 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex)
811 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState); 811 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState);
812 return dateTimeFieldsState; 812 return dateTimeFieldsState;
813 } 813 }
814 814
815 } // namespace blink 815 } // namespace blink
816 816
817 #endif 817 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElement.cpp ('k') | Source/core/inspector/DOMPatchSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698