commit | 724eb3d3feb35cb1d762b9196842917aafaf0399 | [log] [tgz] |
---|---|---|
author | Anders Hartvoll Ruud <andruud@chromium.org> | Mon Mar 30 14:08:15 2020 |
committer | Blink WPT Bot <blink-w3c-test-autoroller@chromium.org> | Mon Mar 30 14:35:20 2020 |
tree | ef52636b5841806ff75f87ca426cc15f84d8e93c | |
parent | b7c712e5b3890201ef7f9114050070dea1eb8d12 [diff] |
Let StyleCascade own MatchResult and interpolations There is currently a bug where font-relative units in the base style are not responsive to font-affecting animations (even with issue 437689 fixed) _if_ the element hits the MatchedPropertiesCache. This can easily happen if two identical elements (with the same MatchResult) undergo the same CSS animation. The reason this bug exists is in StyleResolver:: CascadeAndApplyMatchedProperties. Notice that, when cache_success.IsFullCacheHit() is true in that function, we return immediately, and never Analyze the MatchResult. In other words, the MatchResult is _there_, fully populated (we're using it as the cache key after all), but we never let the StyleCascade actually Analyze it, which is the source of the bug. When we later apply animations (see StyleResolver::ApplyAnimatedStandardProperties), we Analyze the animations/transitions _only_. This was done on purpose, as too much Analyzing is expensive. Hence, during ApplyAnimatedStandardProperties, I assumed that either: - We would hit the base computed style optimization, and hence the MatchResult would be empty, and there is no need to analyze it, or - We would not hit the base computed style optimization, and the MatchResult object would be populated and Analyzed already. But of course, I forgot about the third option: based computed style optimization miss, but a hit on the matched properties cache. In that case the we have a non-empty MatchResult that haven't been Analyzed. To fix this, we could have simply Analyzed the MatchResult in ApplyAnimatedStandardProperties (potentially a second time). But this is inefficient. I don't want to do that. Instead, this CL moves the MatchResult ownership (and CascadeInterpolation ownership) to StyleCascade itself. It also adds flags which tells us what needs to be analyzed. Using this, we can now analyze-on-demand during Apply, which means we analyze exactly the amount we need to analyze, also in the case where an animation frame hits the MatchedProperties cache. It also makes for a far more sensible (but still not perfect) StyleCascade API, compared to "manually" analyzing. Note that this CL also removes filtering Analyze-time. This means that e.g. for ::marker, we add declarations to the CascadeMap that we know aren't going to be applied (as they are filtered in the Apply step). This is because analyze-on-demand is not easily compatible with this kind of filtering. For example, when dealing with inherited-only cache hits, we first try to apply the inherited properties only. If the font or zoom was modified, we need to apply the non-inherited properties after all. And for that second apply pass, we obviously need all properties to have been analyzed before, not just the inherited properties. Bug: 1065387, 437689 Change-Id: I7e9b7f33fc12f055603e789d3ae700d5a7a3dbbf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2124649 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#754457}
The web-platform-tests Project is a cross-browser test suite for the Web-platform stack. Writing tests in a way that allows them to be run in all browsers gives browser projects confidence that they are shipping software that is compatible with other implementations, and that later implementations will be compatible with their implementations. This in turn gives Web authors/developers confidence that they can actually rely on the Web platform to deliver on the promise of working across browsers and devices without needing extra layers of abstraction to paper over the gaps left by specification editors and implementors.
The most important sources of information and activity are:
#testing
on irc.w3.org; includes participants located around the world, but busiest during the European working day; all discussion is archived hereIf you'd like clarification about anything, don't hesitate to ask in the chat room or on the mailing list.
Clone or otherwise get https://github.com/web-platform-tests/wpt.
Note: because of the frequent creation and deletion of branches in this repo, it is recommended to “prune” stale branches when fetching updates, i.e. use git pull --prune
(or git fetch -p && git merge
).
See the documentation website and in particular the system setup for running tests locally.
The wpt
command provides a frontend to a variety of tools for working with and running web-platform-tests. Some of the most useful commands are:
wpt serve
- For starting the wpt http serverwpt run
- For running tests in a browserwpt lint
- For running the lint against all testswpt manifest
- For updating or generating a MANIFEST.json
test manifestwpt install
- For installing the latest release of a browser or webdriver server on the local machine.On Windows wpt
commands must be prefixed with python
or the path to the python binary (if python
is not in your %PATH%
).
python wpt [command]
Alternatively, you may also use Bash on Ubuntu on Windows in the Windows 10 Anniversary Update build, then access your windows partition from there to launch wpt
commands.
Please make sure git and your text editor do not automatically convert line endings, as it will cause lint errors. For git, please set git config core.autocrlf false
in your working tree.
The master branch is automatically synced to http://w3c-test.org/.
Pull requests are automatically mirrored except those that modify sensitive resources (such as .py
). The latter require someone with merge access to comment with “LGTM” or “w3c-test:mirror” to indicate the pull request has been checked.
In the vast majority of cases the only upstream branch that you should need to care about is master
. If you see other branches in the repository, you can generally safely ignore them.
Save the Web, Write Some Tests!
Absolutely everyone is welcome to contribute to test development. No test is too small or too simple, especially if it corresponds to something for which you've noted an interoperability bug in a browser.
The way to contribute is just as usual:
git checkout -b topic
../wpt lint
as described above.If you spot an issue with a test and are not comfortable providing a pull request per above to fix it, please file a new issue. Thank you!