geckolib: Return from Servo_ComputeColor whether the value was currentcolor.

This commit is contained in:
Cameron McCormack 2017-11-24 11:28:34 +08:00
parent 5bfab782ec
commit 393ab5ab1e

View file

@ -4577,6 +4577,7 @@ pub extern "C" fn Servo_ComputeColor(
current_color: structs::nscolor,
value: *const nsAString,
result_color: *mut structs::nscolor,
was_current_color: *mut bool,
) -> bool {
use style::gecko;
@ -4611,6 +4612,11 @@ pub extern "C" fn Servo_ComputeColor(
Some(computed_color) => {
let rgba = computed_color.to_rgba(current_color);
*result_color = gecko::values::convert_rgba_to_nscolor(&rgba);
if !was_current_color.is_null() {
unsafe {
*was_current_color = computed_color.is_currentcolor();
}
}
true
}
None => false,