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

Side by Side Diff: Source/core/html/parser/HTMLConstructionSite.cpp

Issue 18970003: Introduce isHTMLOptGroupElement and toHTMLOptGroupElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 | « Source/core/html/HTMLSelectElement.cpp ('k') | Source/core/html/parser/HTMLElementStack.cpp » ('j') | 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 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 19 matching lines...) Expand all
30 #include "HTMLElementFactory.h" 30 #include "HTMLElementFactory.h"
31 #include "HTMLNames.h" 31 #include "HTMLNames.h"
32 #include "core/dom/Comment.h" 32 #include "core/dom/Comment.h"
33 #include "core/dom/DocumentFragment.h" 33 #include "core/dom/DocumentFragment.h"
34 #include "core/dom/DocumentType.h" 34 #include "core/dom/DocumentType.h"
35 #include "core/dom/Element.h" 35 #include "core/dom/Element.h"
36 #include "core/dom/ScriptLoader.h" 36 #include "core/dom/ScriptLoader.h"
37 #include "core/dom/Text.h" 37 #include "core/dom/Text.h"
38 #include "core/html/HTMLFormElement.h" 38 #include "core/html/HTMLFormElement.h"
39 #include "core/html/HTMLHtmlElement.h" 39 #include "core/html/HTMLHtmlElement.h"
40 #include "core/html/HTMLOptGroupElement.h"
40 #include "core/html/HTMLScriptElement.h" 41 #include "core/html/HTMLScriptElement.h"
41 #include "core/html/HTMLTemplateElement.h" 42 #include "core/html/HTMLTemplateElement.h"
42 #include "core/html/parser/AtomicHTMLToken.h" 43 #include "core/html/parser/AtomicHTMLToken.h"
43 #include "core/html/parser/HTMLParserIdioms.h" 44 #include "core/html/parser/HTMLParserIdioms.h"
44 #include "core/html/parser/HTMLStackItem.h" 45 #include "core/html/parser/HTMLStackItem.h"
45 #include "core/html/parser/HTMLToken.h" 46 #include "core/html/parser/HTMLToken.h"
46 #include "core/loader/FrameLoader.h" 47 #include "core/loader/FrameLoader.h"
47 #include "core/loader/FrameLoaderClient.h" 48 #include "core/loader/FrameLoaderClient.h"
48 #include "core/page/Frame.h" 49 #include "core/page/Frame.h"
49 #include "core/platform/NotImplemented.h" 50 #include "core/platform/NotImplemented.h"
(...skipping 11 matching lines...) Expand all
61 element->stripScriptingAttributes(token->attributes()); 62 element->stripScriptingAttributes(token->attributes());
62 element->parserSetAttributes(token->attributes()); 63 element->parserSetAttributes(token->attributes());
63 } 64 }
64 65
65 static bool hasImpliedEndTag(const HTMLStackItem* item) 66 static bool hasImpliedEndTag(const HTMLStackItem* item)
66 { 67 {
67 return item->hasTagName(ddTag) 68 return item->hasTagName(ddTag)
68 || item->hasTagName(dtTag) 69 || item->hasTagName(dtTag)
69 || item->hasTagName(liTag) 70 || item->hasTagName(liTag)
70 || item->hasTagName(optionTag) 71 || item->hasTagName(optionTag)
71 || item->hasTagName(optgroupTag) 72 || isHTMLOptGroupElement(item->node())
72 || item->hasTagName(pTag) 73 || item->hasTagName(pTag)
73 || item->hasTagName(rpTag) 74 || item->hasTagName(rpTag)
74 || item->hasTagName(rtTag); 75 || item->hasTagName(rtTag);
75 } 76 }
76 77
77 static bool shouldUseLengthLimit(const ContainerNode* node) 78 static bool shouldUseLengthLimit(const ContainerNode* node)
78 { 79 {
79 return !node->hasTagName(scriptTag) 80 return !node->hasTagName(scriptTag)
80 && !node->hasTagName(styleTag) 81 && !node->hasTagName(styleTag)
81 && !node->hasTagName(SVGNames::scriptTag); 82 && !node->hasTagName(SVGNames::scriptTag);
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 { 760 {
760 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); 761 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert);
761 findFosterSite(task); 762 findFosterSite(task);
762 task.child = node; 763 task.child = node;
763 ASSERT(task.parent); 764 ASSERT(task.parent);
764 765
765 m_taskQueue.append(task); 766 m_taskQueue.append(task);
766 } 767 }
767 768
768 } 769 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | Source/core/html/parser/HTMLElementStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698