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

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

Issue 1237143003: bdo (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 return m_parameters.minimum.type() != DateComponents::Invalid 395 return m_parameters.minimum.type() != DateComponents::Invalid
396 && m_parameters.maximum.type() != DateComponents::Invalid 396 && m_parameters.maximum.type() != DateComponents::Invalid
397 && m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear() 397 && m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear()
398 && m_parameters.minimum.fullYear() == m_dateValue.fullYear(); 398 && m_parameters.minimum.fullYear() == m_dateValue.fullYear();
399 } 399 }
400 400
401 void DateTimeEditBuilder::visitLiteral(const String& text) 401 void DateTimeEditBuilder::visitLiteral(const String& text)
402 { 402 {
403 DEFINE_STATIC_LOCAL(AtomicString, textPseudoId, ("-webkit-datetime-edit-text ", AtomicString::ConstructFromLiteral)); 403 DEFINE_STATIC_LOCAL(AtomicString, textPseudoId, ("-webkit-datetime-edit-text ", AtomicString::ConstructFromLiteral));
404 ASSERT(text.length()); 404 ASSERT(text.length());
405 RefPtrWillBeRawPtr<HTMLDivElement> element = HTMLDivElement::create(m_editEl ement.document()); 405 RefPtrWillBeRawPtr<HTMLSpanElement> element = HTMLSpanElement::create(m_edit Element.document());
406 element->setShadowPseudoId(textPseudoId); 406 element->setShadowPseudoId(textPseudoId);
407 if (m_parameters.locale.isRTL() && text.length()) { 407 if (m_parameters.locale.isRTL() && text.length()) {
408 Direction dir = direction(text[0]); 408 Direction dir = direction(text[0]);
409 if (dir == SegmentSeparator || dir == WhiteSpaceNeutral || dir == OtherN eutral) 409 if (dir == SegmentSeparator || dir == WhiteSpaceNeutral || dir == OtherN eutral)
410 element->appendChild(Text::create(m_editElement.document(), String(& rightToLeftMarkCharacter, 1))); 410 element->appendChild(Text::create(m_editElement.document(), String(& rightToLeftMarkCharacter, 1)));
411 } 411 }
412 element->appendChild(Text::create(m_editElement.document(), text)); 412 element->appendChild(Text::create(m_editElement.document(), text));
413 m_editElement.fieldsWrapperElement()->appendChild(element); 413 m_editElement.fieldsWrapperElement()->appendChild(element);
414 } 414 }
415 415
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 { 807 {
808 DateTimeFieldsState dateTimeFieldsState; 808 DateTimeFieldsState dateTimeFieldsState;
809 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex) 809 for (size_t fieldIndex = 0; fieldIndex < m_fields.size(); ++fieldIndex)
810 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState); 810 m_fields[fieldIndex]->populateDateTimeFieldsState(dateTimeFieldsState);
811 return dateTimeFieldsState; 811 return dateTimeFieldsState;
812 } 812 }
813 813
814 } // namespace blink 814 } // namespace blink
815 815
816 #endif 816 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698