Closed Bug 16286 Opened 25 years ago Closed 25 years ago

Assertion when selecting a text styled with pseudo content

Categories

(Core :: Layout, defect, P1)

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: rbs, Assigned: mjudge)

Details

With today's tree, the code crash when the mouse is used to select a text enclosed in quotes, where the quotes are generated content. Here is a test file that allows to easily reproduce the bug. When selecting all of the text (excluding the quotes), the code invariably crashes (on Win95). <html> <head> <style> b:before { content: open-quote; } b:after { content: close-quote; } </style> </head> <body> <b>to crash, slowly select only the text up to here</b> </body> </html>
Assignee: troy → mjudge
Mike, stack shows it's in the selection code. I remember we talked about this once. I don't know if this is something you've worried about yet. What we decided to do was to have the generated content nodes have a "parent" content pointer and a "document" content pointer, but they're not really part of the document model in that no content object points to the node nsDebug::NotReached(const char * 0x0199ec20, const char * 0x0199ebf8, int 540) line 297 + 13 bytes nsRange::IsIncreasing(nsIDOMNode * 0x01bc5db8, int 0, nsIDOMNode * 0x01bc6d28, int 0) line 540 + 21 bytes nsRange::SetEnd(nsRange * const 0x01bbc748, nsIDOMNode * 0x01bc6d28, int 0) line 1001 + 49 bytes ComparePoints(nsIDOMNode * 0x01bc5db8, int 0, nsIDOMNode * 0x01bc6d28, int 0) line 96 + 20 bytes nsDOMSelection::Extend(nsDOMSelection * const 0x01bada28, nsIDOMNode * 0x01bc6d28, int 0) line 3137 + 31 bytes nsRangeList::TakeFocus(nsRangeList * const 0x01bad9c0, nsIContent * 0x01bc6d34, unsigned int 0, unsigned int 0, int 1, int 0) line 1131
Assignee: mjudge → jfrancis
accepting/m11
Priority: P3 → P1
Summary: Crash when selecting a text styled with pseudo content → [CRASH] when selecting a text styled with pseudo content
this one is a doozy. The range code has NO WAY to tell the two nodes that represent the quote marks apart. This is because they both appear to have the same set of ancestors, at the same offsets. Even those these nodes are at different locations they both show up at offset -1, an artificial value for anonymous content. When the range code tries to determine if the start and end points for the range are in the correct order, it gets into this impossible situation: the nodes aren't the same, so one must be before or after the other. But they both have the exact same chain of ancestors and offsets. There is no way for the range code to deal with this. Selection needs to be modified to not use range enopints that have one endpoint in some generated content but the other endpoint not in that same generated content. cc'ing mike
Assignee: jfrancis → kin
Status: ASSIGNED → NEW
Accepting bug.
Status: NEW → ASSIGNED
Severity: normal → critical
Target Milestone: M11 → M12
moving to M12
Blocks: 17907
Blocks: 18471
Blocks: 18951
Summary: [CRASH] when selecting a text styled with pseudo content → Assertion when selecting a text styled with pseudo content
Target Milestone: M12 → M13
Removing [CRASH] from summary since this is only an assertion in debug builds. I checked in some code to fix bug #17989 that locks the selection anchor and focus nodes into the same valid subtree when drag selecting. This prevents this assertion from being thrown when dragging, but it is still a problem when using the shift-click method to extend the selection. I'm moving this bug to M13 when I should have time to revisit this issue.
Assignee: kin → mjudge
Status: ASSIGNED → NEW
reassigning to mjudge
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
ok this is fixed. the fact that you cant select the " is OK thats a design decision that is being looked at this week. bug 12460
It is probably best to allow everything to be selectable because users have no idea that the " is generated content. Notice that for users who don't want the ", they can still select the appropriate text. Whereas users who want " included in their selection will find it strange that they cannot select it. In edit mode (bug 12460), it shouldn't be editable. Rather, users should be *informed* that they ought to go back to their initial CSS "content:" and edit it. I put the emphasis on *informed*, because otherwise, it will be undiscoverable to an user who is not the initial writer of the document.
Verified fixed in the Jan 18th build.
Status: RESOLVED → VERIFIED
I don't think making " not selectable is satisfactory. Indeed, as I have explained above, it is already possible to avoid it when doing a selection. But those who want to select it are going to wonder why they cannot select it. They will not know that it is generated content, and what this means.
Can somebody tell me the rationale of the decision that " should not be selectable?
No longer blocks: 17907
No longer blocks: 18471
No longer blocks: 18951
You need to log in before you can comment on or make changes to this bug.