From cbba980a8b57f11cf3ac77362f5626aeff66df0b Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Fri, 24 Nov 2017 11:28:34 +0800 Subject: [PATCH 1/2] geckolib: Return from Servo_ComputeColor whether the value was currentcolor. MozReview-Commit-ID: CwOJrfBG12J --- ports/geckolib/glue.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index c0b60adaad5..f7733b37516 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -4559,6 +4559,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; @@ -4593,6 +4594,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, From c0dc50d90dc195d36b0ad61918d31b7ab6b2e85a Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sun, 26 Nov 2017 11:25:01 +0800 Subject: [PATCH 2/2] style: Update Gecko bindings. --- components/style/gecko/generated/bindings.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index 1e09fa42baf..aa320c6a495 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -1574,7 +1574,7 @@ extern "C" { } extern "C" { pub fn Servo_IsValidCSSColor ( value : * const nsAString , ) -> bool ; } extern "C" { - pub fn Servo_ComputeColor ( set : RawServoStyleSetBorrowedOrNull , current_color : nscolor , value : * const nsAString , result_color : * mut nscolor , ) -> bool ; + pub fn Servo_ComputeColor ( set : RawServoStyleSetBorrowedOrNull , current_color : nscolor , value : * const nsAString , result_color : * mut nscolor , was_current_color : * mut bool , ) -> bool ; } extern "C" { pub fn Servo_ParseIntersectionObserverRootMargin ( value : * const nsAString , result : * mut nsCSSRect , ) -> bool ; } extern "C" { @@ -1587,4 +1587,4 @@ extern "C" { pub fn Gecko_ContentList_AppendAll ( aContentList : * mut nsSimpleContentList , aElements : * mut * const RawGeckoElement , aLength : usize , ) ; } extern "C" { pub fn Gecko_GetElementsWithId ( aDocument : * const nsIDocument , aId : * mut nsAtom , ) -> * const nsTArray < * mut Element > ; -} \ No newline at end of file +}