OLD | NEW |
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 | 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 return m_encoding.isValid(); | 114 return m_encoding.isValid(); |
115 } | 115 } |
116 | 116 |
117 WTF::TextEncoding HTMLMetaCharsetParser::encodingFromMetaAttributes(const Attrib
uteList& attributes) | 117 WTF::TextEncoding HTMLMetaCharsetParser::encodingFromMetaAttributes(const Attrib
uteList& attributes) |
118 { | 118 { |
119 bool gotPragma = false; | 119 bool gotPragma = false; |
120 Mode mode = None; | 120 Mode mode = None; |
121 String charset; | 121 String charset; |
122 | 122 |
123 for (AttributeList::const_iterator iter = attributes.begin(); iter != attrib
utes.end(); ++iter) { | 123 for (AttributeList::const_iterator iter = attributes.begin(); iter != attrib
utes.end(); ++iter) { |
124 const AtomicString& attributeName = iter->first; | 124 const AtomicString& attributeName = AtomicString(iter->first); |
125 const String& attributeValue = iter->second; | 125 const String& attributeValue = iter->second; |
126 | 126 |
127 if (attributeName == http_equivAttr) { | 127 if (attributeName == http_equivAttr) { |
128 if (equalIgnoringCase(attributeValue, "content-type")) | 128 if (equalIgnoringCase(attributeValue, "content-type")) |
129 gotPragma = true; | 129 gotPragma = true; |
130 } else if (charset.isEmpty()) { | 130 } else if (charset.isEmpty()) { |
131 if (attributeName == charsetAttr) { | 131 if (attributeName == charsetAttr) { |
132 charset = attributeValue; | 132 charset = attributeValue; |
133 mode = Charset; | 133 mode = Charset; |
134 } else if (attributeName == contentAttr) { | 134 } else if (attributeName == contentAttr) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 return true; | 200 return true; |
201 } | 201 } |
202 | 202 |
203 m_token.clear(); | 203 m_token.clear(); |
204 } | 204 } |
205 | 205 |
206 return false; | 206 return false; |
207 } | 207 } |
208 | 208 |
209 } | 209 } |
OLD | NEW |