Closed Bug 1212680 Opened 9 years ago Closed 9 years ago

Devtools test "browser_ruleview_authored.js" fails if native webkit gradient prefixes are enabled

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
Firefox 44
Tracking Status
firefox44 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

STR:
 1. Apply bug 1210575 "part 5" to current mozilla-inbound, and run devtools test browser_ruleview_authored.js

ACTUAL RESULTS:
{
105 INFO TEST-UNEXPECTED-FAIL | devtools/client/styleinspector/test/browser_ruleview_authored.js | post-change check overridden for 0 - Got true, expected false
106 INFO TEST-UNEXPECTED-FAIL | devtools/client/styleinspector/test/browser_ruleview_authored.js | post-change check overridden for 1 - Got false, expected true 
}
Sample test log from a Try run with that patch:
https://treeherder.mozilla.org/logviewer.html#?job_id=12380184&repo=try

EXPECTED RESULTS: No test failure.

This test has an "overrideTest" function which has a series of gradients, including a "-webkit-linear-gradient". I'm guessing that's what's involved here, and the test is getting confused because it's expecting us to reject that expression, but we now will accept it.


NOTE for any local live testing outside of the test harness: along with applying the patch mentioned in the STR, one also needs to toggle the pref "layout.css.prefixes.webkit" before these prefixed gradients will start working. That pref is disabled by default, but enabled during test runs.

tromey, do you know what we need to change in this test for it to keep working after we support "-webkit-linear-gradient" natively?
[ni=tromey for question at the end of comment 0.]
Flags: needinfo?(ttromey)
Perhaps we could replace "-webkit-linear-gradient" with "-ms-linear-gradient" in this test? As far as I know, we aren't planning on adding native support for that.

(-ms-linear-gradient is indeed a thing, per this MSDN blog: http://blogs.msdn.com/b/ie/archive/2012/06/25/unprefixed-css3-gradients-in-ie10.aspx )
Side notes: 
 (1) I verified that the "-ms-linear-gradient" is recognized in IE11, by testing http://jsfiddle.net/ef8bp9rj/3/

 (2) Incidentally, the gradient you're using here is a bit complex and also transparent, which means it's completely invisible on a page with a white background. (This caused me some confusion when I first started trying to play around with it to see if it was valid or not.) Is its transparency/complexity necessary?  If it's OK, we should be able to swap in e.g. "linear-gradient(orange, blue)" and rip out the complicated expression here.

 (3) The test currently assumes that -moz-linear-gradient is supported. That may not always be the case, per bug 1176496. (We tried to unsupport them once, and failed due to web-compat issues. We may try again at some point.)  If it's possible to just use two different "linear-gradient" expressions at position #0 and #2 (instead of using a moz-prefixed expression at #0), that may be more future-proof.
Component: CSS Parsing and Computation → Developer Tools: Inspector
Product: Core → Firefox
Here's a strawman patch which addresses my thoughts in comment 2 and 3.

I verified that the test passes locally, with this applied. (on top of bug bug 1210575 part 5)
Attachment #8671121 - Flags: review?(ttromey)
Comment on attachment 8671121 [details] [diff] [review]
fix v1: use -ms instead of -webkit, drop dependence on -moz, and simplify gradient expressions

Review of attachment 8671121 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for doing this.
Attachment #8671121 - Flags: review?(ttromey) → review+
(In reply to Daniel Holbert [:dholbert] from comment #3)
> Side notes: 
>  (1) I verified that the "-ms-linear-gradient" is recognized in IE11, by
> testing http://jsfiddle.net/ef8bp9rj/3/
> 
>  (2) Incidentally, the gradient you're using here is a bit complex and also
> transparent, which means it's completely invisible on a page with a white
> background. (This caused me some confusion when I first started trying to
> play around with it to see if it was valid or not.) Is its
> transparency/complexity necessary?  If it's OK, we should be able to swap in
> e.g. "linear-gradient(orange, blue)" and rip out the complicated expression
> here.

Yeah, I don't think the content matters so much.
What the test is trying to test here is that if the user disables one
property, then the rule-view knows that an invalid property value won't
be used.

>  (3) The test currently assumes that -moz-linear-gradient is supported. That
> may not always be the case, per bug 1176496. (We tried to unsupport them
> once, and failed due to web-compat issues. We may try again at some point.) 
> If it's possible to just use two different "linear-gradient" expressions at
> position #0 and #2 (instead of using a moz-prefixed expression at #0), that
> may be more future-proof.

I think that is fine as well.
Flags: needinfo?(ttromey)
Thanks for the review!

(In reply to Tom Tromey :tromey from comment #6)
> >  (2) Incidentally, the gradient you're using here is a bit complex and also
> > transparent [...]
> 
> Yeah, I don't think the content matters so much.
> What the test is trying to test here is that if the user disables one
> property, then the rule-view knows that an invalid property value won't
> be used.

Cool. In that case, I'd say the one thing that *does* matter about the gradient-expression here is that it should be easy to play around with to diagnose what's going wrong, if & when the test fails.  And in that respect, the new gradient is hopefully easier, since it renders something instead of nothing. :)

I'll land this shortly.
https://hg.mozilla.org/mozilla-central/rev/f2f0e5491de5
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Assignee: nobody → dholbert
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: