OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 return; | 2397 return; |
2398 } | 2398 } |
2399 goto ReprocessBuffer; | 2399 goto ReprocessBuffer; |
2400 } | 2400 } |
2401 case AfterBodyMode: | 2401 case AfterBodyMode: |
2402 case AfterAfterBodyMode: { | 2402 case AfterAfterBodyMode: { |
2403 ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfter
BodyMode); | 2403 ASSERT(insertionMode() == AfterBodyMode || insertionMode() == AfterAfter
BodyMode); |
2404 // FIXME: parse error | 2404 // FIXME: parse error |
2405 setInsertionMode(InBodyMode); | 2405 setInsertionMode(InBodyMode); |
2406 goto ReprocessBuffer; | 2406 goto ReprocessBuffer; |
2407 break; | |
2408 } | 2407 } |
2409 case TextMode: { | 2408 case TextMode: { |
2410 ASSERT(insertionMode() == TextMode); | 2409 ASSERT(insertionMode() == TextMode); |
2411 m_tree.insertTextNode(buffer.takeRemaining()); | 2410 m_tree.insertTextNode(buffer.takeRemaining()); |
2412 break; | 2411 break; |
2413 } | 2412 } |
2414 case InHeadNoscriptMode: { | 2413 case InHeadNoscriptMode: { |
2415 ASSERT(insertionMode() == InHeadNoscriptMode); | 2414 ASSERT(insertionMode() == InHeadNoscriptMode); |
2416 String leadingWhitespace = buffer.takeLeadingWhitespace(); | 2415 String leadingWhitespace = buffer.takeLeadingWhitespace(); |
2417 if (!leadingWhitespace.isEmpty()) | 2416 if (!leadingWhitespace.isEmpty()) |
2418 m_tree.insertTextNode(leadingWhitespace, AllWhitespace); | 2417 m_tree.insertTextNode(leadingWhitespace, AllWhitespace); |
2419 if (buffer.isEmpty()) | 2418 if (buffer.isEmpty()) |
2420 return; | 2419 return; |
2421 defaultForInHeadNoscript(); | 2420 defaultForInHeadNoscript(); |
2422 goto ReprocessBuffer; | 2421 goto ReprocessBuffer; |
2423 break; | |
2424 } | 2422 } |
2425 case InFramesetMode: | 2423 case InFramesetMode: |
2426 case AfterFramesetMode: { | 2424 case AfterFramesetMode: { |
2427 ASSERT(insertionMode() == InFramesetMode || insertionMode() == AfterFram
esetMode || insertionMode() == AfterAfterFramesetMode); | 2425 ASSERT(insertionMode() == InFramesetMode || insertionMode() == AfterFram
esetMode || insertionMode() == AfterAfterFramesetMode); |
2428 String leadingWhitespace = buffer.takeRemainingWhitespace(); | 2426 String leadingWhitespace = buffer.takeRemainingWhitespace(); |
2429 if (!leadingWhitespace.isEmpty()) | 2427 if (!leadingWhitespace.isEmpty()) |
2430 m_tree.insertTextNode(leadingWhitespace, AllWhitespace); | 2428 m_tree.insertTextNode(leadingWhitespace, AllWhitespace); |
2431 // FIXME: We should generate a parse error if we skipped over any | 2429 // FIXME: We should generate a parse error if we skipped over any |
2432 // non-whitespace characters. | 2430 // non-whitespace characters. |
2433 break; | 2431 break; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2845 ASSERT(m_isAttached); | 2843 ASSERT(m_isAttached); |
2846 // Warning, this may detach the parser. Do not do anything else after this. | 2844 // Warning, this may detach the parser. Do not do anything else after this. |
2847 m_tree.finishedParsing(); | 2845 m_tree.finishedParsing(); |
2848 } | 2846 } |
2849 | 2847 |
2850 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) | 2848 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) |
2851 { | 2849 { |
2852 } | 2850 } |
2853 | 2851 |
2854 } // namespace WebCore | 2852 } // namespace WebCore |
OLD | NEW |