diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-11-22 19:42:58 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-22 19:42:58 -0600 |
commit | 72e7f6095e56ca6230651fc73bced8b460487569 (patch) | |
tree | 77960f33893e08955e961f7e26b49b4b27a28872 /components/script/dom/cssmediarule.rs | |
parent | 976f9e3d13b6a7676dd863dd397dd6c60e868d58 (diff) | |
parent | 05c4e08d588af26f9550633362879d8c8153c5ea (diff) | |
download | servo-72e7f6095e56ca6230651fc73bced8b460487569.tar.gz servo-72e7f6095e56ca6230651fc73bced8b460487569.zip |
Auto merge of #19330 - Eijebong:sanitize_color, r=KiChjang
Add a sanitize_value implementation for the color input
I had to change the test a little bit to avoid some failures due to
color and text both having a sanitizedValue which was making the test
use the first assertion instead of the second one in some cases.
The sanitize_value implementation is pretty simple, we iterate over the
content and checks that the content is 7 characters long, that the first
character is a `#` and then that all the following characters are
hexadecimal. If all those requirements are met, we lowercase the
content, otherwise we put `#000000` in it.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19330)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/cssmediarule.rs')
0 files changed, 0 insertions, 0 deletions