RESOLVED FIXED 89918
[Shadow] Triggers assertion in VisibleSelection::adjustSelectionToAvoidCrossingBoundaries()
https://bugs.webkit.org/show_bug.cgi?id=89918
Summary [Shadow] Triggers assertion in VisibleSelection::adjustSelectionToAvoidCrossi...
Shinya Kawanaka
Reported 2012-06-25 16:06:17 PDT
Select from "SHADOW BEFORE" to "This is not Shadow DOM". It triggers an assertion in VisibleSelection::adjustSelectionToAvoidCrossingBoundaries().
Attachments
Repro (5.52 KB, text/html)
2012-06-25 16:07 PDT, Shinya Kawanaka
no flags
Patch (9.33 KB, patch)
2012-06-26 10:25 PDT, Shinya Kawanaka
no flags
Patch (3.55 KB, patch)
2012-06-27 10:00 PDT, Shinya Kawanaka
no flags
Patch for landing (3.26 KB, patch)
2012-06-27 10:13 PDT, Shinya Kawanaka
no flags
Shinya Kawanaka
Comment 1 2012-06-25 16:07:03 PDT
Shinya Kawanaka
Comment 2 2012-06-25 17:34:53 PDT
I've investigated this bug. This is actually a bug of comparePositions(). In this test case, we have a call comparePosition(a, b) where deprecatedNode() and deprecatedEditingOffset() of a and b are the same but anchoryType() of a and b are different. It's time to fix comparePosition() correctly.... We have to fix Bug 54535 issue. As I mentioned in the issue, I would like to have an alternative version of comparePosition that distinguishes "position after img" from "position before br" (See the Bug 54535 comment). To compare m_start and m_end, we should use the alternative version, I believe.
Shinya Kawanaka
Comment 3 2012-06-26 10:25:27 PDT
Shinya Kawanaka
Comment 4 2012-06-26 10:27:22 PDT
Let me try to introduce PositionComparisonFineness to comparePosition(). I hope this patch does not degrade any tests. We should argue we're going on the right way or not though...
Ryosuke Niwa
Comment 5 2012-06-26 21:29:02 PDT
Comment on attachment 149556 [details] Patch This patch is obsolete now after http://trac.webkit.org/changeset/121303
Shinya Kawanaka
Comment 6 2012-06-27 09:18:15 PDT
After http://trac.webkit.org/changeset/121303, this assertion is not triggered anymore. Let mark this as INVALID.
Ryosuke Niwa
Comment 7 2012-06-27 09:38:39 PDT
Do we have a test case that we can add?
Shinya Kawanaka
Comment 8 2012-06-27 09:45:59 PDT
(In reply to comment #7) > Do we have a test case that we can add? Yes. I'll upload a patch to add a testcase.
Ryosuke Niwa
Comment 9 2012-06-27 09:55:37 PDT
(In reply to comment #8) > (In reply to comment #7) > > Do we have a test case that we can add? > > Yes. I'll upload a patch to add a testcase. Great. Because of the inherent complexity, it's crucial for us to add more tests for bugs like this :)
Shinya Kawanaka
Comment 10 2012-06-27 10:00:04 PDT
Ryosuke Niwa
Comment 11 2012-06-27 10:04:13 PDT
Comment on attachment 149769 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=149769&action=review > LayoutTests/ChangeLog:12 > + However, we don't have any test case of selection from Shadow DOM to elements outside of shadow host. > + So let's add a testcase here. I don't think you need to mention this. It's pretty obvious that the reason we're adding a regression test is because we hadn't had one already. > LayoutTests/editing/shadow/breaking-editing-boundaries-2.html:6 > +<script src="../../fast/dom/resources/event-sender-util.js"></script> > +<script src="../../fast/js/resources/js-test-pre.js"></script> I don't think you need a event-sender-util.js here. You're not using any functions in there. Also, I don't see a point in making this a script test. You're not using any features in there. > LayoutTests/editing/shadow/breaking-editing-boundaries-2.html:14 > + <div id="host">host</div> > + <div id="dst">after host</div> Please spell out destination. > LayoutTests/editing/shadow/breaking-editing-boundaries-2.html:29 > +var src = shadowRoot.getElementById('src'); > +var dst = document.getElementById('dst'); Ditto about spelling out source and destination. > LayoutTests/editing/shadow/breaking-editing-boundaries-2.html:37 > + container.innerHTML = "PASS"; This is sufficient without any of js-test-*.js files.
Shinya Kawanaka
Comment 12 2012-06-27 10:13:22 PDT
Created attachment 149772 [details] Patch for landing
WebKit Review Bot
Comment 13 2012-06-27 10:48:40 PDT
Comment on attachment 149772 [details] Patch for landing Clearing flags on attachment: 149772 Committed r121350: <http://trac.webkit.org/changeset/121350>
WebKit Review Bot
Comment 14 2012-06-27 10:48:49 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.