mirror of
https://github.com/servo/servo.git
synced 2025-10-01 00:59:15 +01:00
style: Handle keywords for color values.
Bug: 1434130 Reviewed-by: emilio MozReview-Commit-ID: 5GvIHSeQuCX
This commit is contained in:
parent
20398491cc
commit
0021c70c08
2 changed files with 21 additions and 3 deletions
|
@ -1012,9 +1012,18 @@ pub unsafe extern "C" fn Servo_Property_GetCSSValuesForProperty(
|
|||
let mut values = BTreeSet::<&'static str>::new();
|
||||
prop_id.collect_property_completion_keywords(&mut |list| values.extend(list.iter()));
|
||||
|
||||
let mut extras = vec![];
|
||||
if values.contains("transparent") {
|
||||
// This is a special value devtools use to avoid inserting the
|
||||
// long list of color keywords. We need to prepend it to values.
|
||||
extras.push("COLOR");
|
||||
}
|
||||
|
||||
let result = result.as_mut().unwrap();
|
||||
bindings::Gecko_ResizeTArrayForStrings(result, values.len() as u32);
|
||||
for (src, dest) in values.iter().zip(result.iter_mut()) {
|
||||
let len = extras.len() + values.len();
|
||||
bindings::Gecko_ResizeTArrayForStrings(result, len as u32);
|
||||
|
||||
for (src, dest) in extras.iter().chain(values.iter()).zip(result.iter_mut()) {
|
||||
dest.write_str(src).unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue