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

Side by Side Diff: Source/core/html/forms/HiddenInputType.cpp

Issue 99333011: Make sure getAttribute() / setAttribute() callers use AtomicStrings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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/core/html/forms/BaseCheckableInputType.cpp ('k') | Source/core/html/track/TextTrack.h » ('j') | 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 { 57 {
58 // valueAttributeWasUpdatedAfterParsing() never be true for form 58 // valueAttributeWasUpdatedAfterParsing() never be true for form
59 // controls create by createElement() or cloneNode(). It's ok for 59 // controls create by createElement() or cloneNode(). It's ok for
60 // now because we restore values only to form controls created by 60 // now because we restore values only to form controls created by
61 // parsing. 61 // parsing.
62 return element().valueAttributeWasUpdatedAfterParsing() ? FormControlState(e lement().value()) : FormControlState(); 62 return element().valueAttributeWasUpdatedAfterParsing() ? FormControlState(e lement().value()) : FormControlState();
63 } 63 }
64 64
65 void HiddenInputType::restoreFormControlState(const FormControlState& state) 65 void HiddenInputType::restoreFormControlState(const FormControlState& state)
66 { 66 {
67 element().setAttribute(valueAttr, state[0]); 67 element().setAttribute(valueAttr, AtomicString(state[0]));
68 } 68 }
69 69
70 bool HiddenInputType::supportsValidation() const 70 bool HiddenInputType::supportsValidation() const
71 { 71 {
72 return false; 72 return false;
73 } 73 }
74 74
75 RenderObject* HiddenInputType::createRenderer(RenderStyle*) const 75 RenderObject* HiddenInputType::createRenderer(RenderStyle*) const
76 { 76 {
77 ASSERT_NOT_REACHED(); 77 ASSERT_NOT_REACHED();
78 return 0; 78 return 0;
79 } 79 }
80 80
81 void HiddenInputType::accessKeyAction(bool) 81 void HiddenInputType::accessKeyAction(bool)
82 { 82 {
83 } 83 }
84 84
85 bool HiddenInputType::rendererIsNeeded() 85 bool HiddenInputType::rendererIsNeeded()
86 { 86 {
87 return false; 87 return false;
88 } 88 }
89 89
90 bool HiddenInputType::storesValueSeparateFromAttribute() 90 bool HiddenInputType::storesValueSeparateFromAttribute()
91 { 91 {
92 return false; 92 return false;
93 } 93 }
94 94
95 void HiddenInputType::setValue(const String& sanitizedValue, bool, TextFieldEven tBehavior) 95 void HiddenInputType::setValue(const String& sanitizedValue, bool, TextFieldEven tBehavior)
96 { 96 {
97 element().setAttribute(valueAttr, sanitizedValue); 97 element().setAttribute(valueAttr, AtomicString(sanitizedValue));
98 } 98 }
99 99
100 bool HiddenInputType::isHiddenType() const 100 bool HiddenInputType::isHiddenType() const
101 { 101 {
102 return true; 102 return true;
103 } 103 }
104 104
105 bool HiddenInputType::appendFormData(FormDataList& encoding, bool isMultipartFor m) const 105 bool HiddenInputType::appendFormData(FormDataList& encoding, bool isMultipartFor m) const
106 { 106 {
107 if (equalIgnoringCase(element().name(), "_charset_")) { 107 if (equalIgnoringCase(element().name(), "_charset_")) {
108 encoding.appendData(element().name(), String(encoding.encoding().name()) ); 108 encoding.appendData(element().name(), String(encoding.encoding().name()) );
109 return true; 109 return true;
110 } 110 }
111 return InputType::appendFormData(encoding, isMultipartForm); 111 return InputType::appendFormData(encoding, isMultipartForm);
112 } 112 }
113 113
114 bool HiddenInputType::shouldRespectHeightAndWidthAttributes() 114 bool HiddenInputType::shouldRespectHeightAndWidthAttributes()
115 { 115 {
116 return true; 116 return true;
117 } 117 }
118 118
119 } // namespace WebCore 119 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/BaseCheckableInputType.cpp ('k') | Source/core/html/track/TextTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698