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

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

Issue 11503003: Merge 136803 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 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
« no previous file with comments | « Source/WebCore/css/html.css ('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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(EventBehavior eventBehavior) 108 void DateTimeSymbolicFieldElement::setEmptyValue(EventBehavior eventBehavior)
109 { 109 {
110 if (isReadOnly())
111 return;
110 m_selectedIndex = invalidIndex; 112 m_selectedIndex = invalidIndex;
111 updateVisibleValue(eventBehavior); 113 updateVisibleValue(eventBehavior);
112 } 114 }
113 115
114 void DateTimeSymbolicFieldElement::setValueAsInteger(int newSelectedIndex, Event Behavior eventBehavior) 116 void DateTimeSymbolicFieldElement::setValueAsInteger(int newSelectedIndex, Event Behavior eventBehavior)
115 { 117 {
116 m_selectedIndex = std::max(0, std::min(newSelectedIndex, static_cast<int>(m_ symbols.size() - 1))); 118 m_selectedIndex = std::max(0, std::min(newSelectedIndex, static_cast<int>(m_ symbols.size() - 1)));
117 updateVisibleValue(eventBehavior); 119 updateVisibleValue(eventBehavior);
118 } 120 }
119 121
(...skipping 26 matching lines...) Expand all
146 } 148 }
147 149
148 String DateTimeSymbolicFieldElement::visibleValue() const 150 String DateTimeSymbolicFieldElement::visibleValue() const
149 { 151 {
150 return hasValue() ? m_symbols[m_selectedIndex] : visibleEmptyValue(); 152 return hasValue() ? m_symbols[m_selectedIndex] : visibleEmptyValue();
151 } 153 }
152 154
153 } // namespace WebCore 155 } // namespace WebCore
154 156
155 #endif 157 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/css/html.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698