mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Support image-set() on the cursor property
Differential Revision: https://phabricator.services.mozilla.com/D106745
This commit is contained in:
parent
e1f254854d
commit
685d269e31
4 changed files with 49 additions and 20 deletions
|
@ -61,15 +61,14 @@ impl<Image: ToCss> ToCss for Cursor<Image> {
|
|||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToComputedValue,
|
||||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C)]
|
||||
pub struct GenericCursorImage<ImageUrl, Number> {
|
||||
pub struct GenericCursorImage<Image, Number> {
|
||||
/// The url to parse images from.
|
||||
pub url: ImageUrl,
|
||||
pub image: Image,
|
||||
/// Whether the image has a hotspot or not.
|
||||
pub has_hotspot: bool,
|
||||
/// The x coordinate.
|
||||
|
@ -80,12 +79,12 @@ pub struct GenericCursorImage<ImageUrl, Number> {
|
|||
|
||||
pub use self::GenericCursorImage as CursorImage;
|
||||
|
||||
impl<ImageUrl: ToCss, Number: ToCss> ToCss for CursorImage<ImageUrl, Number> {
|
||||
impl<Image: ToCss, Number: ToCss> ToCss for CursorImage<Image, Number> {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
W: Write,
|
||||
{
|
||||
self.url.to_css(dest)?;
|
||||
self.image.to_css(dest)?;
|
||||
if self.has_hotspot {
|
||||
dest.write_str(" ")?;
|
||||
self.hotspot_x.to_css(dest)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue