Closed Bug 355395 Opened 14 years ago Closed 14 years ago

Misspelled words in text areas cause all following text to disappear during print.


(Core :: Printing: Output, defect)

1.8 Branch
Not set





(Reporter: darren, Assigned: martijn.martijn)




(Keywords: relnote, verified1.8.1.1)


(4 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20060918 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20060918 Firefox/2.0

A misspelled word (underlined in red) will cause itself and all following words within a text area tag to disappear during the print. The red underlines will remain, but that is all.

Reproducible: Always

Steps to Reproduce:
1. Find a text area.
2. Enter a misspelled word.
3. Print as usual, it matters not what printer driver.
4. Shred useless hard copy.

Actual Results:  
I got confused, and thought it was something I had done.

Expected Results:  
Printed the text after the misspelled word.


Build platform

Build tools
Compiler 	Version 	Compiler flags
$(CYGWIN_WRAPPER) cl 	12.00.8804 	-TC -nologo -W3 -Gy -Fd$(PDBFILE)
$(CYGWIN_WRAPPER) cl 	12.00.8804 	-TP -nologo -W3 -Gy -Fd$(PDBFILE)

Configure arguments
--enable-application=browser --enable-update-channel=release --enable-official-branding --enable-optimize --disable-debug --disable-tests --enable-static --disable-shared --enable-svg --enable-canvas --enable-update-packaging
I see this on Linux, too.
Assignee: nobody → printing
Component: General → Printing
Ever confirmed: true
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general
Hardware: PC → All
Version: unspecified → 1.8 Branch
Nominating blocking to see what drivers think of this issue. It is probably related to bug 221023. It is likely a similar simple issue, but the code involved is complex and scary.
Flags: blocking1.8.1?
The related bug was bug 336679, the number in comment 2 was the attachment
I agree with Brett, and also don't think that this will be a common enough use case to block shipping Firefox 2. We'll relnote this, and I've nominated it for so we can try to get it in a security and stability fixpack.
Flags: blocking1.8.1?
Flags: blocking1.8.1.1?
Flags: blocking1.8.1-
Keywords: relnote
Since it is not working well, maybe just disable the spell-checking at all inside printing/print preview?
Attachment #242054 - Flags: review?(brettw)
I also noticed that selecting something inside textarea's is possible in print preview. This patch fixes that. Not sure if it is any good.
Attachment #242054 - Flags: review?(brettw) → review+
Attachment #242054 - Flags: superreview?(roc)
+    nsCOMPtr<nsPresContext> context = presShell->GetPresContext();

This can be nsPresContext*

Instead of checking the type, just check IsDynamic().
*** Bug 358725 has been marked as a duplicate of this bug. ***
*** Bug 359941 has been marked as a duplicate of this bug. ***
*** Bug 357998 has been marked as a duplicate of this bug. ***
Attached patch patchv2Splinter Review
Oops, I kind of forgot about the patch.
Attachment #242054 - Attachment is obsolete: true
Attachment #245627 - Flags: superreview?(roc)
Attachment #245627 - Flags: review?(roc)
Attachment #242054 - Flags: superreview?(roc)
Comment on attachment 242055 [details] [diff] [review]
disable selection inside print preview

It seems to me this also makes sense, not?
Attachment #242055 - Flags: review?(roc)
Comment on attachment 245627 [details] [diff] [review]

OK for the first hunk ... the rest is some other patch
Attachment #245627 - Flags: superreview?(roc)
Attachment #245627 - Flags: superreview+
Attachment #245627 - Flags: review?(roc)
Attachment #245627 - Flags: review+
Attached patch patchSplinter Review
Oops, yes, the rest was from some other patch, this is what I'm going to check in.
Checking in nsEditor.cpp;
/cvsroot/mozilla/editor/libeditor/base/nsEditor.cpp,v  <--  nsEditor.cpp
new revision: 1.479; previous revision: 1.478

Checking in ua.css;
/cvsroot/mozilla/layout/style/ua.css,v  <--  ua.css
new revision: 3.228; previous revision: 3.227

Checked both patches in on trunk.
Assignee: printing → martijn.martijn
Closed: 14 years ago
Resolution: --- → FIXED
Great work,

Il test it asap.

Any change you could also take a look at this bug?
Im not sure but it might be your turf.
bug: 358727
Comment on attachment 245638 [details] [diff] [review]

I think this is safe enough that it should go on
It fixes a nasty regression where people aren't able to print text in textareas a lot of the time.
Attachment #245638 - Flags: approval1.8.1.1?
Flags: blocking1.8.1.1? → blocking1.8.1.1+
Comment on attachment 245638 [details] [diff] [review]

approved for 1.8 branch, a=dveditz for drivers
Attachment #245638 - Flags: approval1.8.1.1? → approval1.8.1.1+
Attached patch branch patchSplinter Review
Sorry, I should have tested the patch on branch before asking approval1.81.
The patch gives a compile error because isdynamic() doesn't exist on branch.
So I reverted back to using:
    if (context->Type() == nsPresContext::eContext_PrintPreview ||
        context->Type() == nsPresContext::eContext_Print) {
on branch, which works fine.
Attachment #246100 - Flags: superreview?(roc)
Attachment #246100 - Flags: review?(roc)
Attachment #246100 - Flags: superreview?(roc) → superreview+
Attachment #246100 - Flags: approval1.8.1.1?
Comment on attachment 246100 [details] [diff] [review]
branch patch

Approved for the 1.8.1 branch, a=jay for drivers.  

Martijn: Thanks for the quick updated patch, please land asap.  Thanks!
Attachment #246100 - Flags: approval1.8.1.1? → approval1.8.1.1+
Checking in nsEditor.cpp;
/cvsroot/mozilla/editor/libeditor/base/nsEditor.cpp,v  <--  nsEditor.cpp
new revision: 1.447.4.9; previous revision: 1.447.4.8

Checked in on the 1.8.1 branch.
Keywords: fixed1.8.1
Depends on: 361808
Verified using Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv: Gecko/20061201 BonEcho/ I verified using the original STR. My printed page shows all the text. Adding keyword.
Re-verified on Vista, XP, Mac, Linux Fx Pages with spell checked fields print correctly.
You need to log in before you can comment on or make changes to this bug.