Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp

Issue 1836843002: Replace notImplemented() in core/html/parser/ with DVLOG(1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * Copyright (C) 2011, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2014 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 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 } 1457 }
1458 1458
1459 bool HTMLTreeBuilder::processBodyEndTagForInBody(AtomicHTMLToken* token) 1459 bool HTMLTreeBuilder::processBodyEndTagForInBody(AtomicHTMLToken* token)
1460 { 1460 {
1461 ASSERT(token->type() == HTMLToken::EndTag); 1461 ASSERT(token->type() == HTMLToken::EndTag);
1462 ASSERT(token->name() == bodyTag); 1462 ASSERT(token->name() == bodyTag);
1463 if (!m_tree.openElements()->inScope(bodyTag.localName())) { 1463 if (!m_tree.openElements()->inScope(bodyTag.localName())) {
1464 parseError(token); 1464 parseError(token);
1465 return false; 1465 return false;
1466 } 1466 }
1467 notImplemented(); // Emit a more specific parse error based on stack content s. 1467 DVLOG(1) << "Not implmeneted."; // Emit a more specific parse error based on stack contents.
1468 setInsertionMode(AfterBodyMode); 1468 setInsertionMode(AfterBodyMode);
1469 return true; 1469 return true;
1470 } 1470 }
1471 1471
1472 void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomicHTMLToken* token) 1472 void HTMLTreeBuilder::processAnyOtherEndTagForInBody(AtomicHTMLToken* token)
1473 { 1473 {
1474 ASSERT(token->type() == HTMLToken::EndTag); 1474 ASSERT(token->type() == HTMLToken::EndTag);
1475 if (token->name() == menuitemTag) 1475 if (token->name() == menuitemTag)
1476 UseCounter::count(m_tree.currentNode()->document(), UseCounter::MenuItem CloseTag); 1476 UseCounter::count(m_tree.currentNode()->document(), UseCounter::MenuItem CloseTag);
1477 HTMLElementStack::ElementRecord* record = m_tree.openElements()->topRecord() ; 1477 HTMLElementStack::ElementRecord* record = m_tree.openElements()->topRecord() ;
(...skipping 27 matching lines...) Expand all
1505 // 1, 2, 3 and 16 are covered by the for() loop. 1505 // 1, 2, 3 and 16 are covered by the for() loop.
1506 for (int i = 0; i < outerIterationLimit; ++i) { 1506 for (int i = 0; i < outerIterationLimit; ++i) {
1507 // 4. 1507 // 4.
1508 Element* formattingElement = m_tree.activeFormattingElements()->closestE lementInScopeWithName(token->name()); 1508 Element* formattingElement = m_tree.activeFormattingElements()->closestE lementInScopeWithName(token->name());
1509 // 4.a 1509 // 4.a
1510 if (!formattingElement) 1510 if (!formattingElement)
1511 return processAnyOtherEndTagForInBody(token); 1511 return processAnyOtherEndTagForInBody(token);
1512 // 4.c 1512 // 4.c
1513 if ((m_tree.openElements()->contains(formattingElement)) && !m_tree.open Elements()->inScope(formattingElement)) { 1513 if ((m_tree.openElements()->contains(formattingElement)) && !m_tree.open Elements()->inScope(formattingElement)) {
1514 parseError(token); 1514 parseError(token);
1515 notImplemented(); // Check the stack of open elements for a more spe cific parse error. 1515 DVLOG(1) << "Not implemented."; // Check the stack of open elements for a more specific parse error.
1516 return; 1516 return;
1517 } 1517 }
1518 // 4.b 1518 // 4.b
1519 HTMLElementStack::ElementRecord* formattingElementRecord = m_tree.openEl ements()->find(formattingElement); 1519 HTMLElementStack::ElementRecord* formattingElementRecord = m_tree.openEl ements()->find(formattingElement);
1520 if (!formattingElementRecord) { 1520 if (!formattingElementRecord) {
1521 parseError(token); 1521 parseError(token);
1522 m_tree.activeFormattingElements()->remove(formattingElement); 1522 m_tree.activeFormattingElements()->remove(formattingElement);
1523 return; 1523 return;
1524 } 1524 }
1525 // 4.d 1525 // 4.d
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 // Fall through. 2457 // Fall through.
2458 case AfterHeadMode: 2458 case AfterHeadMode:
2459 ASSERT(getInsertionMode() == AfterHeadMode); 2459 ASSERT(getInsertionMode() == AfterHeadMode);
2460 defaultForAfterHead(); 2460 defaultForAfterHead();
2461 // Fall through 2461 // Fall through
2462 case InBodyMode: 2462 case InBodyMode:
2463 case InCellMode: 2463 case InCellMode:
2464 case InCaptionMode: 2464 case InCaptionMode:
2465 case InRowMode: 2465 case InRowMode:
2466 ASSERT(getInsertionMode() == InBodyMode || getInsertionMode() == InCellM ode || getInsertionMode() == InCaptionMode || getInsertionMode() == InRowMode || getInsertionMode() == TemplateContentsMode); 2466 ASSERT(getInsertionMode() == InBodyMode || getInsertionMode() == InCellM ode || getInsertionMode() == InCaptionMode || getInsertionMode() == InRowMode || getInsertionMode() == TemplateContentsMode);
2467 notImplemented(); // Emit parse error based on what elements are still o pen. 2467 DVLOG(1) << "Not implemented."; // Emit parse error based on what elemen ts are still open.
2468 if (!m_templateInsertionModes.isEmpty() && processEndOfFileForInTemplate Contents(token)) 2468 if (!m_templateInsertionModes.isEmpty() && processEndOfFileForInTemplate Contents(token))
2469 return; 2469 return;
2470 break; 2470 break;
2471 case AfterBodyMode: 2471 case AfterBodyMode:
2472 case AfterAfterBodyMode: 2472 case AfterAfterBodyMode:
2473 ASSERT(getInsertionMode() == AfterBodyMode || getInsertionMode() == Afte rAfterBodyMode); 2473 ASSERT(getInsertionMode() == AfterBodyMode || getInsertionMode() == Afte rAfterBodyMode);
2474 break; 2474 break;
2475 case InHeadNoscriptMode: 2475 case InHeadNoscriptMode:
2476 ASSERT(getInsertionMode() == InHeadNoscriptMode); 2476 ASSERT(getInsertionMode() == InHeadNoscriptMode);
2477 defaultForInHeadNoscript(); 2477 defaultForInHeadNoscript();
(...skipping 22 matching lines...) Expand all
2500 if (!m_templateInsertionModes.isEmpty() && processEndOfFileForInTemplate Contents(token)) 2500 if (!m_templateInsertionModes.isEmpty() && processEndOfFileForInTemplate Contents(token))
2501 return; 2501 return;
2502 break; 2502 break;
2503 case InTableTextMode: 2503 case InTableTextMode:
2504 defaultForInTableText(); 2504 defaultForInTableText();
2505 processEndOfFile(token); 2505 processEndOfFile(token);
2506 return; 2506 return;
2507 case TextMode: 2507 case TextMode:
2508 parseError(token); 2508 parseError(token);
2509 if (m_tree.currentStackItem()->hasTagName(scriptTag)) 2509 if (m_tree.currentStackItem()->hasTagName(scriptTag))
2510 notImplemented(); // mark the script element as "already started". 2510 DVLOG(1) << "Not implemented."; // mark the script element as "alrea dy started".
2511 m_tree.openElements()->pop(); 2511 m_tree.openElements()->pop();
2512 ASSERT(m_originalInsertionMode != TextMode); 2512 ASSERT(m_originalInsertionMode != TextMode);
2513 setInsertionMode(m_originalInsertionMode); 2513 setInsertionMode(m_originalInsertionMode);
2514 processEndOfFile(token); 2514 processEndOfFile(token);
2515 return; 2515 return;
2516 case TemplateContentsMode: 2516 case TemplateContentsMode:
2517 if (processEndOfFileForInTemplateContents(token)) 2517 if (processEndOfFileForInTemplateContents(token))
2518 return; 2518 return;
2519 break; 2519 break;
2520 } 2520 }
2521 m_tree.processEndOfFile(); 2521 m_tree.processEndOfFile();
2522 } 2522 }
2523 2523
2524 void HTMLTreeBuilder::defaultForInitial() 2524 void HTMLTreeBuilder::defaultForInitial()
2525 { 2525 {
2526 notImplemented(); 2526 DVLOG(1) << "Not implemented.";
2527 m_tree.setDefaultCompatibilityMode(); 2527 m_tree.setDefaultCompatibilityMode();
2528 // FIXME: parse error 2528 // FIXME: parse error
2529 setInsertionMode(BeforeHTMLMode); 2529 setInsertionMode(BeforeHTMLMode);
2530 } 2530 }
2531 2531
2532 void HTMLTreeBuilder::defaultForBeforeHTML() 2532 void HTMLTreeBuilder::defaultForBeforeHTML()
2533 { 2533 {
2534 AtomicHTMLToken startHTML(HTMLToken::StartTag, htmlTag.localName()); 2534 AtomicHTMLToken startHTML(HTMLToken::StartTag, htmlTag.localName());
2535 m_tree.insertHTMLHtmlStartTagBeforeHTML(&startHTML); 2535 m_tree.insertHTMLHtmlStartTagBeforeHTML(&startHTML);
2536 setInsertionMode(BeforeHeadMode); 2536 setInsertionMode(BeforeHeadMode);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 ASSERT(m_isAttached); 2820 ASSERT(m_isAttached);
2821 // Warning, this may detach the parser. Do not do anything else after this. 2821 // Warning, this may detach the parser. Do not do anything else after this.
2822 m_tree.finishedParsing(); 2822 m_tree.finishedParsing();
2823 } 2823 }
2824 2824
2825 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) 2825 void HTMLTreeBuilder::parseError(AtomicHTMLToken*)
2826 { 2826 {
2827 } 2827 }
2828 2828
2829 } // namespace blink 2829 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698