style: Use serde to serialize LengthPercentage and StyleRayFunction.

We need to pass these two types into the compositor, so we need a better
way to serialize these rust types. We use serde and bincode to
serialize/deserialize them, and use ByteBuf to pass the &[u8] data
through IPC. We define StyleVecU8 for FFI usage only.

Differential Revision: https://phabricator.services.mozilla.com/D50688
This commit is contained in:
Boris Chiou 2019-10-31 21:35:05 +00:00 committed by Emilio Cobos Álvarez
parent d99606a841
commit 40ede5bacb
8 changed files with 18 additions and 8 deletions

View file

@ -507,7 +507,9 @@ pub mod specified {
/// Whether to allow negative lengths or not.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, PartialOrd, ToShmem)]
#[derive(
Clone, Copy, Debug, Deserialize, Eq, MallocSizeOf, PartialEq, PartialOrd, Serialize, ToShmem,
)]
pub enum AllowedNumericType {
/// Allow all kind of numeric values.
All,