Closed
Bug 1074736
Opened 10 years ago
Closed 10 years ago
[Text Selection] Selection carets should consider multiple ranges selection
Categories
(Core :: DOM: Selection, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: mtseng, Assigned: mtseng)
References
Details
Attachments
(3 files, 9 obsolete files)
3.17 KB,
patch
|
mdas
:
review+
|
Details | Diff | Splinter Review |
10.47 KB,
patch
|
Details | Diff | Splinter Review | |
6.40 KB,
patch
|
Details | Diff | Splinter Review |
In Bug 739396, we split a range to multiple ranges if selection content contains some non-selectable element. In this case, selection carets should support multiple ranges as well.
Assignee | ||
Comment 1•10 years ago
|
||
This is wip for supporting multiple range. The idea is using first range to show start caret and using last range to show end caret. roc, could you give some feedback about this patch? thanks.
Attachment #8497389 -
Flags: feedback?(roc)
Updated•10 years ago
|
Priority: -- → P1
Comment on attachment 8497389 [details] [diff] [review] wip:multiple-range Review of attachment 8497389 [details] [diff] [review]: ----------------------------------------------------------------- Seems like a reasonable thing to do if we don't plan to have UX for multiple ranges.
Attachment #8497389 -
Flags: feedback?(roc) → feedback+
Assignee | ||
Comment 3•10 years ago
|
||
Ready for review!
Attachment #8497389 -
Attachment is obsolete: true
Attachment #8507631 -
Flags: review?(roc)
Assignee | ||
Comment 4•10 years ago
|
||
Rebased.
Attachment #8507631 -
Attachment is obsolete: true
Attachment #8507631 -
Flags: review?(roc)
Attachment #8507679 -
Flags: review?(roc)
Comment on attachment 8507679 [details] [diff] [review] bug1074736 v2 Review of attachment 8507679 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/SelectionCarets.cpp @@ +389,5 @@ > return; > } > > + int32_t rangeCount = selection->GetRangeCount(); > + if (rangeCount <= 0) { A collapsed selection must have at least one range, so you can take this check out. @@ +395,5 @@ > return; > } > > + nsRefPtr<nsRange> rangeStart = selection->GetRangeAt(0); > + nsRefPtr<nsRange> rangeEnd = selection->GetRangeAt(rangeCount - 1); Call these firstRange, lastRange. rangeStart sounds like the start of a range.
Attachment #8507679 -
Flags: review?(roc) → review+
This needs tests.
Assignee | ||
Comment 7•10 years ago
|
||
Fix addressed comment. try push: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=b918d73c5c22 I'll attach new testcase for this bug later.
Attachment #8507679 -
Attachment is obsolete: true
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8509245 -
Flags: feedback?(tlin)
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8509246 -
Flags: feedback?(tlin)
Comment 10•10 years ago
|
||
Comment on attachment 8509245 [details] [diff] [review] Marionette test part 1: selection_rect_list should consider multiple range as well Review of attachment 8509245 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/marionette/client/marionette/selection.py @@ +77,1 @@ > '''Return the selection's DOMRectList object. Please update the document. '''Returns the selection's DOMRectList object for the range at given idx.''' @@ +77,5 @@ > '''Return the selection's DOMRectList object. > > If the element is either <input> or <textarea>, return the selection's > DOMRectList within the element. Otherwise, return the DOMRectList of the > current selection. Ditto.
Attachment #8509245 -
Flags: feedback?(tlin) → feedback+
Comment 11•10 years ago
|
||
Comment on attachment 8509246 [details] [diff] [review] Marionette test part 2: Marionette tests for selection carets with multiple range support Review of attachment 8509246 [details] [diff] [review]: ----------------------------------------------------------------- Selection Carets should support multiple range in non-editable fields. How about we just name the files test_selectioncarets_noneditable.py and test_selectioncarets_noneditable.html? ::: layout/base/tests/marionette/test_selectioncarets_multiplerange.py @@ +37,5 @@ > + self._nonsel1 = self.marionette.find_element(By.ID, 'nonsel1') > + > + def _long_press_without_contextmenu(self, el, x, y): > + return self.actions.press(el, x, y).move_by_offset(0, 0).\ > + wait(self._long_press_time).release() Perhaps marionette should support a mechanism for this. Reviewer in ateam might have some ideas. :-)
Attachment #8509246 -
Flags: feedback?(tlin) → feedback+
Assignee | ||
Comment 12•10 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC+8) from comment #11) > Comment on attachment 8509246 [details] [diff] [review] > Marionette test part 2: Marionette tests for selection carets with multiple > range support > > Review of attachment 8509246 [details] [diff] [review]: > ----------------------------------------------------------------- > > Selection Carets should support multiple range in non-editable fields. How > about we just name the files test_selectioncarets_noneditable.py and > test_selectioncarets_noneditable.html? This test is only for multiple range. I'll add tests for non-editable fields in another bug. > > ::: layout/base/tests/marionette/test_selectioncarets_multiplerange.py > @@ +37,5 @@ > > + self._nonsel1 = self.marionette.find_element(By.ID, 'nonsel1') > > + > > + def _long_press_without_contextmenu(self, el, x, y): > > + return self.actions.press(el, x, y).move_by_offset(0, 0).\ > > + wait(self._long_press_time).release() > > Perhaps marionette should support a mechanism for this. Reviewer in ateam > might have some ideas. :-)
Assignee | ||
Comment 13•10 years ago
|
||
Fix addressed comment.
Attachment #8509245 -
Attachment is obsolete: true
Attachment #8510021 -
Flags: review?(mdas)
Assignee | ||
Updated•10 years ago
|
Attachment #8509246 -
Flags: review?(mdas)
Updated•10 years ago
|
Attachment #8510021 -
Flags: review?(mdas) → review+
Comment 14•10 years ago
|
||
Comment on attachment 8509246 [details] [diff] [review] Marionette test part 2: Marionette tests for selection carets with multiple range support Review of attachment 8509246 [details] [diff] [review]: ----------------------------------------------------------------- r+ provided it passes in b2g. You should run this against try's emulators just to make sure. If it doesn't, then add b2g = false to the manifest entry
Attachment #8509246 -
Flags: review?(mdas) → review+
Comment 15•10 years ago
|
||
Comment on attachment 8509246 [details] [diff] [review] Marionette test part 2: Marionette tests for selection carets with multiple range support Review of attachment 8509246 [details] [diff] [review]: ----------------------------------------------------------------- I missed this question ::: layout/base/tests/marionette/test_selectioncarets_multiplerange.py @@ +37,5 @@ > + self._nonsel1 = self.marionette.find_element(By.ID, 'nonsel1') > + > + def _long_press_without_contextmenu(self, el, x, y): > + return self.actions.press(el, x, y).move_by_offset(0, 0).\ > + wait(self._long_press_time).release() Are you trying to press something without the context menu event being fired?
Assignee | ||
Comment 17•10 years ago
|
||
Fix test fail on b2g. try run: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=a6dd9d3f12c6
Attachment #8509246 -
Attachment is obsolete: true
Assignee | ||
Comment 18•10 years ago
|
||
(In reply to Malini Das [:mdas] from comment #15) > Comment on attachment 8509246 [details] [diff] [review] > Marionette test part 2: Marionette tests for selection carets with multiple > range support > > Review of attachment 8509246 [details] [diff] [review]: > ----------------------------------------------------------------- > > I missed this question > > ::: layout/base/tests/marionette/test_selectioncarets_multiplerange.py > @@ +37,5 @@ > > + self._nonsel1 = self.marionette.find_element(By.ID, 'nonsel1') > > + > > + def _long_press_without_contextmenu(self, el, x, y): > > + return self.actions.press(el, x, y).move_by_offset(0, 0).\ > > + wait(self._long_press_time).release() > > Are you trying to press something without the context menu event being fired? Yes, according to the code at marionette-listener.js, we'll send context menu event when isTap is true. So I made a workaround here let it move by offset with (0, 0) so isTap status would be reset after this move and then context menu won't be fired.
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 19•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/141ea70b1caf https://hg.mozilla.org/integration/mozilla-inbound/rev/b1ab04e807c3 https://hg.mozilla.org/integration/mozilla-inbound/rev/5b1f330c9298
Keywords: checkin-needed
Comment 20•10 years ago
|
||
sorry had to back this out for test failures on windows like https://treeherder.mozilla.org/ui/logviewer.html#?job_id=3282505&repo=mozilla-inbound
Flags: needinfo?(mtseng)
Assignee | ||
Comment 21•10 years ago
|
||
Fix windows failure. This failure is because "select word" action on window would select extra tail space so our testcase would failed. So I strip space before doing test. Try run: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=7ac982300815
Attachment #8510843 -
Attachment is obsolete: true
Flags: needinfo?(mtseng)
Assignee | ||
Comment 22•10 years ago
|
||
Considering line ending different on all platforms. new try: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=15bf4d03b0ee
Attachment #8511762 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 23•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6e0a13090cd8 https://hg.mozilla.org/integration/mozilla-inbound/rev/f43962d6b41e https://hg.mozilla.org/integration/mozilla-inbound/rev/94c5f5317e4b
Keywords: checkin-needed
Comment 24•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6e0a13090cd8 https://hg.mozilla.org/mozilla-central/rev/f43962d6b41e https://hg.mozilla.org/mozilla-central/rev/94c5f5317e4b
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment 25•10 years ago
|
||
Backed out for causing frequent carat-related Marionette failures. https://hg.mozilla.org/integration/mozilla-inbound/rev/e17c9722713b https://treeherder.mozilla.org/ui/logviewer.html#?job_id=540335&repo=mozilla-central https://treeherder.mozilla.org/ui/logviewer.html#?job_id=539150&repo=mozilla-central https://treeherder.mozilla.org/ui/logviewer.html#?job_id=3326139&repo=mozilla-inbound https://treeherder.mozilla.org/ui/logviewer.html#?job_id=711831&repo=b2g-inbound https://treeherder.mozilla.org/ui/logviewer.html#?job_id=1006929&repo=fx-team https://treeherder.mozilla.org/ui/logviewer.html#?job_id=1007524&repo=fx-team
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla36 → ---
Assignee | ||
Comment 26•10 years ago
|
||
This patch should fix the problem. try run: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=efeddcc1b9c8
Attachment #8511784 -
Attachment is obsolete: true
Comment 28•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb1c7fef9214 https://hg.mozilla.org/integration/mozilla-inbound/rev/3863e1d10b69 https://hg.mozilla.org/integration/mozilla-inbound/rev/7ce56791b0b7
Keywords: checkin-needed
Comment 29•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/fb1c7fef9214 https://hg.mozilla.org/mozilla-central/rev/3863e1d10b69 https://hg.mozilla.org/mozilla-central/rev/7ce56791b0b7
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•