Closed Bug 495798 Opened 15 years ago Closed 15 years ago

background-color:transparent on button not honored in high contrast mode

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1
Tracking Status
status1.9.2 --- beta1-fixed
blocking1.9.1 --- .2+
status1.9.1 --- .2-fixed

People

(Reporter: gibson.becky, Assigned: bzbarsky)

References

()

Details

(5 keywords)

Attachments

(9 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0pre Overlay a button over text or an image. Set the button style to background-color:transparent. The text or image the button is on top of should be visible within the button borders. This does not work in high contrast mode. This used to work correctly in Firefox 2 and in Firefox 3.0.5. It no longer works in Firefox 3.0.10 nor in a Minefield daily build. This example is fairly simple, a button over an image, But, this is causing a much bigger problem where a button is overlaid over text in order to make a large clickable area. Reproducible: Always Steps to Reproduce: 1. load http://weba11y.com/Examples/bugs/buttonTransparencyHC.html 2.Note that the image is visible within the border of the transparent button. 3.Switch to high contrast mode. Actual Results: The image is no longer visible within the borders of the button because background-color:transparent is not honored for the button. Expected Results: In high contrast mode, background-color:transparent should be honored on a button. This worked in Firefox 2 and through Firefox 3.0.5.
Could you please attach a screenshot? It's not clear to me what you're seeing.
Because the button is transparent, you can see the image through the button. The button is above the mouse pointer and contains the value "text".
Notice that the background of the button is now solid - the image can no longer be seen through the button even though background-color: transparent has been set on the button. Shouldn't transparent still be honored in high contrast mode even though colors are not? This worked up until Firefox 3.0.7.
This is a real world example. There is a transparent button overlayed on top of the text so that the name is clickable.
Refer to the attached NormalMode.bmp to see where the names should be displayed. This is a real world example where a button with background-color:transparent is overlain above the text. Before Firefox 3.0.7 the names were still visible in high contrast mode.
When you view this file in normal mode you will see "Lance Armstrong" displayed twice. When you view this file in Windows high contrat mode, the text is no longer visible. That is because the text is below a button with background-color:transparent. The transparent setting is not honored in high contrast mode but it used to be up until Firefox 3.0.7.
I can't reproduce this.
Component: Disability Access → Layout: Form Controls
Product: Firefox → Core
QA Contact: disability.access → layout.form-controls
This is the example at http://weba11y.com/Examples/bugs/buttonTransparencyHC.html running in high contrast mode on a the 20090602 Minefield daily build. The button in the center of the image containing the value "test" should be transparent but it is not. The button is displaying using the high contrast background color of black. The button has background-color:transparent set and that should be honored in high contrast mode.
I can reproduce this, following the "steps to reproduce" in the original description above. Details: - WinXP SP3 - FF 3.0.11 (button is *not* transparent in high contrast mode). - FF 2.0.0.20 (button *is* transparent in high contrast mode). - button is transparent in standard contrast mode for both versions. One note: not sure it matters but... the text of the button label, "test", is white for FF2 in standard contrast mode, but black in FF3, and is white in both cases when in high contrast mode.
So this is somewhat purposeful. High contrast mode is not needed to reproduce; it's enough to go to Firefox Preferences > Content > Colors and uncheck "Allow pages to choose their own colors". One of the side-effects of being in a high-contrast theme is that we behave as if that were unchecked (see bug 239914). Once that's done, of course, your page's styling on the button is ignored, and in particular your "transparent" style is ignored. Over to accessibility in case they want to reevaluate the tradeoffs here. Certainly not a form controls issue.
Component: Layout: Form Controls → Disability Access APIs
QA Contact: layout.form-controls → accessibility-apis
Note that contrary to bug 239914 comment 7, IE doesn't quite disable all user color styling. It seems to allow "transparent" to be set for background, per the testcases in this bug, but not allow a background color to be set. Confirming based on that.
Status: UNCONFIRMED → NEW
Ever confirmed: true
That said, there's something else weird going on here. It doesn't look like we should be ignoring transparent background styles. Let me dig a bit more.
Ah, I see what's up. We're not dropping native theming when page's can't set their own colors. And the reason for that is the fix for bug 437366. Note that backing that out makes form controls unreadable in many cases for users of high-contrast themes. Many more cases than involve transparent backgrounds. Over to style system, but I'm really not quite sure what the right behavior is here, much less how to get it to happen...
Blocks: 437366
Component: Disability Access APIs → Style System (CSS)
QA Contact: accessibility-apis → style-system
I suppose we could pass in the "document colors disabled" boolean to nsRuleNode::HasAuthorSpecifiedRules instead of not calling it at all and treat transparent specially....
Flags: wanted1.9.1?
Flags: blocking1.9.2?
Flags: blocking1.9.0.12?
Attached patch This seems to do the trick (obsolete) — Splinter Review
Attachment #381327 - Flags: superreview?(dbaron)
Attachment #381327 - Flags: review?(dbaron)
Flags: wanted1.9.1?
Flags: wanted1.9.1.x+
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.12?
Flags: blocking1.9.0.12+
Keywords: access, regression
Assignee: nobody → bzbarsky
is there any additional information regarding when this might get into a build?
Whiteboard: [needs r/sr=dbaron]
Comment on attachment 381327 [details] [diff] [review] This seems to do the trick >+ // If author colors are not allowed, only claim to have >+ // author-specified rules if we're looking at the background >+ // color and it's set to transparent. Anything else should get >+ // set to a dummy value instead. >+ if (aAuthorColorsAllowed || >+ (i == 0 && >+ (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) && >+ !values[0]->IsNonTransparentColor())) { >+ return PR_TRUE; >+ } Could you precede this with an assertion documenting the assumption: NS_ABORT_IF_FALSE(!(ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) || i != 0 || values[0] == &colorData.mBackColor, "first value must be background color"); >+ values[i]->SetDummyValue(); What's this for? The rest seems ok to me.
Attachment #381327 - Flags: superreview?(dbaron)
Attachment #381327 - Flags: superreview+
Attachment #381327 - Flags: review?(dbaron)
Attachment #381327 - Flags: review+
Comment on attachment 381327 [details] [diff] [review] This seems to do the trick bz reminded me of the surrounding code which makes us need the SetDummyValue (so we ignore rules lower in the cascade that specify transparent backgrounds that are overridden by a rule specifying a non-transparent one) So r+sr=dbaron with the assertion added.
Attached patch Merged to tipSplinter Review
Attachment #381327 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Attached patch 1.9.1 mergeSplinter Review
Attachment #383567 - Flags: approval1.9.1?
Attached patch 1.9.0 mergeSplinter Review
Attachment #383580 - Flags: approval1.9.0.12?
Comment on attachment 383580 [details] [diff] [review] 1.9.0 merge Approved for 1.9.0.12. a=ss
Attachment #383580 - Flags: approval1.9.0.12? → approval1.9.0.12+
Whiteboard: [needs r/sr=dbaron]
Fixed in CVS.
Keywords: fixed1.9.0.12
Flags: blocking1.9.1?
Flags: blocking1.9.2?
Flags: blocking1.9.2+
Flags: blocking1.9.1?
Flags: blocking1.9.1-
Fixed this in 1.9.0.12, so we should fix it in 1.9.1.x, maybe 1.9.1.1?
Flags: blocking1.9.1.1?
Since this blocked 1.9.0.12, I'm going to block on it for 1.9.1.1, even though it's not a security or stability fix.
Flags: blocking1.9.1.1? → blocking1.9.1.1+
Comment on attachment 383567 [details] [diff] [review] 1.9.1 merge Approved for 1.9.1.1. a=ss
Attachment #383567 - Flags: approval1.9.1? → approval1.9.1.1+
Comment on attachment 383567 [details] [diff] [review] 1.9.1 merge We'll get this in 1.9.1.2, can't wait for it for the now-firedrilltastic 1.9.1.1
Attachment #383567 - Flags: approval1.9.1.2?
Attachment #383567 - Flags: approval1.9.1.1-
Attachment #383567 - Flags: approval1.9.1.1+
blocking1.9.1: --- → .2+
Flags: blocking1.9.1.1+ → blocking1.9.1.1-
v. Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12 Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090716 Minefield/3.6a1pre
Comment on attachment 383567 [details] [diff] [review] 1.9.1 merge a=beltzner, please land on mozilla-1.9.1
Attachment #383567 - Flags: approval1.9.1.2? → approval1.9.1.2+
Verified fix on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Keywords: verified1.9.1
This landed before the 1.9.2 branchpoint.
Keywords: fixed1.9.2
Target Milestone: --- → mozilla1.9.2a1
Depends on: 700221
I realize this is an old issue, but I've run into the analagous problem with border-color. Transparent borders are being rendered in the system's selected color, rendering web pages that utilize transparent borders poorly. I'm wondering if support for transparent could/should be extended to all styles, not just background-color.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: