RESOLVED LATER Bug 44595
DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document
https://bugs.webkit.org/show_bug.cgi?id=44595
Summary DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT...
Andreas Kling
Reported 2010-08-25 02:37:04 PDT
Selection.collapse() and Selection.selectAllChildren() should throw WRONG_DOCUMENT_ERR if the input node doesn't belong to the same document at the Selection. This would cause us to pass the following test on IE Test Center: http://samples.msdn.microsoft.com/ietestcenter/html5/selection/selection_wrongDocErr.htm Spec links: http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren
Attachments
Proposed patch (5.71 KB, patch)
2010-08-25 02:43 PDT, Andreas Kling
no flags
Andreas Kling
Comment 1 2010-08-25 02:43:17 PDT
Created attachment 65387 [details] Proposed patch
Alexey Proskuryakov
Comment 2 2010-08-25 09:58:00 PDT
Do these raise an exception in Firefox? Raising exceptions where we didn't use to can be a significant compatibility issue, because if any page depended on the old behavior, it often stops working completely.
Andreas Kling
Comment 3 2010-08-25 10:04:28 PDT
(In reply to comment #2) > Do these raise an exception in Firefox? No, only IE9 implements this behavior so far AFAIK.
Antonio Gomes
Comment 4 2010-08-25 23:05:43 PDT
Comment on attachment 65387 [details] Proposed patch Gerally it also looks good to me. We need to find out the impact of such a change in existing web contents, witch is hard :-(
Darin Adler
Comment 5 2010-08-29 11:44:24 PDT
Comment on attachment 65387 [details] Proposed patch > + const Document* selectionDocument = m_frame ? m_frame->document() : 0; > + const Document* nodeDocument = node ? node->document() : 0; The const here does no good. > + const Document* selectionDocument = m_frame ? m_frame->document() : 0; Same here. Iā€™d like this even better if the regression test covered the null frame and null node cases. I can't tell if it does. r=me
Andreas Kling
Comment 6 2010-09-02 03:50:39 PDT
WebKit Review Bot
Comment 7 2010-09-02 04:37:24 PDT
http://trac.webkit.org/changeset/66655 might have broken Leopard Intel Release (Tests)
Andreas Kling
Comment 8 2010-09-02 04:49:49 PDT
Reopening due to editing test breakage.
Alexey Proskuryakov
Comment 9 2010-09-08 13:34:50 PDT
What is the status of this bug? The patch been rolled out, correct? See also: https://bugzilla.mozilla.org/show_bug.cgi?id=418755.
Andreas Kling
Comment 10 2010-09-08 13:40:21 PDT
(In reply to comment #9) > What is the status of this bug? The patch been rolled out, correct? > > See also: https://bugzilla.mozilla.org/show_bug.cgi?id=418755. It was rolled out indeed (with r66661) Interesting link, I'll close this. We can revisit the issue at a later time.
Note You need to log in before you can comment on or make changes to this bug.