The default bug view has changed. See this FAQ.

css media="print" text-decoration styles not being processed correctly

RESOLVED FIXED in mozilla8

Status

()

Core
Layout
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ronald Aaronson, Assigned: mats)

Tracking

({testcase})

unspecified
mozilla8
testcase
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(4 attachments, 2 obsolete attachments)

(Reporter)

Description

6 years ago
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Not all properties of a style within a <style media="print"> tag are being processed, such as color, background-color and text-decoration.

Reproducible: Always

Steps to Reproduce:
1. Invoke http://www.armonkplayers.org/reservations/test.html
2. Observe page as displayed in browser.
3. Do a "Print Preview" or Print


Actual Results:  
The contents of the second table cell (BBB) is properly printed twice as large as the other cells, but the color, background-color and text-decoration properties are wrong.

Expected Results:  
The second cell should be white text on a black background and underlined.

The style sheets in question:

<style type="text/css">
.b {
  color: red;
  background-color: white;
  text-decoration: line-through;
}
</style>

<style type="text/css" media="print">
.b {
  color: white;
  background-color: black;
  text-decoration: underline;
  font-size: 200%
}
</style>

Comment 1

6 years ago
Works for me on
http://hg.mozilla.org/mozilla-central/rev/1619d8fc6416
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0a1) Gecko/20110610 Firefox/7.0a1 ID:20110610030736

Check "Print Background (colors & images)" in File – Page Setup… dialog.
WFM too against Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 ID:20110413222027 with "Print Background (colors & images)" checked.
Version: unspecified → 4.0 Branch
(Reporter)

Comment 3

6 years ago
I am sorry to have "spun your wheels".  I suppose the folks at Mozilla figure that if you are not honoring 'background-color', then you really cannot honor 'color' either.  But what is the rationale for ignoring 'text-decoration'?

So all in all, this is a print option that goes a bit beyond what I would expect.  Anyway, thanks for your time.
(Assignee)

Comment 4

6 years ago
Seems like a valid bug to me.  We should do the same color mangling
for the text-decoration lines as we do for the text.
Assignee: nobody → matspal
Severity: major → normal
Status: UNCONFIRMED → ASSIGNED
Component: General → Layout
Ever confirmed: true
Keywords: testcase
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → layout
Hardware: x86 → All
Summary: css media="print" styles not being processed correctly → css media="print" text-decoration styles not being processed correctly
Version: 4.0 Branch → unspecified
(Assignee)

Comment 5

6 years ago
Created attachment 538800 [details]
Reporter's testcase (standards mode)
(Assignee)

Comment 6

6 years ago
Created attachment 538801 [details]
Reporter's testcase in Quirks mode
(Assignee)

Comment 7

6 years ago
Created attachment 538802 [details] [diff] [review]
wip1

Something like this... should merge the nsLayoutUtils::GetColor with
part 2 in bug 312156 which does mostly the same thing.
Likely best to hold off on this until bug 403524 lands.
(Assignee)

Comment 9

6 years ago
Created attachment 538804 [details] [diff] [review]
wip2
(Assignee)

Updated

6 years ago
Attachment #538802 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Depends on: 403524
(Assignee)

Comment 10

6 years ago
Created attachment 551559 [details] [diff] [review]
fix

updated to tip
Attachment #538804 - Attachment is obsolete: true
Attachment #551559 - Flags: review?(dbaron)
Comment on attachment 551559 [details] [diff] [review]
fix

>-    } while (context && hasDecorationLines && (0 != decorMask));
>+    } while (0 != decorMask &&
>+             NS_SUCCEEDED(f->GetParentStyleContextFrame(presContext, &f, &isChild)) &&
>+             f);

GetParentStyleContextFrame is intended for use only when reconstructing the style contexts.  You either want to continue walking up the style context tree as this code was, or you should use nsLayoutUtils::GetParentOrPlaceholderFor.  (Though, really, this code should be entirely rewritten... or we should just find a way to get rid of nsTextBoxFrame.  Not for this patch, though.)

r=dbaron with that
Attachment #551559 - Flags: review?(dbaron) → review+
Comment on attachment 551559 [details] [diff] [review]
fix

>-      const nscolor color = useOverride ? overrideColor
>-        : context->GetVisitedDependentColor(eCSSProperty_text_decoration_color);
>+      const nscolor color = useOverride ? overrideColor :
>+        nsLayoutUtils::GetColor(f, eCSSProperty_text_decoration_color);

And please leave the : on the following line.
(Assignee)

Comment 13

6 years ago
Created attachment 551770 [details] [diff] [review]
fix with nits fixed
(Assignee)

Comment 14

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/e9f6607a3990
Flags: in-testsuite?
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
http://hg.mozilla.org/mozilla-central/rev/e9f6607a3990
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.