OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/html/parser/HTMLElementStack.h" | 28 #include "core/html/parser/HTMLElementStack.h" |
29 | 29 |
30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
31 #include "MathMLNames.h" | 31 #include "MathMLNames.h" |
32 #include "SVGNames.h" | 32 #include "SVGNames.h" |
33 #include "core/dom/Element.h" | 33 #include "core/dom/Element.h" |
| 34 #include "core/html/HTMLOptGroupElement.h" |
34 #include <wtf/PassOwnPtr.h> | 35 #include <wtf/PassOwnPtr.h> |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 using namespace HTMLNames; | 39 using namespace HTMLNames; |
39 | 40 |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 inline bool isRootNode(HTMLStackItem* item) | 44 inline bool isRootNode(HTMLStackItem* item) |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 107 } |
107 | 108 |
108 inline bool isButtonScopeMarker(HTMLStackItem* item) | 109 inline bool isButtonScopeMarker(HTMLStackItem* item) |
109 { | 110 { |
110 return isScopeMarker(item) | 111 return isScopeMarker(item) |
111 || item->hasTagName(buttonTag); | 112 || item->hasTagName(buttonTag); |
112 } | 113 } |
113 | 114 |
114 inline bool isSelectScopeMarker(HTMLStackItem* item) | 115 inline bool isSelectScopeMarker(HTMLStackItem* item) |
115 { | 116 { |
116 return !item->hasTagName(optgroupTag) | 117 return !isHTMLOptGroupElement(item->node()) |
117 && !item->hasTagName(optionTag); | 118 && !item->hasTagName(optionTag); |
118 } | 119 } |
119 | 120 |
120 } | 121 } |
121 | 122 |
122 HTMLElementStack::ElementRecord::ElementRecord(PassRefPtr<HTMLStackItem> item, P
assOwnPtr<ElementRecord> next) | 123 HTMLElementStack::ElementRecord::ElementRecord(PassRefPtr<HTMLStackItem> item, P
assOwnPtr<ElementRecord> next) |
123 : m_item(item) | 124 : m_item(item) |
124 , m_next(next) | 125 , m_next(next) |
125 { | 126 { |
126 ASSERT(m_item); | 127 ASSERT(m_item); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 | 609 |
609 void HTMLElementStack::show() | 610 void HTMLElementStack::show() |
610 { | 611 { |
611 for (ElementRecord* record = m_top.get(); record; record = record->next()) | 612 for (ElementRecord* record = m_top.get(); record; record = record->next()) |
612 record->element()->showNode(); | 613 record->element()->showNode(); |
613 } | 614 } |
614 | 615 |
615 #endif | 616 #endif |
616 | 617 |
617 } | 618 } |
OLD | NEW |