OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 bool isTableBodyContextTag(const AtomicString& tagName) | 125 bool isTableBodyContextTag(const AtomicString& tagName) |
126 { | 126 { |
127 return tagName == tbodyTag | 127 return tagName == tbodyTag |
128 || tagName == tfootTag | 128 || tagName == tfootTag |
129 || tagName == theadTag; | 129 || tagName == theadTag; |
130 } | 130 } |
131 | 131 |
132 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#spec
ial | 132 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#spec
ial |
133 bool isSpecialNode(Node* node) | 133 bool isSpecialNode(Node* node) |
134 { | 134 { |
| 135 if (node->hasTagName(SVGNames::foreignObjectTag)) |
| 136 return true; |
135 if (node->namespaceURI() != xhtmlNamespaceURI) | 137 if (node->namespaceURI() != xhtmlNamespaceURI) |
136 return false; | 138 return false; |
137 // FIXME: This list is out of sync with the spec. | |
138 const AtomicString& tagName = node->localName(); | 139 const AtomicString& tagName = node->localName(); |
139 return tagName == addressTag | 140 return tagName == addressTag |
| 141 || tagName == appletTag |
| 142 || tagName == areaTag |
140 || tagName == articleTag | 143 || tagName == articleTag |
141 || tagName == asideTag | 144 || tagName == asideTag |
142 || tagName == baseTag | 145 || tagName == baseTag |
143 || tagName == basefontTag | 146 || tagName == basefontTag |
144 || tagName == bgsoundTag | 147 || tagName == bgsoundTag |
145 || tagName == blockquoteTag | 148 || tagName == blockquoteTag |
146 || tagName == bodyTag | 149 || tagName == bodyTag |
147 || tagName == brTag | 150 || tagName == brTag |
148 || tagName == buttonTag | 151 || tagName == buttonTag |
| 152 || tagName == captionTag |
149 || tagName == centerTag | 153 || tagName == centerTag |
150 || tagName == colTag | 154 || tagName == colTag |
151 || tagName == colgroupTag | 155 || tagName == colgroupTag |
152 || tagName == commandTag | 156 || tagName == commandTag |
153 || tagName == ddTag | 157 || tagName == ddTag |
154 || tagName == detailsTag | 158 || tagName == detailsTag |
155 || tagName == dirTag | 159 || tagName == dirTag |
156 || tagName == divTag | 160 || tagName == divTag |
157 || tagName == dlTag | 161 || tagName == dlTag |
158 || tagName == dtTag | 162 || tagName == dtTag |
159 || tagName == embedTag | 163 || tagName == embedTag |
160 || tagName == fieldsetTag | 164 || tagName == fieldsetTag |
| 165 || tagName == figcaptionTag |
161 || tagName == figureTag | 166 || tagName == figureTag |
162 || tagName == footerTag | 167 || tagName == footerTag |
163 || tagName == formTag | 168 || tagName == formTag |
164 || tagName == frameTag | 169 || tagName == frameTag |
165 || tagName == framesetTag | 170 || tagName == framesetTag |
166 || isNumberedHeaderTag(tagName) | 171 || isNumberedHeaderTag(tagName) |
167 || tagName == headTag | 172 || tagName == headTag |
168 || tagName == headerTag | 173 || tagName == headerTag |
169 || tagName == hgroupTag | 174 || tagName == hgroupTag |
170 || tagName == hrTag | 175 || tagName == hrTag |
171 || tagName == htmlTag | 176 || tagName == htmlTag |
172 || tagName == iframeTag | 177 || tagName == iframeTag |
173 || tagName == imgTag | 178 || tagName == imgTag |
174 || tagName == inputTag | 179 || tagName == inputTag |
175 || tagName == isindexTag | 180 || tagName == isindexTag |
176 || tagName == liTag | 181 || tagName == liTag |
177 || tagName == linkTag | 182 || tagName == linkTag |
178 || tagName == listingTag | 183 || tagName == listingTag |
| 184 || tagName == marqueeTag |
179 || tagName == menuTag | 185 || tagName == menuTag |
180 || tagName == metaTag | 186 || tagName == metaTag |
181 || tagName == navTag | 187 || tagName == navTag |
182 || tagName == noembedTag | 188 || tagName == noembedTag |
183 || tagName == noframesTag | 189 || tagName == noframesTag |
184 || tagName == noscriptTag | 190 || tagName == noscriptTag |
| 191 || tagName == objectTag |
185 || tagName == olTag | 192 || tagName == olTag |
186 || tagName == pTag | 193 || tagName == pTag |
187 || tagName == paramTag | 194 || tagName == paramTag |
188 || tagName == plaintextTag | 195 || tagName == plaintextTag |
189 || tagName == preTag | 196 || tagName == preTag |
190 || tagName == scriptTag | 197 || tagName == scriptTag |
191 || tagName == sectionTag | 198 || tagName == sectionTag |
192 || tagName == selectTag | 199 || tagName == selectTag |
193 || tagName == styleTag | 200 || tagName == styleTag |
| 201 || tagName == summaryTag |
| 202 || tagName == tableTag |
194 || isTableBodyContextTag(tagName) | 203 || isTableBodyContextTag(tagName) |
| 204 || tagName == tdTag |
195 || tagName == textareaTag | 205 || tagName == textareaTag |
| 206 || tagName == thTag |
196 || tagName == titleTag | 207 || tagName == titleTag |
197 || tagName == trTag | 208 || tagName == trTag |
198 || tagName == ulTag | 209 || tagName == ulTag |
199 || tagName == wbrTag | 210 || tagName == wbrTag |
200 || tagName == xmpTag; | 211 || tagName == xmpTag; |
201 } | 212 } |
202 | 213 |
203 bool isNonAnchorNonNobrFormattingTag(const AtomicString& tagName) | 214 bool isNonAnchorNonNobrFormattingTag(const AtomicString& tagName) |
204 { | 215 { |
205 return tagName == bTag | 216 return tagName == bTag |
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2836 return false; | 2847 return false; |
2837 // -0 -> 0 | 2848 // -0 -> 0 |
2838 if (!value) | 2849 if (!value) |
2839 value = 0; | 2850 value = 0; |
2840 if (out) | 2851 if (out) |
2841 *out = value; | 2852 *out = value; |
2842 return true; | 2853 return true; |
2843 } | 2854 } |
2844 | 2855 |
2845 } | 2856 } |
OLD | NEW |