Changeset 66655 in webkit
- Timestamp:
- Sep 2, 2010 3:49:55 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66649 r66655 1 2010-09-01 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document 6 https://bugs.webkit.org/show_bug.cgi?id=44595 7 8 Spec links: 9 http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse 10 http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren 11 12 * fast/dom/Selection/script-tests/wrong-document-err.js: Added. 13 * fast/dom/Selection/wrong-document-err-expected.txt: Added. 14 * fast/dom/Selection/wrong-document-err.html: Added. 15 1 16 2010-09-02 Tony Gentilcore <tonyg@chromium.org> 2 17 -
trunk/WebCore/ChangeLog
r66653 r66655 1 2010-09-01 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Darin Adler. 4 5 DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document 6 https://bugs.webkit.org/show_bug.cgi?id=44595 7 8 Spec links: 9 http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse 10 http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren 11 12 Test: fast/dom/Selection/wrong-document-err.html 13 14 * page/DOMSelection.cpp: 15 (WebCore::DOMSelection::collapse): 16 (WebCore::DOMSelection::selectAllChildren): 17 1 18 2010-09-02 Eric Seidel <eric@webkit.org> 2 19 -
trunk/WebCore/page/DOMSelection.cpp
r66590 r66655 201 201 void DOMSelection::collapse(Node* node, int offset, ExceptionCode& ec) 202 202 { 203 if (!m_frame) 204 return; 203 Document* selectionDocument = m_frame ? m_frame->document() : 0; 204 Document* nodeDocument = node ? node->document() : 0; 205 206 if (selectionDocument != nodeDocument) { 207 ec = WRONG_DOCUMENT_ERR; 208 return; 209 } 205 210 206 211 if (offset < 0) { … … 208 213 return; 209 214 } 215 216 if (!m_frame) 217 return; 210 218 211 219 if (!isValidForPosition(node)) … … 489 497 return; 490 498 499 Document* selectionDocument = m_frame ? m_frame->document() : 0; 500 501 if (selectionDocument != n->document()) { 502 ec = WRONG_DOCUMENT_ERR; 503 return; 504 } 505 491 506 // This doesn't (and shouldn't) select text node characters. 492 507 setBaseAndExtent(n, 0, n, n->childNodeCount(), ec);
Note: See TracChangeset
for help on using the changeset viewer.