Simplify view-source line-wrapping implementation
Previously, we created a wrapper <div>, added an `id` attribute to the <input type=checkbox>, and added the corresponding `for` attribute to the <label>. This patch simplifies the implementation as follows: - We get rid of both the `id` and `for` attributes by wrapping the checkbox and the text label inside of the <label>. - We then also get rid of the wrapper <div>. This simplifies the code and reduces the resulting DOM size. This patch also improves the UI: now, the entire horizontal bar can be clicked to toggle the checkbox, as opposed to just the checkbox itself + the text label (whose length is variable, based on the user’s locale + font sizing/zoom preferences). Tests: autoninja -C out/Release blink_unittests out/Release/blink_unittests --gtest_filter=HTMLViewSourceDocumentTest.* Bug: chromium:920571 Change-Id: I42873f62d94b264a1b7edf3567e539301be07ed1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2598907 Commit-Queue: Mason Freed <masonfreed@chromium.org> Reviewed-by:Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#840782}
Showing
This diff is collapsed.
Please register or sign in to comment