mirror of
https://github.com/servo/servo.git
synced 2025-07-09 16:33:40 +01:00
geckolib: Return from Servo_ComputeColor whether the value was currentcolor.
This commit is contained in:
parent
5bfab782ec
commit
393ab5ab1e
1 changed files with 6 additions and 0 deletions
|
@ -4577,6 +4577,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;
|
||||||
|
|
||||||
|
@ -4611,6 +4612,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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue