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

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

Issue 2534873004: Avoid unchecked casts in UA shadow DOM. (Closed)
Patch Set: Created 4 years 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
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 DateTimeEditElement::~DateTimeEditElement() {} 517 DateTimeEditElement::~DateTimeEditElement() {}
518 518
519 DEFINE_TRACE(DateTimeEditElement) { 519 DEFINE_TRACE(DateTimeEditElement) {
520 visitor->trace(m_fields); 520 visitor->trace(m_fields);
521 visitor->trace(m_editControlOwner); 521 visitor->trace(m_editControlOwner);
522 HTMLDivElement::trace(visitor); 522 HTMLDivElement::trace(visitor);
523 } 523 }
524 524
525 inline Element* DateTimeEditElement::fieldsWrapperElement() const { 525 inline Element* DateTimeEditElement::fieldsWrapperElement() const {
526 DCHECK(firstChild()); 526 DCHECK(firstChild());
527 return toElement(firstChild()); 527 return toElementOrDie(firstChild());
528 } 528 }
529 529
530 void DateTimeEditElement::addField(DateTimeFieldElement* field) { 530 void DateTimeEditElement::addField(DateTimeFieldElement* field) {
531 if (m_fields.size() >= maximumNumberOfFields) 531 if (m_fields.size() >= maximumNumberOfFields)
532 return; 532 return;
533 m_fields.append(field); 533 m_fields.append(field);
534 fieldsWrapperElement()->appendChild(field); 534 fieldsWrapperElement()->appendChild(field);
535 } 535 }
536 536
537 bool DateTimeEditElement::anyEditableFieldsHaveValues() const { 537 bool DateTimeEditElement::anyEditableFieldsHaveValues() const {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 849 }
850 850
851 DateTimeFieldsState DateTimeEditElement::valueAsDateTimeFieldsState() const { 851 DateTimeFieldsState DateTimeEditElement::valueAsDateTimeFieldsState() const {
852 DateTimeFieldsState dateTimeFieldsState; 852 DateTimeFieldsState dateTimeFieldsState;
853 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex) 853 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex)
854 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState); 854 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState);
855 return dateTimeFieldsState; 855 return dateTimeFieldsState;
856 } 856 }
857 857
858 } // namespace blink 858 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698