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

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

Issue 1372343002: Crash fix: Avoid using stale HTMLToken after tree construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | 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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 || token->name() == imgTag 785 || token->name() == imgTag
786 || token->name() == keygenTag 786 || token->name() == keygenTag
787 || token->name() == wbrTag) { 787 || token->name() == wbrTag) {
788 m_tree.reconstructTheActiveFormattingElements(); 788 m_tree.reconstructTheActiveFormattingElements();
789 m_tree.insertSelfClosingHTMLElement(token); 789 m_tree.insertSelfClosingHTMLElement(token);
790 m_framesetOk = false; 790 m_framesetOk = false;
791 return; 791 return;
792 } 792 }
793 if (token->name() == inputTag) { 793 if (token->name() == inputTag) {
794 Attribute* typeAttribute = token->getAttributeItem(typeAttr); 794 Attribute* typeAttribute = token->getAttributeItem(typeAttr);
795 bool disableFrameset = !typeAttribute || !equalIgnoringCase(typeAttribut e->value(), "hidden");
796
795 m_tree.reconstructTheActiveFormattingElements(); 797 m_tree.reconstructTheActiveFormattingElements();
796 m_tree.insertSelfClosingHTMLElement(token); 798 m_tree.insertSelfClosingHTMLElement(token);
797 if (!typeAttribute || !equalIgnoringCase(typeAttribute->value(), "hidden ")) 799 m_framesetOk = disableFrameset;
Yoav Weiss 2015/09/29 07:12:42 Can you detail what you suspect is happening in th
kouhei (in TOK) 2015/09/29 07:32:18 Thanks for the catch. This wasn't intentional. Let
798 m_framesetOk = false;
799 return; 800 return;
800 } 801 }
801 if ((RuntimeEnabledFeatures::contextMenuEnabled() && token->name() == menuit emTag) 802 if ((RuntimeEnabledFeatures::contextMenuEnabled() && token->name() == menuit emTag)
802 || token->name() == paramTag 803 || token->name() == paramTag
803 || token->name() == sourceTag 804 || token->name() == sourceTag
804 || token->name() == trackTag) { 805 || token->name() == trackTag) {
805 m_tree.insertSelfClosingHTMLElement(token); 806 m_tree.insertSelfClosingHTMLElement(token);
806 return; 807 return;
807 } 808 }
808 if (token->name() == hrTag) { 809 if (token->name() == hrTag) {
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
2801 ASSERT(m_isAttached); 2802 ASSERT(m_isAttached);
2802 // Warning, this may detach the parser. Do not do anything else after this. 2803 // Warning, this may detach the parser. Do not do anything else after this.
2803 m_tree.finishedParsing(); 2804 m_tree.finishedParsing();
2804 } 2805 }
2805 2806
2806 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) 2807 void HTMLTreeBuilder::parseError(AtomicHTMLToken*)
2807 { 2808 {
2808 } 2809 }
2809 2810
2810 } // namespace blink 2811 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698