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

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

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase Created 4 years, 1 month 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
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 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 isTableBodyContextTag(token->name())) 1342 isTableBodyContextTag(token->name()))
1343 insertionMode = InTableMode; 1343 insertionMode = InTableMode;
1344 else if (token->name() == trTag) 1344 else if (token->name() == trTag)
1345 insertionMode = InTableBodyMode; 1345 insertionMode = InTableBodyMode;
1346 else if (isTableCellContextTag(token->name())) 1346 else if (isTableCellContextTag(token->name()))
1347 insertionMode = InRowMode; 1347 insertionMode = InRowMode;
1348 else 1348 else
1349 insertionMode = InBodyMode; 1349 insertionMode = InBodyMode;
1350 1350
1351 ASSERT(insertionMode != TemplateContentsMode); 1351 ASSERT(insertionMode != TemplateContentsMode);
1352 ASSERT(m_templateInsertionModes.last() == TemplateContentsMode); 1352 ASSERT(m_templateInsertionModes.back() == TemplateContentsMode);
1353 m_templateInsertionModes.last() = insertionMode; 1353 m_templateInsertionModes.back() = insertionMode;
1354 setInsertionMode(insertionMode); 1354 setInsertionMode(insertionMode);
1355 1355
1356 processStartTag(token); 1356 processStartTag(token);
1357 break; 1357 break;
1358 } 1358 }
1359 } 1359 }
1360 1360
1361 void HTMLTreeBuilder::processHtmlStartTagForInBody(AtomicHTMLToken* token) { 1361 void HTMLTreeBuilder::processHtmlStartTagForInBody(AtomicHTMLToken* token) {
1362 parseError(token); 1362 parseError(token);
1363 if (m_tree.openElements()->hasTemplateInHTMLScope()) { 1363 if (m_tree.openElements()->hasTemplateInHTMLScope()) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 HTMLElementStack::ElementRecord* nodeRecord = 1519 HTMLElementStack::ElementRecord* nodeRecord =
1520 m_tree.openElements()->topRecord(); 1520 m_tree.openElements()->topRecord();
1521 while (1) { 1521 while (1) {
1522 HTMLStackItem* item = nodeRecord->stackItem(); 1522 HTMLStackItem* item = nodeRecord->stackItem();
1523 if (item->node() == m_tree.openElements()->rootNode()) { 1523 if (item->node() == m_tree.openElements()->rootNode()) {
1524 last = true; 1524 last = true;
1525 if (isParsingFragment()) 1525 if (isParsingFragment())
1526 item = m_fragmentContext.contextElementStackItem(); 1526 item = m_fragmentContext.contextElementStackItem();
1527 } 1527 }
1528 if (item->hasTagName(templateTag)) 1528 if (item->hasTagName(templateTag))
1529 return setInsertionMode(m_templateInsertionModes.last()); 1529 return setInsertionMode(m_templateInsertionModes.back());
1530 if (item->hasTagName(selectTag)) { 1530 if (item->hasTagName(selectTag)) {
1531 if (!last) { 1531 if (!last) {
1532 while (item->node() != m_tree.openElements()->rootNode() && 1532 while (item->node() != m_tree.openElements()->rootNode() &&
1533 !item->hasTagName(templateTag)) { 1533 !item->hasTagName(templateTag)) {
1534 nodeRecord = nodeRecord->next(); 1534 nodeRecord = nodeRecord->next();
1535 item = nodeRecord->stackItem(); 1535 item = nodeRecord->stackItem();
1536 if (item->hasTagName(tableTag)) 1536 if (item->hasTagName(tableTag))
1537 return setInsertionMode(InSelectInTableMode); 1537 return setInsertionMode(InSelectInTableMode);
1538 } 1538 }
1539 } 1539 }
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
2755 DEFINE_STRINGIFY(AfterFramesetMode) 2755 DEFINE_STRINGIFY(AfterFramesetMode)
2756 DEFINE_STRINGIFY(AfterAfterBodyMode) 2756 DEFINE_STRINGIFY(AfterAfterBodyMode)
2757 DEFINE_STRINGIFY(AfterAfterFramesetMode) 2757 DEFINE_STRINGIFY(AfterAfterFramesetMode)
2758 #undef DEFINE_STRINGIFY 2758 #undef DEFINE_STRINGIFY
2759 } 2759 }
2760 return "<unknown>"; 2760 return "<unknown>";
2761 } 2761 }
2762 #endif 2762 #endif
2763 2763
2764 } // namespace blink 2764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698