1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Thomas Walpole
54fa362ee2 minor style fix 2022-07-29 14:12:44 -07:00
Daniel Sheppard
8b04019512 Make animation disabler threadsafe
Animation Disabler is installed as a rack middleware - it will be
instantiated once and the call method will be called by multiple
requests.

The code was using instance variables on the middleware for information
about individual requests. When multiple requests were made at the same
time, the subsequent request would replace the status/headers/body of
the original request, causing the original request to return the
response of the subsequent request.
2022-07-12 11:32:43 +10:00
Thomas Walpole
70ab439726 Minor code cleanup 2022-04-30 17:02:14 -07:00
Thomas Walpole
71770a1b81 Insert nonces in animation disabler if available 2022-04-30 16:21:07 -07:00
Javi Martín
cad1efc952 Fix invalid HTML generated by AnimationDisabler
The W3C Validator was reporting an error:

> Element style not allowed as child of element body in this context.
>
> Contexts in which element style may be used:
>     Where metadata content is expected.
>     In a noscript element that is a child of a head element.
> Content model for element body:
>     Flow content.

It looks like there can't be any <style> tags inside the <body> element
[1].

The <script> part of the markup template remains at the end of the
<body> element because it only makes sense if jQuery has already been
defined, and jQuery could be defined anywhere inside the <head> or
<body> elements.

[1] https://html.spec.whatwg.org/multipage/semantics.html#the-style-element
2021-09-26 15:54:25 +02:00
michaelhwang
6b5476cc5b insert disable template at the end of body and remove script defer 2021-01-23 17:03:24 +08:00
Dale Morgan
849ec3f26c Wrapping injected disable_animation script in CDATA to prevent XHTML/XML parser errors 2020-12-02 10:59:56 +00:00
Nathan Broadbent
7be5795001 Add "scroll-behavior: auto;" CSS to Capybara::Server::AnimationDisabler to disable scroll animation 2020-10-01 00:23:38 +08:00
Thomas Walpole
f59df7ed86 Style updates 2020-09-05 12:24:43 -07:00
Daniel Heath
18d8e26fd8 Disable animations on pseudoelement content as well as regular elements 2019-06-19 13:14:04 +10:00
Thomas Walpole
08e0f610ec Prefer match? when match data not needed 2019-04-04 17:42:10 -07:00
Thomas Walpole
f6b2f3adf0 Code cleanup and enable line length cop 2018-11-03 13:03:48 -07:00
Thomas Walpole
bf084e379c annotate token 2018-10-11 19:15:47 -07:00
Thomas Walpole
1054005906 Add empty line after guard claues 2018-09-24 09:43:46 -07:00
Michael Glass
443617a995
Capybara.disable_animations can also accept a CSS selector
If it receives a falsey (false or nil) it won't do anything.
If it receives true, it will disable animations on the '*' css selector
If it receives a string, it will use that string as the css selector

It will still always disable css for jQuery if it's around.
2018-08-20 15:25:53 -07:00
Thomas Walpole
e320f5d7fc style updates 2018-07-16 15:04:52 -07:00
Thomas Walpole
e8b49b6eed Disable animation on pages 2018-06-01 10:35:43 -07:00