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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 const SegmentedString& currentString = m_input.current(); | 995 const SegmentedString& currentString = m_input.current(); |
996 OrdinalNumber line = currentString.currentLine(); | 996 OrdinalNumber line = currentString.currentLine(); |
997 OrdinalNumber column = currentString.currentColumn(); | 997 OrdinalNumber column = currentString.currentColumn(); |
998 | 998 |
999 return TextPosition(line, column); | 999 return TextPosition(line, column); |
1000 } | 1000 } |
1001 | 1001 |
1002 bool HTMLDocumentParser::isWaitingForScripts() const | 1002 bool HTMLDocumentParser::isWaitingForScripts() const |
1003 { | 1003 { |
1004 // When the TreeBuilder encounters a </script> tag, it returns to the HTMLDo
cumentParser | 1004 // When the TreeBuilder encounters a </script> tag, it returns to the HTMLDo
cumentParser |
1005 // where the script is transfered from the treebuilder to the script runner. | 1005 // where the script is transferred from the treebuilder to the script runner
. |
1006 // The script runner will hold the script until its loaded and run. During | 1006 // The script runner will hold the script until its loaded and run. During |
1007 // any of this time, we want to count ourselves as "waiting for a script" an
d thus | 1007 // any of this time, we want to count ourselves as "waiting for a script" an
d thus |
1008 // run the preload scanner, as well as delay completion of parsing. | 1008 // run the preload scanner, as well as delay completion of parsing. |
1009 bool treeBuilderHasBlockingScript = m_treeBuilder->hasParserBlockingScript()
; | 1009 bool treeBuilderHasBlockingScript = m_treeBuilder->hasParserBlockingScript()
; |
1010 bool scriptRunnerHasBlockingScript = m_scriptRunner && m_scriptRunner->hasPa
rserBlockingScript(); | 1010 bool scriptRunnerHasBlockingScript = m_scriptRunner && m_scriptRunner->hasPa
rserBlockingScript(); |
1011 // Since the parser is paused while a script runner has a blocking script, i
t should | 1011 // Since the parser is paused while a script runner has a blocking script, i
t should |
1012 // never be possible to end up with both objects holding a blocking script. | 1012 // never be possible to end up with both objects holding a blocking script. |
1013 ASSERT(!(treeBuilderHasBlockingScript && scriptRunnerHasBlockingScript)); | 1013 ASSERT(!(treeBuilderHasBlockingScript && scriptRunnerHasBlockingScript)); |
1014 // If either object has a blocking script, the parser should be paused. | 1014 // If either object has a blocking script, the parser should be paused. |
1015 return treeBuilderHasBlockingScript || scriptRunnerHasBlockingScript; | 1015 return treeBuilderHasBlockingScript || scriptRunnerHasBlockingScript; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) | 1155 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
1156 { | 1156 { |
1157 ASSERT(decoder); | 1157 ASSERT(decoder); |
1158 DecodedDataDocumentParser::setDecoder(decoder); | 1158 DecodedDataDocumentParser::setDecoder(decoder); |
1159 | 1159 |
1160 if (m_haveBackgroundParser) | 1160 if (m_haveBackgroundParser) |
1161 HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParse
r::setDecoder, AllowCrossThreadAccess(m_backgroundParser), takeDecoder())); | 1161 HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParse
r::setDecoder, AllowCrossThreadAccess(m_backgroundParser), takeDecoder())); |
1162 } | 1162 } |
1163 | 1163 |
1164 } | 1164 } |
OLD | NEW |