| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // FIXME: This is just a copy of Tokenizer::updateStateFor which uses | 138 // FIXME: This is just a copy of Tokenizer::updateStateFor which uses |
| 139 // threadSafeMatches. | 139 // threadSafeMatches. |
| 140 if (threadSafeMatch(tagName, textareaTag) || | 140 if (threadSafeMatch(tagName, textareaTag) || |
| 141 threadSafeMatch(tagName, titleTag)) { | 141 threadSafeMatch(tagName, titleTag)) { |
| 142 tokenizer->setState(HTMLTokenizer::RCDATAState); | 142 tokenizer->setState(HTMLTokenizer::RCDATAState); |
| 143 } else if (threadSafeMatch(tagName, plaintextTag)) { | 143 } else if (threadSafeMatch(tagName, plaintextTag)) { |
| 144 tokenizer->setState(HTMLTokenizer::PLAINTEXTState); | 144 tokenizer->setState(HTMLTokenizer::PLAINTEXTState); |
| 145 } else if (threadSafeMatch(tagName, scriptTag)) { | 145 } else if (threadSafeMatch(tagName, scriptTag)) { |
| 146 tokenizer->setState(HTMLTokenizer::ScriptDataState); | 146 tokenizer->setState(HTMLTokenizer::ScriptDataState); |
| 147 simulatedToken = ScriptStart; | 147 simulatedToken = ScriptStart; |
| 148 } else if (threadSafeMatch(tagName, linkTag)) { |
| 149 simulatedToken = Link; |
| 148 } else if (threadSafeMatch(tagName, styleTag) || | 150 } else if (threadSafeMatch(tagName, styleTag) || |
| 149 threadSafeMatch(tagName, iframeTag) || | 151 threadSafeMatch(tagName, iframeTag) || |
| 150 threadSafeMatch(tagName, xmpTag) || | 152 threadSafeMatch(tagName, xmpTag) || |
| 151 (threadSafeMatch(tagName, noembedTag) && | 153 (threadSafeMatch(tagName, noembedTag) && |
| 152 m_options.pluginsEnabled) || | 154 m_options.pluginsEnabled) || |
| 153 threadSafeMatch(tagName, noframesTag) || | 155 threadSafeMatch(tagName, noframesTag) || |
| 154 (threadSafeMatch(tagName, noscriptTag) && | 156 (threadSafeMatch(tagName, noscriptTag) && |
| 155 m_options.scriptEnabled)) { | 157 m_options.scriptEnabled)) { |
| 156 tokenizer->setState(HTMLTokenizer::RAWTEXTState); | 158 tokenizer->setState(HTMLTokenizer::RAWTEXTState); |
| 157 } | 159 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 169 (m_namespaceStack.contains(SVG) && m_namespaceStack.back() == HTML && | 171 (m_namespaceStack.contains(SVG) && m_namespaceStack.back() == HTML && |
| 170 tokenExitsSVG(token)) || | 172 tokenExitsSVG(token)) || |
| 171 (m_namespaceStack.contains(MathML) && m_namespaceStack.back() == HTML && | 173 (m_namespaceStack.contains(MathML) && m_namespaceStack.back() == HTML && |
| 172 tokenExitsMath(token))) | 174 tokenExitsMath(token))) |
| 173 m_namespaceStack.pop_back(); | 175 m_namespaceStack.pop_back(); |
| 174 if (threadSafeMatch(tagName, scriptTag)) { | 176 if (threadSafeMatch(tagName, scriptTag)) { |
| 175 if (!inForeignContent()) | 177 if (!inForeignContent()) |
| 176 tokenizer->setState(HTMLTokenizer::DataState); | 178 tokenizer->setState(HTMLTokenizer::DataState); |
| 177 return ScriptEnd; | 179 return ScriptEnd; |
| 178 } | 180 } |
| 181 if (threadSafeMatch(tagName, styleTag)) |
| 182 simulatedToken = StyleEnd; |
| 179 } | 183 } |
| 180 | 184 |
| 181 // FIXME: Also setForceNullCharacterReplacement when in text mode. | 185 // FIXME: Also setForceNullCharacterReplacement when in text mode. |
| 182 tokenizer->setForceNullCharacterReplacement(inForeignContent()); | 186 tokenizer->setForceNullCharacterReplacement(inForeignContent()); |
| 183 tokenizer->setShouldAllowCDATA(inForeignContent()); | 187 tokenizer->setShouldAllowCDATA(inForeignContent()); |
| 184 return simulatedToken; | 188 return simulatedToken; |
| 185 } | 189 } |
| 186 | 190 |
| 187 } // namespace blink | 191 } // namespace blink |
| OLD | NEW |