Changeset 31090 in webkit
- Timestamp:
- Mar 16, 2008, 8:50:33 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r31089 r31090 1 2008-03-16 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Darin. 4 5 - test for "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)" 6 http://bugs.webkit.org/show_bug.cgi?id=17509 7 8 * fast/dom/Range/acid3-surround-contents-expected.txt: Added. 9 * fast/dom/Range/acid3-surround-contents.html: Added. 10 1 11 2008-03-16 Marvin Decker <marv.decker@gmail.com> 2 12 -
trunk/WebCore/ChangeLog
r31089 r31090 1 2008-03-16 Maciej Stachowiak <mjs@apple.com> 2 3 Reviewed by Darin. 4 5 - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)" 6 http://bugs.webkit.org/show_bug.cgi?id=17509 7 8 This gets us to 92/100 9 10 * dom/Range.cpp: 11 (WebCore::Range::surroundContents): Check for 12 HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3 13 expects exceptional conditions to be tested in the order that the 14 spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If 15 the start point of the range is in a comment node, the node that 16 would be the parent of a partial replacement is actually the 17 comment node's parent (since comment nodes have character 18 indices), so we should do the HIERARCHY_REQUEST_ERR check based on 19 the parent of the comment node, as for text nodes, even though it 20 will fail later with a different exception because it is not 21 allowed to surround a partially selected non-text node. 22 1 23 2008-03-16 Marvin Decker <marv.decker@gmail.com> 2 24 -
trunk/WebCore/dom/Range.cpp
r31075 r31090 1406 1406 } 1407 1407 1408 // Raise a HIERARCHY_REQUEST_ERR if m_start.container doesn't accept children like newParent. 1409 Node* parentOfNewParent = m_start.container.get(); 1410 1411 // If m_start.container is a character data node, it will be split and it will be its parent that will 1412 // need to accept newParent (or in the case of a comment, it logically "would" 1413 if (parentOfNewParent->isCharacterDataNode()) 1414 parentOfNewParent = parentOfNewParent->parentNode(); 1415 if (!parentOfNewParent->childTypeAllowed(newParent->nodeType())) { 1416 ec = HIERARCHY_REQUEST_ERR; 1417 return; 1418 } 1419 1420 if (m_start.container == newParent || m_start.container->isDescendantOf(newParent.get())) { 1421 ec = HIERARCHY_REQUEST_ERR; 1422 return; 1423 } 1424 1425 // FIXME: Do we need a check if the node would end up with a child node of a type not 1426 // allowed by the type of node? 1427 1408 1428 // BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a non-Text node. 1409 1429 if (m_start.container->nodeType() != Node::TEXT_NODE) { … … 1419 1439 } 1420 1440 } 1421 1422 // Raise a HIERARCHY_REQUEST_ERR if m_start.container doesn't accept children like newParent.1423 Node* parentOfNewParent = m_start.container.get();1424 // If m_start.container is a textNode, it will be split and it will be its parent that will1425 // need to accept newParent.1426 if (parentOfNewParent->isTextNode())1427 parentOfNewParent = parentOfNewParent->parentNode();1428 if (!parentOfNewParent->childTypeAllowed(newParent->nodeType())) {1429 ec = HIERARCHY_REQUEST_ERR;1430 return;1431 }1432 1433 if (m_start.container == newParent || m_start.container->isDescendantOf(newParent.get())) {1434 ec = HIERARCHY_REQUEST_ERR;1435 return;1436 }1437 1438 // FIXME: Do we need a check if the node would end up with a child node of a type not1439 // allowed by the type of node?1440 1441 1441 1442 ec = 0;
Note:
See TracChangeset
for help on using the changeset viewer.