geckolib: Return from Servo_ComputeColor whether the value was currentcolor.

MozReview-Commit-ID: CwOJrfBG12J
This commit is contained in:
Cameron McCormack 2017-11-24 11:28:34 +08:00
parent 3f0ccd0fef
commit cbba980a8b

View file

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