Closed Bug 1049367 Opened 8 years ago Closed 8 years ago

[Text Selection] We should remove fake pressing function from js marionette


(Firefox OS Graveyard :: Gaia::System::Window Mgmt, defect, P1)



(Not tracked)



(Reporter: gduan, Assigned: gduan)



(Whiteboard: [p=3])


(1 file, 1 obsolete file)

We should remove press function in faketextselectionapp.js since gecko has landed.
Assignee: nobody → gduan
Whiteboard: [p=3]
Target Milestone: --- → 2.1 S2 (15aug)
Set dependency on bug 1052246, since the position reported by b2g-desktop is not correct.
Attached file PR to master (obsolete) —
Although bug 1052246 has been resolved, current available b2g still not work well since the position is not correct.
set ni to Morris.
Flags: needinfo?(mtseng)
Priority: -- → P1
Summary: [Text Selection] update press method since gecko has landed → [Text Selection] The position reported by b2g-desktop is not correct
Summary: [Text Selection] The position reported by b2g-desktop is not correct → [Text Selection] The zoomfactor reported by b2g-desktop is not correct
Hi TingYu,

I just found out that the zoomfactor that reported from gecko is not correct. And the value is different by screen type ... that's why cause my calculation not correct. 

you can test with my commit and check the zoom value,

I'm not sure if DEBUG=1 would fix this zoomFactor issue. We'll set prefs as below when DEBUG=1.
Flags: needinfo?(tlin)
I've just found that DEBUG=1 has docshell.device_size_is_page_size=true. The zoomfactor is correct when the pref is on. Investigating for the cause.

Hi George,

The zoomFactor in gecko in calculated here [1].

Currently, Gaia non-debug build running on B2G Desktop does not set docshell.device_size_is_page_size to true, so the screen.width will be the real device size (mine is 1280), not the width of the B2G desktop (320). I think we should set "this.userPrefs['docshell.device_size_is_page_size'] = true;" in [2] for B2G Desktop to make the screen.width correct.

Flags: needinfo?(tlin)
Flags: needinfo?(mtseng)
Flags: needinfo?(gduan)
Depends on: 1063266
Flags: needinfo?(gduan)
Update the title.

This bug still dep on bug 1063266, the displaying keyboard will trigger the app window resizing.
Summary: [Text Selection] The zoomfactor reported by b2g-desktop is not correct → [Text Selection] We should remove fake pressing function from js marionette
Target Milestone: 2.1 S2 (15aug) → ---

I add below three prefs for comment 5, enable selectioncaret and disable keyboard.
      'selectioncaret.enabled': true,
      'dom.mozInputMethod.enabled': false,
      'docshell.device_size_is_page_size': true

However, after longPress is called from marionette, there's no mouseup reason from selectionchange event...I'm not sure the reason yet. 

Long press contains press, wait and release cmd and there should be a mouseup after release.
I only saw log as below....

[marionette log] app:// [Dump: TextSelectionDialog]"{\"rect\":{\"width\":81.01666259765625,\"height\":14,\"top\":235,\"bottom\":249,\"left\":87,\"right\":168.01666259765625},\"commands\":{\"canSelectAll\":true,\"canCut\":true,\"canCopy\":true,\"canPaste\":true},\"zoomFactor\":1,\"reasons\":[\"drag\",\"mousedown\"],\"isCollapsed\":false,\"msg_name\":\"selectionchange\",\"offsetX\":0,\"offsetY\":0}"
[marionette log] app:// [Dump: TextSelectionDialog]"on receive selection change event"
[marionette log] app:// [Dump: TextSelectionDialog]"{\"rect\":{\"width\":81.01666259765625,\"height\":14,\"top\":235,\"bottom\":249,\"left\":87,\"right\":168.01666259765625},\"commands\":{\"canSelectAll\":true,\"canCut\":true,\"canCopy\":true,\"canPaste\":true},\"zoomFactor\":1,\"reasons\":[],\"isCollapsed\":false,\"msg_name\":\"selectionchange\",\"offsetX\":0,\"offsetY\":0}"
Depends on: 1067728
Attached file PR to master
Hi Alive,
could you review this patch? I made some changes as below
1. change position of top-left and top-right input element, because click event doesn't work if top=0 with js-marionette
2. change size of input, to make sure the bubble will show on the rightest side
3. tap on the dom before long-pressing, in order to launch the keyboard in case bubble is hidden after window resizing
4. add 'docshell.device_size_is_page_size': true
Attachment #8473529 - Attachment is obsolete: true
Attachment #8537608 - Flags: review?(alive)
Attachment #8537608 - Flags: review?(alive) → review+
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.