Closed Bug 1124566 Opened 7 years ago Closed 7 years ago

[TextSelection] The location button & menu icon in google map can be selected

Categories

(Core :: DOM: Selection, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gchang, Unassigned)

References

Details

Attachments

(6 files)

### Steps:
1. Type google map in rocket bar
2. Select Google Maps
3. Long press on locate button
4. Long press on menu in upper-left corner

### Expected:
1. The locate button & menu icon should not be selectable.

### Actual:
1. The locate button is selected and utility bubble shows up.
2. The menu icon is selected and utility bubble shows up.

### Reproduce rate
always

### Version:
Gaia-Rev        f5b3d1b6cfa3e702033f613915ae637cb735cbfb
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/bccee1a13ba6
Build-ID        20150119002502
Version         37.0a2
Device-Name     flame
FW-Release      4.4.2
QA Whiteboard: [textselection]
Broken new feature nominated as 2.2?
Blocks: CopyPasteGaia
No longer blocks: CopyPasteLegacy
blocking-b2g: --- → 2.2?
Whiteboard: [systemsfe]
Whiteboard: [systemsfe]
QA Whiteboard: [textselection] → [COM=Text Selection]
In most cases, the behavior of copypaste bubble would be the same as desktop, so we'll expect web page's owner to set the attribute to element which he don't want it be copiable or cuttable.

In this case, the button only have background-image and no content. I think it should be not selectable as desktop does. 

