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

Side by Side Diff: Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp

Issue 11420032: Merge 134239 - Refactoring: set read-only values on layout in DateTimeEditElement (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month 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/WebCore/html/shadow/DateTimeSymbolicFieldElement.h ('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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 int DateTimeSymbolicFieldElement::maximum() const 98 int DateTimeSymbolicFieldElement::maximum() const
99 { 99 {
100 return static_cast<int>(m_symbols.size()); 100 return static_cast<int>(m_symbols.size());
101 } 101 }
102 102
103 int DateTimeSymbolicFieldElement::minimum() const 103 int DateTimeSymbolicFieldElement::minimum() const
104 { 104 {
105 return 1; 105 return 1;
106 } 106 }
107 107
108 void DateTimeSymbolicFieldElement::setEmptyValue(const DateComponents&, EventBeh avior eventBehavior) 108 void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior)
109 { 109 {
110 m_selectedIndex = invalidIndex; 110 m_selectedIndex = invalidIndex;
111 updateVisibleValue(eventBehavior); 111 updateVisibleValue(eventBehavior);
112 } 112 }
113 113
114 void DateTimeSymbolicFieldElement::setValueAsInteger(int newSelectedIndex, Event Behavior eventBehavior) 114 void DateTimeSymbolicFieldElement::setValueAsInteger(int newSelectedIndex, Event Behavior eventBehavior)
115 { 115 {
116 m_selectedIndex = std::max(0, std::min(newSelectedIndex, static_cast<int>(m_ symbols.size() - 1))); 116 m_selectedIndex = std::max(0, std::min(newSelectedIndex, static_cast<int>(m_ symbols.size() - 1)));
117 updateVisibleValue(eventBehavior); 117 updateVisibleValue(eventBehavior);
118 } 118 }
(...skipping 27 matching lines...) Expand all
146 } 146 }
147 147
148 String DateTimeSymbolicFieldElement::visibleValue() const 148 String DateTimeSymbolicFieldElement::visibleValue() const
149 { 149 {
150 return hasValue() ? m_symbols[m_selectedIndex] : visibleEmptyValue(); 150 return hasValue() ? m_symbols[m_selectedIndex] : visibleEmptyValue();
151 } 151 }
152 152
153 } // namespace WebCore 153 } // namespace WebCore
154 154
155 #endif 155 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698