#15842 Add gecko glue for caret-color.

Implement from(StyleComplexColor) for ColorOrAuto. Thanks @emilio. (+4 squashed commits)
Squashed commits:
[baf7cc0] Add clone to caret-color
[9cb82ca] Correctly call methods to copy a color in a SympleComplexColor and getting its auto
[c483f07] Add set and copy functions for caret_color
[0aa20be] Move caret-color and set its product property to gecko
This commit is contained in:
Stefano Chiodino 2017-03-09 13:51:04 +00:00
parent e34aac03ff
commit f195b247c0
4 changed files with 50 additions and 13 deletions

View file

@ -43,7 +43,7 @@ use gecko_bindings::bindings::Gecko_SetNullImageValue;
use gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom};
use gecko_bindings::bindings::RawGeckoPresContextBorrowed;
use gecko_bindings::structs;
use gecko_bindings::structs::{self, StyleComplexColor};
use gecko_bindings::structs::nsStyleVariables;
use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut};
use gecko_bindings::sugar::ownership::HasArcFFI;
@ -3095,7 +3095,7 @@ clip-path
</%self:impl_trait>
<%self:impl_trait style_struct_name="Pointing"
skip_longhands="cursor">
skip_longhands="cursor caret-color">
pub fn set_cursor(&mut self, v: longhands::cursor::computed_value::T) {
use properties::longhands::cursor::computed_value::Keyword;
use style_traits::cursor::Cursor;
@ -3162,6 +3162,26 @@ clip-path
Gecko_CopyCursorArrayFrom(&mut self.gecko, &other.gecko);
}
}
pub fn set_caret_color(&mut self, v: longhands::caret_color::computed_value::T){
use values::Either;
match v {
Either::First(color) => {
self.gecko.mCaretColor = StyleComplexColor::from(color);
}
Either::Second(_auto) => {
self.gecko.mCaretColor = StyleComplexColor::auto();
}
}
}
pub fn copy_caret_color_from(&mut self, other: &Self){
self.gecko.mCaretColor = other.gecko.mCaretColor;
}
<%call expr="impl_color_clone('caret_color', 'mCaretColor')"></%call>
</%self:impl_trait>
<%self:impl_trait style_struct_name="Column"