Morris, what do you think?
Flags: needinfo?(mtseng)
Blocks: CopyPasteLegacy
No longer blocks: CopyPasteGaia
Component: Gaia::System → Selection
Product: Firefox OS → Core
Assignee: nobody → jeremychen
(In reply to George Duan [:gduan] [:喬智] from comment #5)
> In most cases, the behavior of copypaste bubble would be the same as
> desktop, so we'll expect web page's owner to set the attribute to element
> which he don't want it be copiable or cuttable.
> 
> In this case, the button only have background-image and no content. I think
> it should be not selectable as desktop does. 
> 
> Morris, what do you think?

Hi George,
I run a test both on device and desktop browser. (I'll upload screenshots later.) It seems that a div with only background-image and no content can be selected on both device and desktop browser. You can turn on caret preference on browser and give it a try. The main difference is that, on browser, the div is indeed selected but its background-color is not changed. Since caret is default disable on browser, it looks like the div is not selected.
Flags: needinfo?(mtseng)
I dumped the frame tree of [1]-[2] as follows:
===================
I/Gecko   ( 1951): Viewport(-1)@b3cef2b8 [view=b3cc7060] {0,0,19200,32360} [state=0002062000002230] [sc=b3cef088:-moz-viewport^0]<
I/Gecko   ( 1951):   HTMLScroll(html)(-1)@b3cef930 {0,0,19200,32360} [state=0000000000000010] [content=b3344ee0] [sc=b3cef4f8:-moz-viewport-scroll]<
I/Gecko   ( 1951):     ScrollbarFrame(scrollbar)(-1)@b3ceff78 next=b3cfccc8 {0,32360,19200,0} [state=0000108080c80000] [content=b3cc7e20] [sc=b3cf02d8]<
I/Gecko   ( 1951):       SliderFrame(slider)(-1)@b3cfc010 next=b3cfc7a8 {0,0,18720,360} [state=0000100080c00000] [content=b3cfb1a0] [sc=b3cfc300]<
I/Gecko   ( 1951):         ButtonBoxFrame(thumb)(0)@b3cfc5b0 {0,0,18160,360} [state=2000100080400000] [content=b3cfb240] [sc=b3cfd788]<>
I/Gecko   ( 1951):       >
I/Gecko   ( 1951):       ButtonBoxFrame(scrollbarbutton)(-1)@b3cfc7a8 {18720,0,480,360} [state=2000100080c00000] [content=b3cfb2e0] [sc=b3cefd48]<>
I/Gecko   ( 1951):     >
I/Gecko   ( 1951):     ScrollbarFrame(scrollbar)(-1)@b3cfccc8 next=b3c1e380 {19200,0,0,32360} [state=0000100080880000] [content=b3cc7e70] [sc=b3cfced8]<
I/Gecko   ( 1951):       SliderFrame(slider)(-1)@b3cfd980 next=b3c1e010 {0,0,360,31880} [state=0000100080800000] [content=b3cfb420] [sc=b3c216a0]<
I/Gecko   ( 1951):         ButtonBoxFrame(thumb)(0)@b3cfde08 {0,0,360,30840} [state=2000100080000000] [content=b3cfb470] [sc=b3c1f6c8]<>
I/Gecko   ( 1951):       >
I/Gecko   ( 1951):       ButtonBoxFrame(scrollbarbutton)(-1)@b3c1e010 {0,31880,360,480} [state=2000100080c00000] [content=b3cfb510] [sc=b3cfca88]<>
I/Gecko   ( 1951):     >
I/Gecko   ( 1951):     Box(scrollcorner)(-1)@b3c1e380 next=b3cef728 {19200,32360,0,0} [state=0000100080c00200] [content=b3cc7f10] [sc=b3c1e108]<>
I/Gecko   ( 1951):     Canvas(html)(-1)@b3cef728 {0,0,19200,32360} vis-overflow=0,0,19680,33320 scr-overflow=0,0,19680,33320 [state=0000006000000220] [content=b3344ee0] [sc=b3c1e490:-moz-scrolled-canvas]<
I/Gecko   ( 1951):       Block(html)(-1)@b3c1e820 next=b3c1fc28 {0,0,19200,32360} vis-overflow=0,0,19680,33320 scr-overflow=0,0,19680,33320 [state=0000100008d00220] [content=b3344ee0] [sc=b3c1e730^0]<
I/Gecko   ( 1951):         line b3c1f320: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x8] bm=480 {480,480,19200,32360} {480,480,19200,32360;cw=19200} <
I/Gecko   ( 1951):           HTMLScroll(body)(2)@b3c1ef98 {480,480,19200,32360} [state=0000004000000010] [content=b3cc7d80] [sc=b3c1ecc8]<
I/Gecko   ( 1951):             Block(body)(2)@b3c1f258 {0,0,19200,32360} [state=0000100000d00210] [content=b3cc7d80] [sc=b3c1ee78:-moz-scrolled-content]<
I/Gecko   ( 1951):               line b3c21ea0: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x108] bm=960 {0,960,19200,1160} {0,960,19200,1160;cw=19200} <
I/Gecko   ( 1951):                 Block(p)(1)@b3c21c80 next=b3c21e40 {0,960,19200,1160} [state=0000100000100200] [content=b3cfba60] [sc=b3c218c0^b3c1ecc8^b3c1e730^0]<
I/Gecko   ( 1951):                   line b3c21d88: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {0,0,6360,1160} {0,0,6360,1160;cw=19200} <
I/Gecko   ( 1951):                     Text(0)"Implement me"@b3c21d40 {0,20,6360,1120} [state=80000040b0600010] [content=b3cd5c80] [sc=b3c21ce0:-moz-non-element] [run=b322bc80][0,12,T]  SELECTED
I/Gecko   ( 1951):                   >
I/Gecko   ( 1951):                 >
I/Gecko   ( 1951):               >
I/Gecko   ( 1951):               line b3c21ed8: count=1 state=block,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x8] {0,3080,3000,3000} {0,3080,3000,3000;cw=19200} <
I/Gecko   ( 1951):                 Block(div)(3)@b3c21e40 {0,3080,3000,3000} [state=000010c000100200] [content=b3cfbab0] [sc=b3c21a98^b3c1ecc8^b3c1e730^0]<
I/Gecko   ( 1951):                 >
I/Gecko   ( 1951):               >
I/Gecko   ( 1951):             >
I/Gecko   ( 1951):           >
I/Gecko   ( 1951):         >
I/Gecko   ( 1951):       >
I/Gecko   ( 1951):       Placeholder(div)(-1)@b3c1fc28 next=b3c1ff48 {0,0,0,0} [state=0000000000400402] [content=b3cfb5b0] [sc=b3c1fa68:-moz-non-element^0] outOfFlowFrame=Block(div)(-1)@b3c1fa00
I/Gecko   ( 1951):       Placeholder(div)(-1)@b3c1ff48 next=b3c21660 {0,0,0,0} [state=0000000000400402] [content=b3cfb600] [sc=b3c1fd88:-moz-non-element^0] outOfFlowFrame=Block(div)(-1)@b3c1fd20
I/Gecko   ( 1951):       Placeholder(div)(-1)@b3c21660 {0,0,0,0} [state=0000000000400402] [content=b3cfb6a0] [sc=b3c214a0:-moz-non-element^0] outOfFlowFrame=Block(div)(-1)@b3c21438
I/Gecko   ( 1951):     >
I/Gecko   ( 1951):   >
I/Gecko   ( 1951): >
===================

I also print from nsRange to get start, startOffset, end, endOffset for selection.
In case [1], 
start = {<nsCOMPtr_base> = {mRawPtr = 0xb3cd5c80}, <No data fields>}
startOffset = (int &) @0xbe81b888: 0
end = {<nsCOMPtr_base> = {mRawPtr = 0xb3cd5c80}, <No data fields>}
endOffset = (int &) @0xbe81b88c: 12

In case [2],
start = {<nsCOMPtr_base> = {mRawPtr = 0xb3cd5c80}, <No data fields>}
startOffset = 0
end = {<nsCOMPtr_base> = {mRawPtr = 0xb3cc7d80}, <No data fields>}
endOffset = 4

[1] Attached file => Device: Select without empty div. (20.85 KB, image/png)
[2] Attached file => Device: Select with empty div. (21.45 KB, image/png)
So far, my investigation shows that the behavior of copypaste is still the same as that on desktop. I'm kind of stuck here. Any feedback would be appreciated.
Flags: needinfo?(hochang)
This doesn't follow the UX copy paste pattern, but triage does not believe this is a blocker. More of a polish issue.
blocking-b2g: 2.2? → ---
Assignee: jeremychen → nobody
We'll keep this as known behavior and it's not blocker.
Flags: needinfo?(hochang)
Switch to won't fix.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.