Closed Bug 33208 Opened 25 years ago Closed 25 years ago

Editor fails to initialize on pages with JS

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: akkzilla, Assigned: akkzilla)

References

()

Details

Attachments

(1 file)

Run mozilla -edit http://www.shallowsky.com/moon/hitchhiker.html Do File->Quit On linux, I see a JS error, which turns out to be because EditorGetDocument() fails because the editor never got initialized. I'm working on tracking it down further and find out why the editor doesn't get initialized. Charley says he sees a crash on windows, apparently going through s_ReportUncaughtException (which on Unix just prints out the error message).
The editor seemed to be initialized when I tested this morning. Please attach a test file so we're all "on the same page."
Charley: see the URL and instructions I already added to this bug. I've tracked it down further: the GetStyleContextFor call inside nsEditor::IsPreformatted (when doing ReplaceNewlines while initializing the plaintext rules) is failing.
Status: NEW → ASSIGNED
Target Milestone: --- → M15
Okay, here's the deal. JS code inside the body shows up as text nodes, and it has no style context. So we can't depend on every node having a style context. We can either treat those nodes as pre, or as non-pre, but in either case, we should not return an error from IsPreFormatted, just true or false. In my tree, I have it set to return false (i.e. these nodes are not preformatted), and now the page initializes just fine and I can edit it. Will check in the fix along with the disable-JS changes, when they're reviewed. Will attach the diff for this part to this bug -- can you review it, and see if it fixes your crash?
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
verified in 3/30 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: