Closed Bug 1478519 Opened 6 years ago Closed 6 years ago

Add support for CSS prefers-reduced-motion media feature for Gtk

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(3 files)

I just noticed that there is a setting named 'gtk-enable-animation' which is corresponding to prefers-reduced-motion.

On GTK, I guess we can write an automation test to check the value is changed when the system setting is changed.

https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-enable-animations
Summary: Bug 1365045 Add support for CSS prefers-reduced-motion media feature for Gtk → Add support for CSS prefers-reduced-motion media feature for Gtk
Forgot to setting Priority. :)
Priority: -- → P3
See Also: → 1478576
This is the test what I am trying to write.

I think the mechanism introduced in the patch should work but doesn't work for now unfortunately since there are a couple of bugs I found (bug 1478576 and bug 1478212).  (I guess there are still other bugs).

Anyway, I didn't add any test cases in bug 1476212 (a prefers-reduced-motion bug for Windows), so I will go without the test case here.
Comment on attachment 8995123 [details]
Bug 1478519 - Introduce a utility method calling some notification method for nsIPresShell.

https://reviewboard.mozilla.org/r/259596/#review266880

Given all methods here have the same signature, I expect a pointer to member
function parameter would be simpler.  If there is reason to prefer lambdas,
then feel free to ask :jimm for review.  (I'm just doing GTK-specific bits.)

::: widget/nsBaseWidget.h:323
(Diff revision 1)
>                               const mozilla::Maybe<ZoomConstraints>& aConstraints) override;
>  
>    bool AsyncPanZoomEnabled() const override;
>  
> +  template<typename NotificationFunc>
> +  void NotifyToPresShell(NotificationFunc&& aNotificationFunc);

NotifyPresShell() would be more natural in English.
Attachment #8995123 - Flags: review?(karlt)
Comment on attachment 8995124 [details]
Bug 1478519 - Support prefers-reduced-motion for GTK.

https://reviewboard.mozilla.org/r/259598/#review266882

::: widget/gtk/nsLookAndFeel.cpp:673
(Diff revision 1)
> +    case eIntID_PrefersReducedMotion:
> +    {
> +      GtkSettings *settings;

4 spaces in this file.

Opening brace after ':'

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Control_Structures
Attachment #8995124 - Flags: review?(karlt) → review+
Comment on attachment 8995123 [details]
Bug 1478519 - Introduce a utility method calling some notification method for nsIPresShell.

https://reviewboard.mozilla.org/r/259596/#review267174
Attachment #8995123 - Flags: review?(karlt) → review+
Thank you!
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f0e52163b195
Introduce a utility method calling some notification method for nsIPresShell. r=karlt
https://hg.mozilla.org/integration/autoland/rev/1b66e350419f
Support prefers-reduced-motion for GTK. r=karlt
https://hg.mozilla.org/mozilla-central/rev/f0e52163b195
https://hg.mozilla.org/mozilla-central/rev/1b66e350419f
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: