| Index: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
|
| index b9bf2507e090c072b8fb49ffe5355d6d081a7238..e3ede9d365cdfedf540d197a81d34276e9be399b 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp
|
| @@ -398,7 +398,7 @@ String extractCharset(const String& value) {
|
| return "";
|
| }
|
|
|
| -enum Mode {
|
| +enum class MetaAttribute {
|
| None,
|
| Charset,
|
| Pragma,
|
| @@ -407,7 +407,7 @@ enum Mode {
|
| WTF::TextEncoding encodingFromMetaAttributes(
|
| const HTMLAttributeList& attributes) {
|
| bool gotPragma = false;
|
| - Mode mode = None;
|
| + MetaAttribute mode = MetaAttribute::None;
|
| String charset;
|
|
|
| for (const auto& htmlAttribute : attributes) {
|
| @@ -420,16 +420,17 @@ WTF::TextEncoding encodingFromMetaAttributes(
|
| } else if (charset.isEmpty()) {
|
| if (threadSafeMatch(attributeName, charsetAttr)) {
|
| charset = attributeValue;
|
| - mode = Charset;
|
| + mode = MetaAttribute::Charset;
|
| } else if (threadSafeMatch(attributeName, contentAttr)) {
|
| charset = extractCharset(attributeValue);
|
| if (charset.length())
|
| - mode = Pragma;
|
| + mode = MetaAttribute::Pragma;
|
| }
|
| }
|
| }
|
|
|
| - if (mode == Charset || (mode == Pragma && gotPragma))
|
| + if (mode == MetaAttribute::Charset ||
|
| + (mode == MetaAttribute::Pragma && gotPragma))
|
| return WTF::TextEncoding(stripLeadingAndTrailingHTMLSpaces(charset));
|
|
|
| return WTF::TextEncoding();
|
|
|