Revert remaining Stylo changes (#31408)

* Revert remaining changes from Stylo split-into-commits branch

* Do the minimum amount of formatting to appease mach test-tidy
This commit is contained in:
Delan Azabani 2024-02-22 17:56:26 +08:00 committed by GitHub
parent 1c2de6dd1d
commit f60e5e767b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 51 additions and 79 deletions

1
Cargo.lock generated
View file

@ -3492,7 +3492,6 @@ dependencies = [
"cssparser", "cssparser",
"euclid", "euclid",
"http", "http",
"hyper_serde",
"indexmap 2.2.3", "indexmap 2.2.3",
"keyboard-types", "keyboard-types",
"selectors", "selectors",

View file

@ -5,11 +5,11 @@
use darling::{FromDeriveInput, FromField, FromVariant}; use darling::{FromDeriveInput, FromField, FromVariant};
use proc_macro2::{Span, TokenStream}; use proc_macro2::{Span, TokenStream};
use quote::TokenStreamExt; use quote::TokenStreamExt;
use syn::{ use syn::{self, AngleBracketedGenericArguments, AssocType, DeriveInput, Field};
self, AngleBracketedGenericArguments, AssocType, DeriveInput, Field, GenericArgument, use syn::{GenericArgument, GenericParam, Ident, Path};
GenericParam, Ident, Path, PathArguments, PathSegment, QSelf, Type, TypeArray, TypeGroup, use syn::{PathArguments, PathSegment, QSelf, Type, TypeArray, TypeGroup};
TypeParam, TypeParen, TypePath, TypeSlice, TypeTuple, Variant, WherePredicate, use syn::{TypeParam, TypeParen, TypePath, TypeSlice, TypeTuple};
}; use syn::{Variant, WherePredicate};
use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo}; use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo};
/// Given an input type which has some where clauses already, like: /// Given an input type which has some where clauses already, like:

View file

@ -0,0 +1 @@
disable_all_formatting = true

View file

