Closed
Bug 932066
Opened 13 years ago
Closed 12 years ago
Disable forms.css' input[type="color"] styling for Metro (until we have a colorpicker backend)
Categories
(Core :: Layout: Form Controls, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(1 file, 1 obsolete file)
Bug 930277 is enabling <input type="color">, but keeps the pref off for platforms that don't have color picker dialogs implemented yet. (those being Android, B2G, Metro)
It also suppresses the form-control theme for these 2/3 of these platforms in forms.css, (so that we'll render <input type="color"> just like normal <input>), but we were unable to suppress the CSS for metro because we don't (AFAIK) have a symbol we can make the preprocessor check for. We tried %ifdef MOZ_METRO, but that doesn't work; that just means "does this build support metro".
Filing this bug on figuring out a workable way to suppress this styling for metro.
| Assignee | ||
Comment 1•13 years ago
|
||
(In reply to Arnaud Bienner from comment #20)
> Discussing about this with jimm, it seems that MOZ_METRO means the Metro
> stuff is built: we have to check "XRE_GetWindowsEnvironment()" function to
> know if we are using Metro or not.
> I think we can't check something like this in forms.css directly.
>
> So a solution would be to define INPUT_TYPE_COLOR_UNSUPPORTED elsewhere, but
> this might start to become ugly :(
> I don't know if it exists other solution.
>
> I'm not cleaning the needinfo flag as ally might be able to provide more
> information.
OS: Linux → Windows 8
Hardware: x86_64 → All
Summary: Disable → Disable forms.css' input[type="color"] styling for Metro (until we have a colorpicker backend)
| Assignee | ||
Updated•13 years ago
|
OS: Windows 8 → Windows 8 Metro
| Assignee | ||
Comment 2•13 years ago
|
||
[comment 1 quotes a bit more info from bug 930277 comment 20]
| Assignee | ||
Updated•13 years ago
|
Priority: -- → P3
| Assignee | ||
Comment 3•13 years ago
|
||
[Transferring needinfo=ally from bug 930277 in case she knows of anything that would help here beyond the stuff in Comment 1.]
Flags: needinfo?(ally)
Comment 4•13 years ago
|
||
browser/metro/theme/content.css overrides lot of things, including styles for some input elements.
One solution would be to copy/paste the default "input"'s style from forms.css and to override it in Metro's content.css as input[type=color]. That would work as expected I think, but it means we will have to update these rules in content.css each time default input's style is modified in forms.css.
As a temporary work-around, this might be fine, but it doesn't sound like a long term solution.
So I think it depends on bug 895464 progress.
Comment 5•13 years ago
|
||
talked over with dholbert, discussed with mbrubeck; let's go with Arnaud's solution. We haven't come up with anything better.
Flags: needinfo?(ally)
| Assignee | ||
Comment 6•13 years ago
|
||
(In reply to Arnaud Bienner from comment #4)
> As a temporary work-around, this might be fine, but it doesn't sound like a
> long term solution.
[That's OK; this bug, by definition, doesn't want a long-term solution. :) We just need a stopgap until bug 895464 can be fixed.]
Arnaud, did you want to take this? (I recall you not having have Win8 available to test; if that's the case, I'm also happy to take this and try your proposed solution at some point soon.)
Flags: needinfo?(arnaud.bienner)
Comment 7•13 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #6)
> Arnaud, did you want to take this? (I recall you not having have Win8
> available to test; if that's the case, I'm also happy to take this and try
> your proposed solution at some point soon.)
Indeed I don't have Windows 8 so I will not be able to test the idea I proposed.
If you have computer running Windows 8 available, I would be glad if you can take care of this.
Flags: needinfo?(arnaud.bienner)
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Flags: needinfo?(dholbert)
Comment 8•13 years ago
|
||
dholbert, let me know if you need to borrow a spare windows machine.
| Assignee | ||
Comment 9•13 years ago
|
||
Thanks! I've got a laptop which has [rarely-booted-into] Win8 installed, which I can use.
Flags: needinfo?(dholbert)
| Assignee | ||
Updated•13 years ago
|
Flags: needinfo?(dholbert)
| Assignee | ||
Comment 10•13 years ago
|
||
dbaron suggests that we might be able to use a (newly-implemented) "are we in metro mode?" CSS media query to implement this, too.
(That media query addition probably would happen in a separate bug, which this bug would depend on.)
For reference, the list of currently-supported media queries are here:
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsMediaFeatures.cpp?rev=bfaaa5b35899#369
Comment 11•12 years ago
|
||
I like dbaron's suggestion. Do you have a bug on file for this?
| Assignee | ||
Comment 13•12 years ago
|
||
Oh, sorry -- no, I hadn't yet filed an "are we metro" media-query bug yet, but I've now filed bug 936628 for that.
| Assignee | ||
Comment 14•12 years ago
|
||
Also: Unfortunately, we can't use media queries to guard the input[type="color"] *selector*, like we're currently doing with %ifdefs. The media query has to wrap an entire style rule (or set of rules).
So i.e. the media query won't help us with exempting input[type="color"] from this rule, on Metro:
> 549 button,
> 550 %ifndef INPUT_TYPE_COLOR_UNSUPPORTED
> 551 input[type="color"],
> 552 %endif
> 553 input[type="reset"],
> 554 input[type="button"],
> 555 input[type="submit"] {
> 556 -moz-appearance: button;
> [...etc...]
http://mxr.mozilla.org/mozilla-central/source/layout/style/forms.css#549
I think we'll need to (temporarily) copypaste all of these style rules into input[type="color"]-specific rules, which we can then wrap in a media query for "not metro". Then, down the line when we fix bug 895464, we can drop that media-query chunk and add input[type="color"] back into the list of the selectors here.
| Assignee | ||
Comment 15•12 years ago
|
||
Though actually -- the ":-moz-system-metric" pseudo-class seems like it *would* let us style the input[type="color"] selector directly, without need for copypasting. e.g.:
> 102 .listheader-sortdirection[sortDirection="ascending"]:-moz-system-metric(windows-classic) {
http://mxr.mozilla.org/mozilla-central/source/toolkit/themes/windows/global/listbox.css#102
...and...
> 37 toolbar[type="menubar"]:not([autohide="true"]):not(:-moz-lwtheme):-moz-system-metric(menubar-drag) {
http://mxr.mozilla.org/mozilla-central/source/toolkit/themes/linux/global/global.css#37
Ideally, I can hopefully end up changing...
input[type="color"],
...to...
input[type="color"]:not(:-moz-system-metric(metro-mode)),
...in the code quoted in comment 14.
| Assignee | ||
Comment 16•12 years ago
|
||
Actually, even better would be to *replace* the current
%ifndef INPUT_TYPE_COLOR_UNSUPPORTED
input[type="color"],
%endif
...with...
input[type="color"]:-moz-system-metric(colorpicker-available),
That would be much cleaner, and allow us to enable this per-platform in a more straightforward, declarative way.
| Assignee | ||
Comment 17•12 years ago
|
||
This layers on top of bug 936628, and I'm pretty sure it should fix this. (Haven't tested it on Metro yet, though.)
| Assignee | ||
Comment 18•12 years ago
|
||
Try run's looking good: https://tbpl.mozilla.org/?tree=Try&rev=d5eef3a52f78
| Assignee | ||
Comment 19•12 years ago
|
||
Comment on attachment 829657 [details] [diff] [review]
fix v1 [stacks on top of patch in bug 936628, to provide color-picker-available]
From local testing, this seems to do the trick for Metro (and preserve existing behavior for other platforms, as shown by the Try run.
The patch just does the following:
(a) Drop all the INPUT_TYPE_COLOR_UNSUPPORTED setting / ifndeffing (which we previously used to disable this style for b2g/android, which don't have color pickers yet)
(b) Replaces all instances of input[type="color"] with input[type="color"]:-moz-system-metric(color-picker-available)
Attachment #829657 -
Flags: review?(dbaron)
| Assignee | ||
Comment 20•12 years ago
|
||
[Changing component to Layout: Form Controls, since this ended up being just a forms.css tweak, with a helper-bug.]
Component: Widget: WinRT → Layout: Form Controls
| Assignee | ||
Updated•12 years ago
|
Attachment #829657 -
Attachment description: fix v1 → fix v1 [stacks on top of patch in bug 936628, to provide color-picker-available]
| Assignee | ||
Comment 21•12 years ago
|
||
Comment on attachment 829657 [details] [diff] [review]
fix v1 [stacks on top of patch in bug 936628, to provide color-picker-available]
(Requested review from dbaron since he'd suggested the idea of using a media query here. But he's traveling, so he might not get to it right away. Arnaud, I'd be comfortable having you review this, if you're comfortable reviewing it.)
Attachment #829657 -
Flags: review?(arnaud.bienner)
| Assignee | ||
Comment 22•12 years ago
|
||
Oops, forgot to fold in one final bit of this patch, for the ::-moz-color-swatch.
(It isn't strictly necessary to use a media query for that one, since the ::-moz-color-swatch element will only exist in environments that have the pref turned on. Still, we might as well be consistent, particularly when it doesn't require any additional lines of code now that we're doing away with the %ifdef.)
Attachment #829657 -
Attachment is obsolete: true
Attachment #829657 -
Flags: review?(dbaron)
Attachment #829657 -
Flags: review?(arnaud.bienner)
Attachment #829693 -
Flags: review?(dbaron)
| Assignee | ||
Comment 23•12 years ago
|
||
Comment on attachment 829693 [details] [diff] [review]
fix v2 [stacks on top of patch in bug 936628, to provide :-moz-system-metric(color-picker-available)]
Actually, I'll just have jimm review this, since he reviewed bug 936628, and he consented in IRC. :)
Attachment #829693 -
Flags: review?(dbaron) → review?(jmathies)
Updated•12 years ago
|
Attachment #829693 -
Flags: review?(jmathies) → review+
| Assignee | ||
Comment 24•12 years ago
|
||
Flags: in-testsuite-
Comment 25•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
| Assignee | ||
Comment 26•12 years ago
|
||
Note: Looks like bug 677302 is getting some traction, which would let us drop the media query and make this slightly cleaner.
(It probably doesn't matter for the purposes of this feature, though, since (hopefully) we'll have colorpicker backends available everywhere before too too long, and we can just make all the forms.css stuff unconditional.)
Updated•12 years ago
|
OS: Windows 8 Metro → Windows 8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•