Changeset 189914 in webkit
- Timestamp:
- Sep 17, 2015, 8:51:08 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r189893 r189914 1 2015-09-17 Chris Dumez <cdumez@apple.com> 2 3 Range.deleteContents cannot delete DocType 4 https://bugs.webkit.org/show_bug.cgi?id=148773 5 <rdar://problem/22571280> 6 7 Reviewed by Ryosuke Niwa. 8 9 Rebaseline W3C DOM test now that more checks are passing. 10 11 * web-platform-tests/dom/ranges/Range-deleteContents-expected.txt: 12 1 13 2015-09-16 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-deleteContents-expected.txt
r189471 r189914 49 49 PASS Resulting DOM for range 22 [testDiv, 2, paras[4], 1] 50 50 PASS Resulting cursor position for range 22 [testDiv, 2, paras[4], 1] 51 FAIL Resulting DOM for range 23 [document, 0, document, 1] HierarchyRequestError: DOM Exception 3 52 FAIL Resulting cursor position for range 23 [document, 0, document, 1] undefined is not an object (evaluating 'actualRoots') 53 FAIL Resulting DOM for range 24 [document, 0, document, 2] HierarchyRequestError: DOM Exception 3 54 FAIL Resulting cursor position for range 24 [document, 0, document, 2] undefined is not an object (evaluating 'actualRoots') 51 PASS Resulting DOM for range 23 [document, 0, document, 1] 52 PASS Resulting cursor position for range 23 [document, 0, document, 1] 53 PASS Resulting DOM for range 24 [document, 0, document, 2] 54 PASS Resulting cursor position for range 24 [document, 0, document, 2] 55 55 PASS Resulting DOM for range 25 [comment, 2, comment, 3] 56 56 PASS Resulting cursor position for range 25 [comment, 2, comment, 3] -
trunk/Source/WebCore/ChangeLog
r189913 r189914 1 2015-09-17 Chris Dumez <cdumez@apple.com> 2 3 Range.deleteContents cannot delete DocType 4 https://bugs.webkit.org/show_bug.cgi?id=148773 5 <rdar://problem/22571280> 6 7 Reviewed by Ryosuke Niwa. 8 9 Range.deleteContents() was not able to delete a DocumentType Node, and 10 was throwing a HIERARCHY_REQUEST_ERR. The DOM specification does not 11 say we should throw in such case: 12 https://dom.spec.whatwg.org/#dom-range-deletecontents 13 14 However, Range.extractContents() should still throw an exception 15 if any of the contained children in a DocumentType Node: 16 https://dom.spec.whatwg.org/#concept-range-extract (Step 12) 17 18 No new tests, already covered by existing test. 19 20 * dom/Range.cpp: 21 (WebCore::Range::deleteContents): 22 (WebCore::Range::extractContents): 23 (WebCore::Range::checkDeleteExtract): 24 * dom/Range.h: 25 1 26 2015-09-17 Eric Carlson <eric.carlson@apple.com> 2 27 -
trunk/Source/WebCore/dom/Range.cpp
r189576 r189914 490 490 void Range::deleteContents(ExceptionCode& ec) 491 491 { 492 checkDeleteExtract( ec);492 checkDeleteExtract(Delete, ec); 493 493 if (ec) 494 494 return; … … 837 837 RefPtr<DocumentFragment> Range::extractContents(ExceptionCode& ec) 838 838 { 839 checkDeleteExtract( ec);839 checkDeleteExtract(Extract, ec); 840 840 if (ec) 841 841 return nullptr; … … 1335 1335 } 1336 1336 1337 void Range::checkDeleteExtract( ExceptionCode& ec)1337 void Range::checkDeleteExtract(ActionType action, ExceptionCode& ec) 1338 1338 { 1339 1339 ec = 0; … … 1347 1347 return; 1348 1348 } 1349 if (n->nodeType() == Node::DOCUMENT_TYPE_NODE) { 1349 1350 if (action == Extract && n->nodeType() == Node::DOCUMENT_TYPE_NODE) { 1350 1351 ec = HIERARCHY_REQUEST_ERR; 1351 1352 return; -
trunk/Source/WebCore/dom/Range.h
r189182 r189914 162 162 Node* checkNodeWOffset(Node*, int offset, ExceptionCode&) const; 163 163 void checkNodeBA(Node*, ExceptionCode&) const; 164 void checkDeleteExtract(ExceptionCode&);165 164 bool containedByReadOnly() const; 166 165 167 166 enum ActionType { Delete, Extract, Clone }; 167 void checkDeleteExtract(ActionType, ExceptionCode&); 168 168 RefPtr<DocumentFragment> processContents(ActionType, ExceptionCode&); 169 169 static RefPtr<Node> processContentsBetweenOffsets(ActionType, PassRefPtr<DocumentFragment>, Node*, unsigned startOffset, unsigned endOffset, ExceptionCode&);
Note:
See TracChangeset
for help on using the changeset viewer.