| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // That many input bytes will be checked for meta charset even if <head> section | 60 // That many input bytes will be checked for meta charset even if <head> section |
| 61 // is over. | 61 // is over. |
| 62 static const int bytesToCheckUnconditionally = 1024; | 62 static const int bytesToCheckUnconditionally = 1024; |
| 63 | 63 |
| 64 bool HTMLMetaCharsetParser::checkForMetaCharset(const char* data, | 64 bool HTMLMetaCharsetParser::checkForMetaCharset(const char* data, |
| 65 size_t length) { | 65 size_t length) { |
| 66 if (m_doneChecking) | 66 if (m_doneChecking) |
| 67 return true; | 67 return true; |
| 68 | 68 |
| 69 ASSERT(!m_encoding.isValid()); | 69 DCHECK(!m_encoding.isValid()); |
| 70 | 70 |
| 71 // We still don't have an encoding, and are in the head. The following tags | 71 // We still don't have an encoding, and are in the head. The following tags |
| 72 // are allowed in <head>: SCRIPT|STYLE|META|LINK|OBJECT|TITLE|BASE | 72 // are allowed in <head>: SCRIPT|STYLE|META|LINK|OBJECT|TITLE|BASE |
| 73 | 73 |
| 74 // We stop scanning when a tag that is not permitted in <head> is seen, rather | 74 // We stop scanning when a tag that is not permitted in <head> is seen, rather |
| 75 // when </head> is seen, because that more closely matches behavior in other | 75 // when </head> is seen, because that more closely matches behavior in other |
| 76 // browsers; more details in <http://bugs.webkit.org/show_bug.cgi?id=3590>. | 76 // browsers; more details in <http://bugs.webkit.org/show_bug.cgi?id=3590>. |
| 77 | 77 |
| 78 // Additionally, we ignore things that looks like tags in <title>, <script> | 78 // Additionally, we ignore things that looks like tags in <title>, <script> |
| 79 // and <noscript>; see: | 79 // and <noscript>; see: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return true; | 119 return true; |
| 120 } | 120 } |
| 121 | 121 |
| 122 m_token.clear(); | 122 m_token.clear(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 return false; | 125 return false; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |