Closed Bug 82993 Opened 23 years ago Closed 23 years ago

caret goes into generated content

Categories

(Core :: DOM: Editor, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.3

People

(Reporter: glazou, Assigned: mjudge)

References

(Blocks 1 open bug)

Details

(Whiteboard: [select] FIXINHAND)

Attachments

(7 files)

1. Launch mozilla
2. view URL attached to this bug in browser
3. Edit page
4. Put selection caret in the middle of text "This is a paragraph"
5. Use keyboard's left arrow to move caret before that text

Caret goes into "<paragraph>" which is generated content. The cursor should not
enter that node.

It is also possible to directly put the caret into the generated content clicking
on it.
I also tried this on edit page, and was actually able to type text within the
generated content, however, on save the typed text did not get saved. I alos
noticed that selection was odd -- I get the dark blue when I select both part of
the generated content and part of the text string
Keywords: correctness
Priority: -- → P2
Summary: [SELECTION] caret goes into generated content → caret goes into generated content
Whiteboard: [select]
Target Milestone: --- → mozilla0.9.2
somehow the bit that says some frame is "generated" is not being set any more.. 
lemme check on this
Status: NEW → ASSIGNED
ok i made IsSelectable return false if the frame is generated. I also made the 
GENERATED_CONTENT flag inheirit from the parent frame.  Since that is the case, 
textframe no longer needs to do the hacky thing of looking at its parent to see 
if its in a generated area. It simply looks at itself.  This stops ALL selection 
of genearated content, appearance or otherwise.  Since Page->ViewSource no 
longer uses generated content, this is not a problem. ya!

I have allot of changes in my tree. If i left anything out of these difs or I 
left anything in that doesnt belong (shouldnt be the case) then please lemme 
know...
Whiteboard: [select] → [select]FIXINHAND
r=kin@netscape.com lets get someone in layout, like attinasi, to sign off on 
this.
Whiteboard: [select]FIXINHAND → [select]FIXINHAND, need sr= and a=
Looks cool to me. AFAIK generated content cannot have non-generated content as a
child, so sr=attinasi
updating whiteboard
Whiteboard: [select]FIXINHAND, need sr= and a= → [select]FIXINHAND, need a=
Whiteboard: [select]FIXINHAND, need a= → [select]fixed, reviewed, need a=
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
its in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: [select]fixed, reviewed, need a= → [select]fixed, reviewed, approved
verified...

Status: RESOLVED → VERIFIED
Thanks a lot for solving that, Mike !!!

There is still a little problem with the caret if the document contains
generated content:

1. open the document I attached above into Composer
2. put the caret into the second paragraph
3. use the left arrow to move caret from second to first paragraph

The caret stops on the generated content and does not jump to the first
paragraph...  You'll probably need to reopen.
REOPENING.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
reopening based on Glazman's comments...
Also note that you can still put the caret in generated content by double 
clicking.
must get fixed

reviewed and approved
Keywords: nsBranch
Whiteboard: [select]fixed, reviewed, approved → [select]
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Similar issue : if the document contains an ISINDEX element, you can modify 
the generated textual content :

   1. launch composer
   2. add HTML tag     <isindex prompt="ISINDEX element ">
   3. switch to any of normal, alltags or preview mode
   4. put caret into "ISINDEX element"
   5. type in some text or remove some text

steps 4 and 5 should be impossible.
ok i will have fix soon for double clicks. this is for the latest isindex 
problem daniel brought up. daniel what others have we missed?  Is this a good 
fix? how does this work in your tree with your modifications?
Status: REOPENED → ASSIGNED
Whiteboard: [select] → [select] FIXINHAND
ok double click fixes. where you could double click and drag or double click and 
caret disappeared and you could type in gen content...
patches attached. the nsFrame one also has at the bottom some geometry fixes for 
other bug. just ignore that.
[s]r=attinas for the nsFrame changes - minus the last part, which includes these
changes:
-        if (yDistance < closestYDistance)
-          closestXDistance = HUGE_DISTANCE;
+//        if (yDistance < closestYDistance)
+//          closestXDistance = HUGE_DISTANCE;

Ok, your patches fix a lot of things and help for popup menus (bug detected by
beppe) but my issue from 2001-06-25 09:45 above is still here. Copying it here
for you :

1. open attachment 06 [details]/25/01 09:42 "test case showing caret movement problem"
   above into Composer
2. put the caret into the second paragraph
3. use the left arrow to move caret from second to first paragraph

The caret stops on the generated content and does not jump to the first
paragraph.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
should have marked this fixed..
Verified on 8-27 Build
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.