[PEPC] Allow unbounded element width if the border is present
As per a developer's use case we want to relax the width restriction
if there is a border around the element that is sufficiently distinct
from the element's background color as this should provide sufficient
indication of the element's bounds and we're only restricting the width.
Therefore this CL adds a new member |unlimited_width_allowed_| which if
true means the width restrictions do not apply. The member is set to
false if any of the following:
- The border is not present
- The border is not wide enough
- The border's color contrast to the background-color is too low
- The border's color has an alpha channel value that is not 1
Since checking colors is not possible until the style has been
calculated, the last 2 have to be checked in |DidRecalcStyle| which
means that if the value of |unlimited_width_allowed_| changes there, it
results in style invalidation. There should not be a recursion issue
since all that can change is the width bounds which can not result in
further changes to |unlimited_width_allowed_|. And for developers this
should be fine as they should expect to set a bounded width if they
don't plan to use borders.
In addition this CL uses the correct CSS property of 'border' instead
of 'outline' to create the default element border. This means that
for some tests, the 'border' needs to be set back to 'none' as they
are testing the no-border width restrictions.
Fixed: 352005178
Fixed: 368030838
Change-Id: I5a6140aa3eea026b56f9a7e2eb4c3bcbb8d2aed1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912759
Reviewed-by: Anders Hartvoll Ruud andruud@chromium.org
Commit-Queue: Andy Paicu andypaicu@chromium.org
Cr-Commit-Position: refs/heads/main@{#1366158}