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

Side by Side Diff: Source/WebCore/html/parser/HTMLElementStack.cpp

Issue 10377014: Merge 115763 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 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
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 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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } 379 }
380 380
381 HTMLElementStack::ElementRecord* HTMLElementStack::topRecord() const 381 HTMLElementStack::ElementRecord* HTMLElementStack::topRecord() const
382 { 382 {
383 ASSERT(m_top); 383 ASSERT(m_top);
384 return m_top.get(); 384 return m_top.get();
385 } 385 }
386 386
387 Element* HTMLElementStack::oneBelowTop() const 387 Element* HTMLElementStack::oneBelowTop() const
388 { 388 {
389 // We should never be calling this if it could be 0. 389 // We should never call this if there are fewer than 2 elements on the stack .
390 ASSERT(m_top); 390 ASSERT(m_top);
391 ASSERT(m_top->next()); 391 ASSERT(m_top->next());
392 return m_top->next()->element(); 392 if (m_top->next()->node()->isElementNode())
393 return m_top->next()->element();
394 return 0;
393 } 395 }
394 396
395 Element* HTMLElementStack::bottom() const 397 Element* HTMLElementStack::bottom() const
396 { 398 {
397 return htmlElement(); 399 return htmlElement();
398 } 400 }
399 401
400 void HTMLElementStack::removeHTMLHeadElement(Element* element) 402 void HTMLElementStack::removeHTMLHeadElement(Element* element)
401 { 403 {
402 ASSERT(m_headElement == element); 404 ASSERT(m_headElement == element);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 621
620 void HTMLElementStack::show() 622 void HTMLElementStack::show()
621 { 623 {
622 for (ElementRecord* record = m_top.get(); record; record = record->next()) 624 for (ElementRecord* record = m_top.get(); record; record = record->next())
623 record->element()->showNode(); 625 record->element()->showNode();
624 } 626 }
625 627
626 #endif 628 #endif
627 629
628 } 630 }
OLDNEW
« no previous file with comments | « LayoutTests/html5lib/resources/webkit02.dat ('k') | Source/WebCore/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698