Closed Bug 123727 Opened 24 years ago Closed 23 years ago

Clicking on an image in Composer doesn't select it.

Categories

(Core :: DOM: Selection, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: cmanske, Assigned: bugzilla)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Open any page with an image or create one and insert an image. Click on the image. It does not change the current selection -- it should select the image.
Keywords: regression
Whiteboard: EDITORBASE+
*** Bug 124228 has been marked as a duplicate of this bug. ***
Keywords: nsbeta1+
cc Tucson also carrying over my steps from DUP bug: 1) launch netscape 2) launch composer 3) insert image 4) click on image to select it. notice: a) no blue border showing selection b) enter some text next to image, then click on image, then type more text, image never got selected, so they text you type keeps going instead of replacing the image with text. Kin also sees these problems. definitely some regression in image selection.
I think we may unintentionally be picking up some style on images that is causing the IsSelectable() call in nsFrame::HandlePress() to return false. Can we figure out when this started happening? It might make it easier to see what checkin caused this.
Tucson to investigate when this broke...
This problem first showed itself in build 2002020512. The trunk builds before it (02-04 and 02-02) were both not functional due to bug 123399, and builds 02-01 and before work fine.
I downloaded the Mac mozilla build from 2/4 (4am?) and it also has this problem (unable to select images). Are there builds from the middle of the night or any other time which might help us narrow this down?
I did some quick debugging on this last week and found 2 problems. The first one is the IsSelectable() problem I mentioned above. The 2nd one is that this call in nsEditor.cpp: aSelCon->SetSelectionFlags(nsISelectionDisplay::DISPLAY_ALL); seems to set the flag on a presShell, which is different from the presShell used when rendering. That is when the layout rendering code goes to see if it should draw a box around the image because it is selected, it doesn't because the DISPLAY_ALL flag is not lit. Mike are you looking into this one? It's a pretty big regression.
Attached patch patch (obsolete) — Splinter Review
It sucks that nsFrame has to know about editing. And what's with this (original) line: isEditor = isEditor == nsISelectionDisplay::DISPLAY_ALL; ? I'll leave kin to comment further.
OS: Windows 2000 → All
Comment on attachment 69170 [details] [diff] [review] patch The isEditor bool/flag should be renamed to something like displaySelectionFlags and we should probably be looking for DISPLAY_IMAGES and DISPLAY_FRAMES instead of assuming DISPLAY_ALL. Shouldn't we be overriding HandlePress in image and area frame instead of the generic frame class?
-> blake, drive zee patch!
Assignee: mjudge → blaker
I'll sr=kin the first half of the patch since it will fix this bug, blake you'll need to rework/rethink the approach on how to get your desired D&D behavior. Index: ./document/src/html.css =================================================================== RCS file: /cvsroot/mozilla/layout/html/document/src/html.css,v retrieving revision 3.143 diff -u -r3.143 html.css --- ./document/src/html.css 3 Feb 2002 00:06:00 -0000 3.143 +++ ./document/src/html.css 13 Feb 2002 01:21:05 -0000 @@ -404,10 +404,6 @@ cursor: pointer; } -img, area { - -moz-user-select: none !important; -} - img[usemap], object[usemap] { color: blue; -moz-user-focus: normal;
Will that patch to html.css make images selectable in webpages too?
Yes -- images are selectable in browser. Blake: So I assume you changed this so you could click on image and immediately drag it?
I can't say I understand how the addition in the second part of the patch is at all different from the code that comes right after it, which looks for a link. Yes, perhaps this is better placed in nsImageFrame or whatever, but why did that code get checked in in nsFrame::HandlePress, then?
And what do you mean rethink/rework the approach? What are the other issues here besides the placement? This patch seems correct to me.
I didn't add the link code, but I suppose it was added because all of the elements that can live under a link need to do the exact same thing. In any case, We don't want to be adding special case code to the base class if we can help it. In your case we have specialized frames for the content you are concerned with. Also, your nsFrame.cpp changes are using something which I thought was intended to modify "display of selection", not selection, to short circuit selection. Cc'ing mjudge, during a meeting today he seemed to think there were other issues that needed to be considered. Also what implications does shutting off selection on image and area have on accessibility?
It does not shut off selection of images and areas, it shuts off *initiation* of a selection when the press originates on an area or an image. This is exactly how IE behaves. I can't think of any accessibility implications, but cc'ing aaronl. nsFrame::HandlePress is where we start the selection, so I think this is the proper place to handle it. This is also the place where we prevent dragging of a link and instead initiate a selection if you hold down alt while selecting within a link. Now we just want to do the opposite -- prevent the selection, let a drag start.
cc Aaron per Blake's previous comments
I'm more concerned about being able to select images and everything else using the keyboard, which seems to be working. As far as mouse selection goes, and how it relates to accessibility, that decision should be based on usability for everyone.
Attached patch patch (obsolete) — Splinter Review
Attachment #69170 - Attachment is obsolete: true
Attachment #69986 - Attachment is obsolete: true
Target Milestone: --- → mozilla1.0
I see how you are trying to let the editor continue to work. Is is possible to simple disallow the click selection of images/area frames in all cases, then if the drag does not take place (i.e. you click then let go over the same image ect) that you return and select just that image. This will prevent the start of a continuous selection with an image or area frame. I think thats ok. It will also allow people to click on images in the browser then copy them to clipboard ect without selecting fromone side of it to the other. You could also remove the code (which we all hate but its been there forever) to check for the editor based on the selection flags ect. just boot out of click selecting in images and areaframes period.
Okay, but can you provide tips on how to do that...? HandlePress is what starts the selection but we don't know at that point if it's going to end up a click or a drag.
Keywords: topembed
r=brade on the html.css changes that kin sr'd Can we get approval to check that in for 0.9.9?
Blocks: 58133
No longer blocks: 58133
add dependency; you can't constrain an image if you can't get to its dialog and you can't get to a properties dialog if you can't do the initial selection.
Blocks: 58133
I was able to get to image props by context menu....
remove dependency since QA found a workaround By the way, I talked to Blake and he was under the mistaken impression that the css change had already been backed out so that is why it isn't in his most recent patch. He is ok with the html.css change (backout) being checked in.
No longer blocks: 58133
a=asa (on behalf of drivers) for checkin to 0.9.9 for the html.css part
Keywords: mozilla0.9.9+
backout of html.css change checked in.
What is the effect of this change on the browser? Does clicking on an image in browser select it now? More importantly, does clicking on an image in the browser blow away the X Primary selection (as it used to at some point)?
Whiteboard: EDITORBASE+
Target Milestone: mozilla1.0 → mozilla1.1
if the file is backed out can we get a resolution on this bug? also why is this bug marked 1.1 milestone?
This bug should be closed as FIXED and blake's original D&D bugs REOPENED.
Dragging an image from Browser happens with on click down and drag; when in Composer you must click on image to select, then mouse down and drag, but that is the correct behavior (same as in 4.x). I see one problem with draggin image from browser: the SRC url of image is not made absolute, so when you drop in composer, image is broken (and asserts) because it is a relative URL. This doesn't happen when dragging from Composer window to composer window. But maybe that is a separate bug from blakes? I can't find any drag and drop bug for blake.
what is the status on this bug?
selection of images in Composer is fixed (was fixed for 0.9.9 if I recall correctly) I don't know the other bug Blake was working on that was partially backed out. That bug should be reopened.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.1 → mozilla0.9.9
verified in 3/11 build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: