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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/ColorInputType.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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 ASSERT_UNUSED(success, success); 127 ASSERT_UNUSED(success, success);
128 return color; 128 return color;
129 } 129 }
130 130
131 void ColorInputType::createShadowSubtree() 131 void ColorInputType::createShadowSubtree()
132 { 132 {
133 ASSERT(element().shadow()); 133 ASSERT(element().shadow());
134 134
135 Document& document = element().document(); 135 Document& document = element().document();
136 RefPtrWillBeRawPtr<HTMLDivElement> wrapperElement = HTMLDivElement::create(d ocument); 136 RefPtrWillBeRawPtr<HTMLDivElement> wrapperElement = HTMLDivElement::create(d ocument);
137 wrapperElement->setShadowPseudoId(AtomicString("-webkit-color-swatch-wrapper ", AtomicString::ConstructFromLiteral)); 137 wrapperElement->setShadowPseudoId(AtomicString("-webkit-color-swatch-wrapper "));
138 RefPtrWillBeRawPtr<HTMLDivElement> colorSwatch = HTMLDivElement::create(docu ment); 138 RefPtrWillBeRawPtr<HTMLDivElement> colorSwatch = HTMLDivElement::create(docu ment);
139 colorSwatch->setShadowPseudoId(AtomicString("-webkit-color-swatch", AtomicSt ring::ConstructFromLiteral)); 139 colorSwatch->setShadowPseudoId(AtomicString("-webkit-color-swatch"));
140 wrapperElement->appendChild(colorSwatch.release()); 140 wrapperElement->appendChild(colorSwatch.release());
141 element().userAgentShadowRoot()->appendChild(wrapperElement.release()); 141 element().userAgentShadowRoot()->appendChild(wrapperElement.release());
142 142
143 element().updateView(); 143 element().updateView();
144 } 144 }
145 145
146 void ColorInputType::setValue(const String& value, bool valueChanged, TextFieldE ventBehavior eventBehavior) 146 void ColorInputType::setValue(const String& value, bool valueChanged, TextFieldE ventBehavior eventBehavior)
147 { 147 {
148 InputType::setValue(value, valueChanged, eventBehavior); 148 InputType::setValue(value, valueChanged, eventBehavior);
149 149
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 { 282 {
283 return m_chooser ? m_chooser->rootAXObject() : nullptr; 283 return m_chooser ? m_chooser->rootAXObject() : nullptr;
284 } 284 }
285 285
286 ColorChooserClient* ColorInputType::colorChooserClient() 286 ColorChooserClient* ColorInputType::colorChooserClient()
287 { 287 {
288 return this; 288 return this;
289 } 289 }
290 290
291 } // namespace blink 291 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698