@ -14,7 +14,6 @@ servo = [
"content-security-policy", "content-security-policy",
"crossbeam-channel", "crossbeam-channel",
"http", "http",
"hyper_serde",
"keyboard-types", "keyboard-types",
"serde", "serde",
"serde_bytes", "serde_bytes",
@ -34,10 +33,9 @@ crossbeam-channel = { workspace = true, optional = true }
cssparser = { workspace = true } cssparser = { workspace = true }
euclid = { workspace = true } euclid = { workspace = true }
http = { workspace = true, optional = true } http = { workspace = true, optional = true }
hyper_serde = { workspace = true, optional = true }
indexmap = { workspace = true } indexmap = { workspace = true }
keyboard-types = { workspace = true, optional = true } keyboard-types = { workspace = true, optional = true }
selectors = { path = "../selectors", features = ["shmem"] } selectors = { path = "../selectors" }
serde = { workspace = true, optional = true } serde = { workspace = true, optional = true }
serde_bytes = { workspace = true, optional = true } serde_bytes = { workspace = true, optional = true }
servo_arc = { path = "../servo_arc" } servo_arc = { path = "../servo_arc" }
@ -46,7 +44,7 @@ smallvec = { workspace = true }
string_cache = { workspace = true, optional = true } string_cache = { workspace = true, optional = true }
thin-vec = { workspace = true } thin-vec = { workspace = true }
time = { workspace = true, optional = true } time = { workspace = true, optional = true }
tokio = { workspace = true } tokio = { workspace = true, features = ["sync"] }
url = { workspace = true, optional = true } url = { workspace = true, optional = true }
uuid = { workspace = true, optional = true } uuid = { workspace = true, optional = true }
void = "1.0.2" void = "1.0.2"

View file

@ -81,24 +81,18 @@ extern crate webrender_api;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
extern crate xml5ever; extern crate xml5ever;
use std::hash::{BuildHasher, Hash};
use std::mem::size_of;
use std::ops::{Deref, DerefMut, Range};
use std::os::raw::c_void;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
use content_security_policy as csp; use content_security_policy as csp;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
use serde_bytes::ByteBuf; use serde_bytes::ByteBuf;
use std::hash::{BuildHasher, Hash};
use std::mem::size_of;
use std::ops::Range;
use std::ops::{Deref, DerefMut};
use std::os::raw::c_void;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
use uuid::Uuid; use uuid::Uuid;
use void::Void; use void::Void;
use webrender_api::{
BorderRadius, BorderStyle, BoxShadowClipMode, ColorF, ComplexClipRegion, ExtendMode,
ExternalScrollId, FilterOp, FontInstanceKey, GlyphInstance, GradientStop, ImageKey,
ImageRendering, LineStyle, MixBlendMode, NinePatchBorder, NormalBorder, RepeatMode,
StickyOffsetBounds, TransformStyle,
};
/// A C function that takes a pointer to a heap allocation and returns its size. /// A C function that takes a pointer to a heap allocation and returns its size.
type VoidPtrToSizeFn = unsafe extern "C" fn(ptr: *const c_void) -> usize; type VoidPtrToSizeFn = unsafe extern "C" fn(ptr: *const c_void) -> usize;
@ -863,45 +857,45 @@ impl MallocSizeOf for url::Host {
} }
} }
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(BorderRadius); malloc_size_of_is_0!(webrender_api::BorderRadius);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(BorderStyle); malloc_size_of_is_0!(webrender_api::BorderStyle);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(BoxShadowClipMode); malloc_size_of_is_0!(webrender_api::BoxShadowClipMode);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(ColorF); malloc_size_of_is_0!(webrender_api::ColorF);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(ComplexClipRegion); malloc_size_of_is_0!(webrender_api::ComplexClipRegion);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(ExtendMode); malloc_size_of_is_0!(webrender_api::ExtendMode);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(FilterOp); malloc_size_of_is_0!(webrender_api::FilterOp);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(ExternalScrollId); malloc_size_of_is_0!(webrender_api::ExternalScrollId);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(FontInstanceKey); malloc_size_of_is_0!(webrender_api::FontInstanceKey);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(GradientStop); malloc_size_of_is_0!(webrender_api::GradientStop);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(GlyphInstance); malloc_size_of_is_0!(webrender_api::GlyphInstance);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(NinePatchBorder); malloc_size_of_is_0!(webrender_api::NinePatchBorder);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(ImageKey); malloc_size_of_is_0!(webrender_api::ImageKey);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(ImageRendering); malloc_size_of_is_0!(webrender_api::ImageRendering);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(LineStyle); malloc_size_of_is_0!(webrender_api::LineStyle);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(MixBlendMode); malloc_size_of_is_0!(webrender_api::MixBlendMode);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(NormalBorder); malloc_size_of_is_0!(webrender_api::NormalBorder);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(RepeatMode); malloc_size_of_is_0!(webrender_api::RepeatMode);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(StickyOffsetBounds); malloc_size_of_is_0!(webrender_api::StickyOffsetBounds);
#[cfg(feature = "webrender_api")] #[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(TransformStyle); malloc_size_of_is_0!(webrender_api::TransformStyle);
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
impl MallocSizeOf for keyboard_types::Key { impl MallocSizeOf for keyboard_types::Key {
@ -934,18 +928,6 @@ malloc_size_of_is_0!(std::time::SystemTime);
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
malloc_size_of_is_0!(std::time::Instant); malloc_size_of_is_0!(std::time::Instant);
#[cfg(feature = "servo")]
impl<T> MallocSizeOf for hyper_serde::Serde<T>
where
for<'de> hyper_serde::De<T>: serde::Deserialize<'de>,
for<'a> hyper_serde::Ser<'a, T>: serde::Serialize,
T: MallocSizeOf,
{
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
self.0.size_of(ops)
}
}
// Placeholder for unique case where internals of Sender cannot be measured. // Placeholder for unique case where internals of Sender cannot be measured.
// malloc size of is 0 macro complains about type supplied! // malloc size of is 0 macro complains about type supplied!
#[cfg(feature = "servo")] #[cfg(feature = "servo")]

View file

@ -87,7 +87,7 @@ ref_filter_map = "1.0.1"
regex = { workspace = true } regex = { workspace = true }
script_layout_interface = { workspace = true } script_layout_interface = { workspace = true }
script_traits = { workspace = true } script_traits = { workspace = true }
selectors = { path = "../selectors", features = ["shmem"] } selectors = { path = "../selectors" }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
serde_bytes = { workspace = true } serde_bytes = { workspace = true }
servo-media = { git = "https://github.com/servo/media" } servo-media = { git = "https://github.com/servo/media" }

View file

@ -16,7 +16,6 @@ path = "lib.rs"
[features] [features]
bench = [] bench = []
shmem = ["dep:to_shmem", "dep:to_shmem_derive"]
[dependencies] [dependencies]
bitflags = "1.0" bitflags = "1.0"
@ -30,8 +29,8 @@ precomputed-hash = "0.1"
servo_arc = { version = "0.2", path = "../servo_arc" } servo_arc = { version = "0.2", path = "../servo_arc" }
size_of_test = { path = "../size_of_test" } size_of_test = { path = "../size_of_test" }
smallvec = "1.0" smallvec = "1.0"
to_shmem = { version = "0.0.1", path = "../to_shmem", optional = true } to_shmem = { version = "0.0.1", path = "../to_shmem" }
to_shmem_derive = { version = "0.0.1", path = "../to_shmem_derive", optional = true } to_shmem_derive = { version = "0.0.1", path = "../to_shmem_derive" }
[build-dependencies] [build-dependencies]
phf_codegen = "0.10" phf_codegen = "0.10"

View file

@ -28,7 +28,7 @@ net_traits = { workspace = true }
profile_traits = { workspace = true } profile_traits = { workspace = true }
range = { path = "../../range" } range = { path = "../../range" }
script_traits = { workspace = true } script_traits = { workspace = true }
selectors = { path = "../../selectors", features = ["shmem"] } selectors = { path = "../../selectors" }
servo_arc = { path = "../../servo_arc" } servo_arc = { path = "../../servo_arc" }
servo_atoms = { path = "../../atoms" } servo_atoms = { path = "../../atoms" }
servo_url = { path = "../../url" } servo_url = { path = "../../url" }

View file

@ -64,7 +64,7 @@ owning_ref = "0.4"
parking_lot = "0.12" parking_lot = "0.12"
precomputed-hash = "0.1.1" precomputed-hash = "0.1.1"
rayon = "1" rayon = "1"
selectors = { path = "../selectors", features = ["shmem"] } selectors = { path = "../selectors" }
serde = { version = "1.0", optional = true, features = ["derive"] } serde = { version = "1.0", optional = true, features = ["derive"] }
servo_arc = { path = "../servo_arc" } servo_arc = { path = "../servo_arc" }
servo_atoms = { path = "../atoms", optional = true } servo_atoms = { path = "../atoms", optional = true }
@ -75,15 +75,15 @@ static_assertions = "1.1"
static_prefs = { path = "../style_static_prefs" } static_prefs = { path = "../style_static_prefs" }
string_cache = { version = "0.8", optional = true } string_cache = { version = "0.8", optional = true }
style_derive = { path = "../style_derive" } style_derive = { path = "../style_derive" }
style_traits = { workspace = true } style_traits = { path = "../style_traits" }
time = "0.1" time = "0.1"
thin-vec = { workspace = true } thin-vec = { workspace = true }
to_shmem = { path = "../to_shmem" } to_shmem = { path = "../to_shmem" }
to_shmem_derive = { path = "../to_shmem_derive" } to_shmem_derive = { path = "../to_shmem_derive" }
url = { workspace = true, optional = true, features = ["serde"] }
uluru = "3.0" uluru = "3.0"
unicode-bidi = "0.3" unicode-bidi = "0.3"
unicode-segmentation = "1.0" unicode-segmentation = "1.0"
url = { workspace = true, optional = true }
void = "1.0.2" void = "1.0.2"
[build-dependencies] [build-dependencies]

View file

@ -14,7 +14,7 @@ use crate::{Atom, LocalName, Namespace, ShrinkIfNeeded};
use selectors::attr::NamespaceConstraint; use selectors::attr::NamespaceConstraint;
use selectors::parser::{Combinator, Component}; use selectors::parser::{Combinator, Component};
use selectors::parser::{Selector, SelectorIter}; use selectors::parser::{Selector, SelectorIter};
use selectors::visitor::{SelectorVisitor, SelectorListKind}; use selectors::visitor::{SelectorListKind, SelectorVisitor};
use smallvec::SmallVec; use smallvec::SmallVec;
use style_traits::dom::{DocumentState, ElementState}; use style_traits::dom::{DocumentState, ElementState};

View file

@ -27,10 +27,10 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"list-style-type", "list-style-type",
"""disc none circle square disclosure-open disclosure-closed """disc none circle square disclosure-open disclosure-closed
decimal lower-alpha upper-alpha arabic-indic bengali cambodian cjk-decimal devanagari decimal lower-alpha upper-alpha arabic-indic bengali cambodian cjk-decimal devanagari
gujarati gurmukhi kannada khmer lao malayalam mongolian myanmar oriya persian telugu gujarati gurmukhi kannada khmer lao malayalam mongolian myanmar oriya persian telugu
thai tibetan cjk-earthly-branch cjk-heavenly-stem lower-greek hiragana hiragana-iroha thai tibetan cjk-earthly-branch cjk-heavenly-stem lower-greek hiragana hiragana-iroha
katakana katakana-iroha katakana katakana-iroha
""", """,
engines="servo", engines="servo",
animation_value_type="discrete", animation_value_type="discrete",

View file

@ -31,8 +31,7 @@ use crate::stylesheets::{
}; };
use crate::values::computed::font::FamilyName; use crate::values::computed::font::FamilyName;
use crate::values::{CssUrl, CustomIdent, DashedIdent, KeyframesName}; use crate::values::{CssUrl, CustomIdent, DashedIdent, KeyframesName};
use crate::Atom; use crate::{Atom, Namespace, Prefix};
use crate::{Namespace, Prefix};
use cssparser::{ use cssparser::{
AtRuleParser, BasicParseError, BasicParseErrorKind, CowRcStr, DeclarationParser, Parser, AtRuleParser, BasicParseError, BasicParseErrorKind, CowRcStr, DeclarationParser, Parser,
ParserState, QualifiedRuleParser, RuleBodyItemParser, RuleBodyParser, SourceLocation, ParserState, QualifiedRuleParser, RuleBodyItemParser, RuleBodyParser, SourceLocation,

View file

@ -1591,7 +1591,7 @@ macro_rules! impl_variant_numeric {
} => { } => {
bitflags! { bitflags! {
#[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)] #[derive(MallocSizeOf, ToComputedValue, ToResolvedValue, ToShmem)]
/// Vairants of numeric values /// Variants of numeric values
pub struct FontVariantNumeric: u8 { pub struct FontVariantNumeric: u8 {
/// None of other variants are enabled. /// None of other variants are enabled.
const NORMAL = 0; const NORMAL = 0;

View file

@ -370,15 +370,9 @@ impl Side for VerticalPositionKeyword {
} }
bitflags! { bitflags! {
/// Controls how the auto-placement algorithm works /// Controls how the auto-placement algorithm works specifying exactly how auto-placed items
/// specifying exactly how auto-placed items get flowed into the grid /// get flowed into the grid.
#[derive( #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
MallocSizeOf,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem
)]
#[value_info(other_values = "row,column,dense")] #[value_info(other_values = "row,column,dense")]
#[repr(C)] #[repr(C)]
pub struct GridAutoFlow: u8 { pub struct GridAutoFlow: u8 {

View file

@ -16,7 +16,7 @@ euclid = { workspace = true }
html5ever = { workspace = true } html5ever = { workspace = true }
rayon = { workspace = true } rayon = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
selectors = {path = "../../../components/selectors", features = ["shmem"] } selectors = {path = "../../../components/selectors" }
servo_arc = {path = "../../../components/servo_arc"} servo_arc = {path = "../../../components/servo_arc"}
servo_atoms = {path = "../../../components/atoms"} servo_atoms = {path = "../../../components/atoms"}
servo_config = {path = "../../../components/config"} servo_config = {path = "../../../components/config"}