Changeset 7701 in webkit
- Timestamp:
- Sep 27, 2004 5:57:52 PM (20 years ago)
- Location:
- trunk/WebCore/khtml/html
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/khtml/html/htmlparser.cpp
r7450 r7701 254 254 if(endTag[e->id()] == DOM::OPTIONAL) 255 255 popBlock(t->id); 256 257 if (isHeaderTag(t->id)) 258 // Do not allow two header tags to be nested if the intervening tags are inlines. 259 popNestedHeaderTag(); 256 260 } 257 261 … … 1200 1204 } 1201 1205 1206 bool KHTMLParser::isHeaderTag(int _id) 1207 { 1208 switch (_id) { 1209 case ID_H1: 1210 case ID_H2: 1211 case ID_H3: 1212 case ID_H4: 1213 case ID_H5: 1214 case ID_H6: 1215 return true; 1216 default: 1217 return false; 1218 } 1219 } 1220 1221 void KHTMLParser::popNestedHeaderTag() 1222 { 1223 // This function only cares about checking for nested headers that have only inlines in between them. 1224 NodeImpl* currNode = current; 1225 for (HTMLStackElem* curr = blockStack; curr; curr = curr->next) { 1226 if (isHeaderTag(curr->id)) { 1227 popBlock(curr->id); 1228 return; 1229 } 1230 if (currNode && !currNode->isInline()) 1231 return; 1232 currNode = curr->node; 1233 } 1234 } 1235 1202 1236 bool KHTMLParser::isResidualStyleTag(int _id) 1203 1237 { -
trunk/WebCore/khtml/html/htmlparser.h
r5560 r7701 136 136 bool allowNestedRedundantTag(int _id); 137 137 138 static bool isHeaderTag(int _id); 139 void popNestedHeaderTag(); 140 138 141 ushort *forbiddenTag; 139 142
Note: See TracChangeset
for help on using the changeset viewer.