Perform quiet mutations on StyleSheetContents copy, if needed InspectorGhostRules quietly modifies stylesheets without invalidation, because we're guaranteed to end up back with the original state. It did not, however, account for the fact that multiple StyleSheetContents objects can be shared between CSSStyleSheets. Even "quiet" mutations must respect copy-on-write in that case, which is what this CL does: when we're about to quietly insert a rule, we first ensure that the StyleSheetContents isn't shared. This may cause the StyleSheetContents to copied, with the original contents held onto and ultimately restored by QuietMutationScope. Possible future improvements: - Caching the copied StyleSheetContents somewhere in InspectorCSSAgent. Might not help that much within a single call to getMatchedStylesForNode, but could help across multiple such calls. - Using QuietMutationScope as a "pass key" to the existing Quiet* API, to ensure that quiet mutations indeed take place during that scope. Fixed: 389011795 Change-Id: I37acfcf89c39e43575befb26cb395246e041d34c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6361495 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1434014}
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.