[go: nahoru, domu]

Resolve internal forced colors properties before used value time

This CL moves the re-resolution of internal forced colors properties
(specifically 'internal-forced-color', 'internal-forced-visited-color'
and 'internal-forced-background-color') to occur before used value
time. This is necessary because work is being done to remove system
colors from being stored in the NativeTheme to being accessed from
color providers that are associated with the Page(see CL:4898493). To
access the color providers, we need to pass them from the document to
the LayoutTheme::SystemColor method.

However, this is problematic in StyleColor::Resolve, where we currently
pass a boolean flag(`is_forced_colors`) to resolve the initial values
for these forced color properties at used value time(see: CL:2529950).
This was done because the initial values for these properties are
defined as system colors in css_properties.json5
(e.g. StyleColor(CSSValueID::kCanvas)). These values are only computed
once, so we need to recompute them to ensure they pick up the correct
color on theme change.

We want to remove this flag to avoid resolving any system colors at
used value time, which will allow us to pass nullptr instead of a color
provider when resolving colors in StyleColor::Resolve, since we do not
have an easy way to access the provider at this point in the rendering
pipeline.

To solve this, we re-resolve the initial values of these properties in
the StyleAdjuster class to avoid the need for re-resolution at used
value time. Also, we propagate the `internal-forced-background-color`
from the root to the viewport when forced colors is enabled.

Bug: 1430181
Change-Id: I5c12bff59c8ae7d760ffc34dd6d4d2d050bf0019
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5181788
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Alison Maher <almaher@microsoft.com>
Commit-Queue: Sam Davis Omekara <samomekarajr@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1258657}
7 files changed
tree: a2f7db5d7d74ec8b2ff354e9dd6741f8475e1b6e
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. codelabs/
  13. components/
  14. content/
  15. courgette/
  16. crypto/
  17. dbus/
  18. device/
  19. docs/
  20. extensions/
  21. fuchsia_web/
  22. gin/
  23. google_apis/
  24. google_update/
  25. gpu/
  26. headless/
  27. infra/
  28. ios/
  29. ipc/
  30. media/
  31. mojo/
  32. native_client_sdk/
  33. net/
  34. pdf/
  35. ppapi/
  36. printing/
  37. remoting/
  38. rlz/
  39. sandbox/
  40. services/
  41. skia/
  42. sql/
  43. storage/
  44. styleguide/
  45. testing/
  46. third_party/
  47. tools/
  48. ui/
  49. url/
  50. webkit/
  51. .clang-format
  52. .clang-tidy
  53. .clangd
  54. .eslintrc.js
  55. .git-blame-ignore-revs
  56. .gitallowed
  57. .gitattributes
  58. .gitignore
  59. .gitmodules
  60. .gn
  61. .mailmap
  62. .rustfmt.toml
  63. .vpython3
  64. .yapfignore
  65. ATL_OWNERS
  66. AUTHORS
  67. BUILD.gn
  68. CODE_OF_CONDUCT.md
  69. codereview.settings
  70. DEPS
  71. DIR_METADATA
  72. LICENSE
  73. LICENSE.chromium_os
  74. OWNERS
  75. PRESUBMIT.py
  76. PRESUBMIT_test.py
  77. PRESUBMIT_test_mocks.py
  78. README.md
  79. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure.

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.