Closed Bug 1430969 Opened 4 years ago Closed 3 years ago

Some border-image properties need to be ignored when overriding colors

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: pbone, Assigned: svoisen)

Details

Attachments

(2 files)

When using custom colours and overriding any author colours. such as in http://paul.bone.id.au/2017/11/26/how-i-see-the-web/ some border properties are used as backgrounds and also should be ignored.  For example on https://phonebook.mozilla.org/?search/pbone.

STR:
  Make the configuration changes shown on the first link
  Opoen the second link.

Behaviour:
  The phone book entry is unreadable. white painted on white.

Expected bahaviour:
  The background would be set to black so that it appeard as white-on-black.

A border property is being used to set a background.  Border properties like this one should be ignored (rather than replaced with the foreground colour).  However ignoring borders in general would cause other problems, replacing them with the foreground colour is really helpful, for example when viewing tables or groups of controls/content.
Component: Disability Access → Layout
Product: Firefox → Core
Summary: Some border properties need to be ignored when overriding colours → Some border-image properties need to be ignored when overriding colors
I think there's probably a good bit of variation as to what border-image is used for (e.g., some things that are border-like and some things that aren't).  However, the spec is also designed so that the developer is supposed to set fallbacks for browsers that don't support border-image, so I think we're probably better off depending on those fallback border widths and styles than trying to guess a uniform fallback.  They may not be particularly accurate in many cases, but my guess would be that they're likely to be better than a one-size-fits-all policy.

I don't recall whether we transform a background-image to a non-opaque background color.  I don't think we do, although it might not be a bad idea, and if we did, it would probably make sense to do the same for a border-image with 'fill'.

So I think the thing to do here is simply transform 'border-image-source' to 'none' in this mode, which should be a pretty trivial change, although I don't actually know off the top of my head where that code lives post-Stylo.
Component: Layout → CSS Parsing and Computation
Priority: -- → P3
Took a stab at this since I've been trying to learn Rust and have been poking at the style system in the process. Turned out to be more trivial than I thought unless I'm missing something here.
Assignee: nobody → svoisen
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dd74f656f209
https://hg.mozilla.org/mozilla-central/rev/7540af5aa57b
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.