| commit | 52aaff07c9a41b01aab583b0e9995b3802b134c9 | [log] [tgz] |
|---|---|---|
| author | Hewei Hewro <ihewro@gmail.com> | Wed Aug 27 04:29:35 2025 |
| committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Aug 27 04:29:35 2025 |
| tree | 6f76aa4f8a5ab63b16efffaa2eec5dbeeaba58b5 | |
| parent | 09146fd4de9acd62f1c77eab7b7d82c3d7fc3cba [diff] |
Optimize performance of StyleFromMatchedRulesForElement function During the cross-line text deletion process in the rich text editor, the StyleFromMatchedRulesForElement function retrieves a list of CSS rules for the selected area. The function internally uses the MergeAndOverrideOnConflict method, which has a time complexity of O(N^2). When there are numerous variables on the selected element or its ancestor elements, the MergeAndOverrideOnConflict function destroy temporary CSSPropertyName objects. To address this, unnecessary calls to CSSPropertyValue::Name() have been reduced. Furthermore, in the StyleFromMatchedRulesForElement function, initialize the style using the first matched_rule to reduce the number of merges, thereby decreasing the overall time consumption. Bug: 440387012 Change-Id: Id9c900072c7d31e079bf0a996c92470e22b8ac2a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6874842 Reviewed-by: Peng Zhou <zhoupeng.1996@bytedance.com> Reviewed-by: Dan Clark <daniec@microsoft.com> Commit-Queue: Peng Zhou <zhoupeng.1996@bytedance.com> Auto-Submit: hewro <ihewro@gmail.com> Cr-Commit-Position: refs/heads/main@{#1506901}
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.