Commit 3d2511fa authored by rob.buis@samsung.com's avatar rob.buis@samsung.com

Make textInputFlags use static AtomicStrings

This method is called a lot during browser launch. Instead of
reconstructing the same AtomicString every time (without even
ConstructFromLiteral) pass in a local static AtomicString.

Review URL: https://codereview.chromium.org/554933003

git-svn-id: svn://svn.chromium.org/blink/trunk@181916 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ca2f57f5
......@@ -2300,21 +2300,24 @@ int WebViewImpl::textInputFlags()
if (!element)
return WebTextInputFlagNone;
DEFINE_STATIC_LOCAL(AtomicString, autocompleteString, ("autocomplete", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, autocorrectString, ("autocorrect", AtomicString::ConstructFromLiteral));
DEFINE_STATIC_LOCAL(AtomicString, spellcheckString, ("spellcheck", AtomicString::ConstructFromLiteral));
int flags = 0;
const AtomicString& autocomplete = element->getAttribute("autocomplete");
const AtomicString& autocomplete = element->getAttribute(autocompleteString);
if (autocomplete == "on")
flags |= WebTextInputFlagAutocompleteOn;
else if (autocomplete == "off")
flags |= WebTextInputFlagAutocompleteOff;
const AtomicString& autocorrect = element->getAttribute("autocorrect");
const AtomicString& autocorrect = element->getAttribute(autocorrectString);
if (autocorrect == "on")
flags |= WebTextInputFlagAutocorrectOn;
else if (autocorrect == "off")
flags |= WebTextInputFlagAutocorrectOff;
const AtomicString& spellcheck = element->getAttribute("spellcheck");
const AtomicString& spellcheck = element->getAttribute(spellcheckString);
if (spellcheck == "on")
flags |= WebTextInputFlagSpellcheckOn;
else if (spellcheck == "off")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment