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

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

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void DateTimeFieldElement::focusOnNextField() 152 void DateTimeFieldElement::focusOnNextField()
153 { 153 {
154 if (!m_fieldOwner) 154 if (!m_fieldOwner)
155 return; 155 return;
156 m_fieldOwner->focusOnNextField(*this); 156 m_fieldOwner->focusOnNextField(*this);
157 } 157 }
158 158
159 void DateTimeFieldElement::initialize(const AtomicString& pseudo, const String& axHelpText, int axMinimum, int axMaximum) 159 void DateTimeFieldElement::initialize(const AtomicString& pseudo, const String& axHelpText, int axMinimum, int axMaximum)
160 { 160 {
161 // On accessibility, DateTimeFieldElement acts like spin button. 161 // On accessibility, DateTimeFieldElement acts like spin button.
162 setAttribute(roleAttr, AtomicString("spinbutton", AtomicString::ConstructFro mLiteral)); 162 setAttribute(roleAttr, AtomicString("spinbutton"));
163 setAttribute(aria_valuetextAttr, AtomicString(emptyValueAXText())); 163 setAttribute(aria_valuetextAttr, AtomicString(emptyValueAXText()));
164 setAttribute(aria_valueminAttr, AtomicString::number(axMinimum)); 164 setAttribute(aria_valueminAttr, AtomicString::number(axMinimum));
165 setAttribute(aria_valuemaxAttr, AtomicString::number(axMaximum)); 165 setAttribute(aria_valuemaxAttr, AtomicString::number(axMaximum));
166 166
167 setAttribute(aria_helpAttr, AtomicString(axHelpText)); 167 setAttribute(aria_helpAttr, AtomicString(axHelpText));
168 setShadowPseudoId(pseudo); 168 setShadowPseudoId(pseudo);
169 appendChild(Text::create(document(), visibleValue())); 169 appendChild(Text::create(document(), visibleValue()));
170 } 170 }
171 171
172 bool DateTimeFieldElement::isDateTimeFieldElement() const 172 bool DateTimeFieldElement::isDateTimeFieldElement() const
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 241
242 int DateTimeFieldElement::valueForARIAValueNow() const 242 int DateTimeFieldElement::valueForARIAValueNow() const
243 { 243 {
244 return valueAsInteger(); 244 return valueAsInteger();
245 } 245 }
246 246
247 } // namespace blink 247 } // namespace blink
248 248
249 #endif 249 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698