Make DOM Distiller's font and theme code more resilient.
The existing code relies on the document body's class list following a specific format. This CL allows for an arbitrary class list, which in turn makes it easier to update the theme on other elements. (This will be needed for the appearance settings, assuming the settings are put in the web contents.) This CL also reworks how the JS font/theme maps to the CSS font/theme. The JS and CSS strings are always the same, so we can just verify that the JS string is one of the expected ones before returning it. The associated browser tests are also modified to no longer expect a specific class order. Monospace is used instead of serif to make substring matching less complicated. Bug: 952034 Change-Id: I99d61dd3a3edcfe66f52169309105d1e235b937a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1684251Reviewed-by:Wei-Yin Chen (陳威尹) <wychen@chromium.org> Commit-Queue: Aran Gilman <gilmanmh@google.com> Cr-Commit-Position: refs/heads/master@{#676064}
Showing
Please register or sign in to comment