• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

animations/H03-May-2022-

parsing/H03-May-2022-

reference/H03-May-2022-

support/H03-May-2022-4328

META.ymlH A D31-Mar-202280 43

README.mdH A D31-Mar-20225.1 KiB7654

README.md

1# CSSWG Compatible Tests #
2
3## Hints ##
4
5* en/disable vendor-prefixing in `./support/helper.js` see `addVendorPrefixes`
6* remove extra `<length>` values to reduce test cases (and thus execution duration) in `./support.properties.js`, see `values.length`
7
8
9## General Properties Test Concept ##
10
11Using `support/property.js` test suites compile a list of animatable properties. `getPropertyTests()` (and the like) will expand the specification's `width: length, percentage` to `width: 1em, 1ex, 1px, … 1%` in order to test all possible value types. The propertyTests returned by `support/property.js` have the following general structure:
12
13```javascript
14{
15  // name of the test
16  "name": "background-color color(rgba)",
17  // property that is being tested
18  "property": "background-color",
19  // styles to set on the parent container (usually #container)
20  "parentStyle": {},
21  // initial styles to set on the transition element (usually #transition)
22  // may contain additional properties such as position: absolute; as required
23  "from": {
24    "background-color": "rgba(100,100,100,1)"
25  },
26  // styles to transition to
27  "to": {
28    "background-color": "rgba(10,10,10,0.4)"
29  },
30  // flags classifying property types,
31  // currently only {discrete:true} for visbility
32  "flags": {}
33}
34```
35
36For each compiled test case the test runner identifies computed initial and target values. If they match, no transition will take place, because the property couldn't be parsed. If after starting the transition the computed style matches the target value, the browser applied that value immediately and no transition will take place. During the transition the computed style may match neither initial nor target value (unless it's a discrete transition), or there was no transition.
37
38Besides value-assertions, the suites compare received TransitionEnd events. While the values are only matched against computed initial and target values, expected TransitionEnd events are declared explicitly. This can (and will) lead to some test failures that are arguably not a failure (mainly because the specification didn't cover the specific case). Transitioning `color` *may* (or not, depending on browser) also run a transition for `background-color`, as the latter's default value is `currentColor`. This suite considers those implicit transitions a failure. If it truly is a failure or not, should be decided in the specification (and tests updated accordingly).
39
40Browsers supporting requestAnimationFrame can run a test in 100ms. Browsers that don't need a wider time frame to allow the not very dead-on-target setTimeout() to be triggered between TransitionStart and TransitionEnd. Low-end CPU devices also benefit from slower transitions. Since a 300 hundred tests, each lasting 500ms would require 2.5 minutes to run, tests are run concurrently, as they cannot affect each other. For low-end devices (e.g. iPad) too many parallel tests lead to global failure, because a single `requestAnimationFrame()` would have to iterate too many nodes, which is why the suite shards into slices of 50 parallel tests. Tests are run in an off-viewport container, to prevent you from having seizures.
41
42To make individual tests a bit more readable, a lot of the test-functionality has been moved to external JavaScript files. All assertions reside within the test file itsel, though. Although they are mostly exact duplicates of other tests, it should help understanding what a test does (while abstracting away *how* it does it.)
43
44### Debugging ###
45
461. reduce to the tests you want to take a closer look at - see `filterPropertyTests()` in `support/properties.js`
472. disable final cleanup by commenting out `done` and `teardown` callbacks
483. possibly increase the `duration` and disable the `#offscreen` (by simply naming it `#off-screen`)
49
50
51## Unspecified Behavior ##
52
53the following suites test behavior that is not covered in CSS3 Transitions (as of today):
54
55* `properties-value-002.html` - verify value types transitionable but not specified for properties
56* `properties-value-003.html` - verify transitionable properties thus far not specified at all
57* `properties-value-implicit-001.html` - verify behavior for `em` based `<length>` properties when `font-size` is changed
58* `events-006.html` - expect `TransitionEnd` event to be triggered and `event.pseudoElement` to be set properly
59* `before-load-001.html` - expect transitions to be performed before document is fully loaded
60* `hidden-container-001.html` - expect transitions to NOT be performed if they happen within hidden elements
61* `detached-container-001.html` - expect transitions to NOT be performed if they happen outside of the document
62
63
64## Yet To Be Tested ##
65
66These are topics I have identifed in need of testing, but haven gotten around to testing them.
67
68* Anything involving `<svg>`
69  * well, maybe some day...
70* proper execution of timing-functions - are the right property values set at a given time?
71  * how exactly do I pinpoint a specific time to verify a property's value at time `t`?
72  * need to implement cubic-bezier to actually calculate a property's value at time `t`?
73* `selector:hover:before {}`
74  * I have no clue how to trigger that from script
75
76