Closed Bug 1388220 Opened 7 years ago Closed 7 years ago

stylo: currentColor breaks box-shadow interpolation

Categories

(Core :: CSS Parsing and Computation, defect)

Unspecified
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla57
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- disabled
firefox56 --- wontfix
firefox57 --- fixed

People

(Reporter: me, Assigned: hiro)

References

(Blocks 1 open bug)

Details

(Keywords: nightly-community)

Attachments

(3 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170805100334

Steps to reproduce:

With layout.css.servo.enabled true, I loaded this demo document:

<style>
    div {
        box-shadow: 0 2em currentColor;
        transition: 0.5s all;
    }
    div:hover {
        box-shadow: 0 3em currentColor;
    }
</style>
<div>foo</div>

… and hovered over the DIV.


Actual results:

The box-shadow disappeared for half a second, and then appeared in the final position.


Expected results:

The box-shadow should have smoothly transitioned from 2em to 3em, as it does if you avoid using the currentColor keyword or if you disable stylo.
Transition of box-shadow still has problem, and there is an open bug for that.

We can see if this is fixed after that bug gets fixed.
Depends on: 1387973
Attached file demo.html
from comment 0
Confirmed in Nightly 57 x64 20170807113452 @ Debian Testing.
Someone will certainly have something like this on his website.
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Version: 57 Branch → Trunk
Assignee: nobody → hikezoe
Status: NEW → ASSIGNED
No longer depends on: 1387973
Do'h! I thought I did push patches for review.
Blocks: 1387973
Comment on attachment 8897293 [details]
Bug 1388220 - Reuse to_simple_shadow() for box-shadow as well.

https://reviewboard.mozilla.org/r/168592/#review173816

::: servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs:53
(Diff revision 1)
>      pub fn to_simple_shadow(&self) -> SimpleShadow {
> -        debug_assert_eq!(self.mSpread, 0);
> -        debug_assert_eq!(self.mInset, false);
>          SimpleShadow {
>              color: Color::rgba(convert_nscolor_to_rgba(self.mColor)),
>              horizontal: Au(self.mXOffset),
>              vertical: Au(self.mYOffset),
>              blur: Au(self.mRadius).into(),
>          }
>      }

Actually I'd prefer you leave the assertions inside `to_simple_shadow` function, and move the actual SimpleShadow creating code into a private function, otherwise the name `to_simple_shadow` could be misleading.
Attachment #8897293 - Flags: review?(xidorn+moz) → review+
Comment on attachment 8897294 [details]
Bug 1388220 - Convert gecko's currentcolor to servo one.

https://reviewboard.mozilla.org/r/168594/#review173826
Attachment #8897294 - Flags: review?(xidorn+moz) → review+
Comment on attachment 8897294 [details]
Bug 1388220 - Convert gecko's currentcolor to servo one.

https://reviewboard.mozilla.org/r/168594/#review173828

::: servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs:64
(Diff revision 1)
> +
>      /// Returns this item as a simple shadow.
>      #[inline]
>      pub fn to_simple_shadow(&self) -> SimpleShadow {
>          SimpleShadow {
> -            color: Color::rgba(convert_nscolor_to_rgba(self.mColor)),
> +            color: self.extract_color(),

It isn't really necessary to have a separate function, but either way is fine.
Comment on attachment 8897295 [details]
Bug 1388220 - Simple interpolation test cases for text-shadow and box-shadow with currentcolor.

https://reviewboard.mozilla.org/r/168596/#review173830
Attachment #8897295 - Flags: review?(xidorn+moz) → review+
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #9)
> Comment on attachment 8897293 [details]
> Bug 1388220 - Reuse to_simple_shadow() for box-shadow as well.
> 
> https://reviewboard.mozilla.org/r/168592/#review173816
> 
> ::: servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs:53
> (Diff revision 1)
> >      pub fn to_simple_shadow(&self) -> SimpleShadow {
> > -        debug_assert_eq!(self.mSpread, 0);
> > -        debug_assert_eq!(self.mInset, false);
> >          SimpleShadow {
> >              color: Color::rgba(convert_nscolor_to_rgba(self.mColor)),
> >              horizontal: Au(self.mXOffset),
> >              vertical: Au(self.mYOffset),
> >              blur: Au(self.mRadius).into(),
> >          }
> >      }
> 
> Actually I'd prefer you leave the assertions inside `to_simple_shadow`
> function, and move the actual SimpleShadow creating code into a private
> function, otherwise the name `to_simple_shadow` could be misleading.

Oh right. Indeed. I will add the private function named... I need to think the name somehow.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #13)
> (In reply to Xidorn Quan [:xidorn] UTC+10 from comment #9)
> > Comment on attachment 8897293 [details]
> > Bug 1388220 - Reuse to_simple_shadow() for box-shadow as well.
> > 
> > https://reviewboard.mozilla.org/r/168592/#review173816
> > 
> > ::: servo/components/style/gecko_bindings/sugar/ns_css_shadow_item.rs:53
> > (Diff revision 1)
> > >      pub fn to_simple_shadow(&self) -> SimpleShadow {
> > > -        debug_assert_eq!(self.mSpread, 0);
> > > -        debug_assert_eq!(self.mInset, false);
> > >          SimpleShadow {
> > >              color: Color::rgba(convert_nscolor_to_rgba(self.mColor)),
> > >              horizontal: Au(self.mXOffset),
> > >              vertical: Au(self.mYOffset),
> > >              blur: Au(self.mRadius).into(),
> > >          }
> > >      }
> > 
> > Actually I'd prefer you leave the assertions inside `to_simple_shadow`
> > function, and move the actual SimpleShadow creating code into a private
> > function, otherwise the name `to_simple_shadow` could be misleading.
> 
> Oh right. Indeed. I will add the private function named... I need to think
> the name somehow.

I name it extract_simple_shadow.
Attached file Servo PR
Attachment #8897293 - Attachment is obsolete: true
Attachment #8897294 - Attachment is obsolete: true
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ad3d262ebbe
Simple interpolation test cases for text-shadow and box-shadow with currentcolor. r=xidorn
https://hg.mozilla.org/mozilla-central/rev/5ad3d262ebbe
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Such smooth, much wow.
Nightly 57 x64 20170816100153 @ Debian Testing

56 beta = wontfix, I think. (not a blocker for experiment participants and not a crash fix)

I should go through all stylo-site-issues and should set status-firefox57 to verified if they are fine on WOW64/Win64/Linux64/Mac.
Status: RESOLVED → VERIFIED
OS: Unspecified → All
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: