Closed Bug 1052246 Opened 10 years ago Closed 10 years ago

[Text Selection] Position of utility bubble is wrong in b2g desktop

Categories

(Core :: DOM: Selection, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: mtseng, Assigned: mtseng)

References

Details

Attachments

(1 file, 3 obsolete files)

Utility bubbles are not shown in b2g desktop. After some debugging, I found that the position of bubbles are always wrong.
Attached patch bug1052246 (obsolete) — Splinter Review
I found 2 problems cause this bug.

1. In b2g-desktop, mozInnerScreen is "actual" window position. So that we will get incorrect value in b2g-desktop. So I subtract "window.mozInnerScreen" to get the correct window offset.

2. Since shell.js handle the offsets of <iframe mozbrowser> boundary [1], we shouldn't add <iframe mozbrowser> offsets to rect in BrowserElementChildPreload.js [2]. So I modified it to not cross <iframe mozbrowser> boundary.

After those 2 modifications, utility bubbles show correctly.

[1]: http://dxr.mozilla.org/mozilla-central/source/b2g/chrome/content/shell.js#524
[2]: http://dxr.mozilla.org/mozilla-central/source/dom/browser-element/BrowserElementChildPreload.js#651
Attachment #8471321 - Flags: review?(fabrice)
Summary: [Text Selection] Utility bubble is wrong in b2g desktop → [Text Selection] Position of utility bubble is wrong in b2g desktop
Comment on attachment 8471321 [details] [diff] [review]
bug1052246

Review of attachment 8471321 [details] [diff] [review]:
-----------------------------------------------------------------

Makes sense, thanks!

::: dom/browser-element/BrowserElementChildPreload.js
@@ +643,5 @@
>        reasons: e.reasons,
>        isCollapsed: (e.selectedText.length == 0),
>      };
>  
> +    // Get correct geometry information if we have nested iframe

nit: full stop at the end of comment.
Attachment #8471321 - Flags: review?(fabrice) → review+
Rebased.
Attachment #8472102 - Attachment is obsolete: true
oops uploaded wrong patch...
Upload correct patch.
Attachment #8472766 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/3723f4d7eab5
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: