Closed
Bug 1179090
Opened 9 years ago
Closed 9 years ago
ContentEventHandler should assume that the selection range is [0-0] when there is not selection range
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.77 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
When WidgetQueryContentEvent queries the whole contents of the document, there may be no selection range. In such case, ContentEventHandler should assume that there is a selection range [0-0].
Assignee | ||
Comment 1•9 years ago
|
||
See comment 0 and the comment in this patch for the detail.
Attachment #8628576 -
Flags: review?(bugs)
Comment 2•9 years ago
|
||
Comment on attachment 8628576 [details] [diff] [review]
Patch
>+ if (!mSelection->RangeCount()) {
>+ // If there is no selection range, we should compute the selection root
>+ // with ancestor limiter and root content of the document.
compute the selection root from ancestor limiter or root content of the document
(I think)
>+ rv = mSelection->GetAncestorLimiter(getter_AddRefs(mRootContent));
>+ if (NS_WARN_IF(NS_FAILED(rv))) {
>+ return NS_ERROR_FAILURE;
>+ }
>+ if (!mRootContent) {
>+ mRootContent = mPresShell->GetDocument()->GetRootElement();
>+ if (NS_WARN_IF(!mRootContent)) {
>+ // Although, this is possible in XML/XHTML document. However,
>+ // ContentEventHandler won't support such rare case for now.
HTML documents may not have root element after
document.removeChild(document.documentElement);
So, perhaps just drop the comment.
Attachment #8628576 -
Flags: review?(bugs) → review+
Comment 4•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•