aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-11-25 21:25:16 -0600
committerGitHub <noreply@github.com>2017-11-25 21:25:16 -0600
commitb8b5c5371f66a95da9ffb238cba2c549f4c85f59 (patch)
treeb3bb6c4fdfccc39a6070e9265e2385dfccf44377
parent3f0ccd0fef1ad108a22c731e399aa815d0af5441 (diff)
parentc0dc50d90dc195d36b0ad61918d31b7ab6b2e85a (diff)
downloadservo-b8b5c5371f66a95da9ffb238cba2c549f4c85f59.tar.gz
servo-b8b5c5371f66a95da9ffb238cba2c549f4c85f59.zip
Auto merge of #19374 - heycam:compute-color, r=TYLin
geckolib: Return from Servo_ComputeColor whether the value was currentcolor. Servo part of https://bugzilla.mozilla.org/show_bug.cgi?id=1420026, reviewed there by TYLin. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19374) <!-- Reviewable:end -->
-rw-r--r--components/style/gecko/generated/bindings.rs4
-rw-r--r--ports/geckolib/glue.rs6
2 files changed, 8 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
+}
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,