Skip to content

Commit 8de64b2

Browse files
committed
servo: Merge #12263 - Make geckolib possible to build on stable Rust (from servo:stable-geckolib); r=nox
<!-- Please describe your changes on the following line: --> More for servo/servo#11815 r? nox --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 3d557b6f25eb9dbd084cb53bbc9a9cf93bad825b UltraBlame original commit: 0563b21dfecef0e2f3f04f56f4f108a5dcbe85ec
1 parent 246b77f commit 8de64b2

File tree

6 files changed

+28
-14
lines changed

6 files changed

+28
-14
lines changed

servo/components/style/keyframes.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use std::sync::Arc;
1010

1111

1212

13-
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, HeapSizeOf)]
13+
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
14+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
1415
pub struct KeyframePercentage(pub f32);
1516

1617
impl ::std::cmp::Ord for KeyframePercentage {
@@ -49,7 +50,8 @@ impl KeyframePercentage {
4950

5051

5152

52-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
53+
#[derive(Debug, Clone, PartialEq)]
54+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
5355
pub struct KeyframeSelector(Vec<KeyframePercentage>);
5456
impl KeyframeSelector {
5557
#[inline]
@@ -64,7 +66,8 @@ impl KeyframeSelector {
6466
}
6567

6668

67-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
69+
#[derive(Debug, Clone, PartialEq)]
70+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
6871
pub struct Keyframe {
6972
pub selector: KeyframeSelector,
7073
pub declarations: Arc<Vec<PropertyDeclaration>>,
@@ -95,14 +98,16 @@ impl Keyframe {
9598

9699

97100

98-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
101+
#[derive(Debug, Clone, PartialEq)]
102+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
99103
pub enum KeyframesStepValue {
100104
Declarations(Arc<Vec<PropertyDeclaration>>),
101105
ComputedValues,
102106
}
103107

104108

105-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
109+
#[derive(Debug, Clone, PartialEq)]
110+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
106111
pub struct KeyframesStep {
107112

108113
pub start_percentage: KeyframePercentage,
@@ -126,7 +131,8 @@ impl KeyframesStep {
126131

127132

128133

129-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
134+
#[derive(Debug, Clone, PartialEq)]
135+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
130136
pub struct KeyframesAnimation {
131137
pub steps: Vec<KeyframesStep>,
132138

servo/components/style/properties/helpers.mako.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@
206206
use cssparser::ToCss;
207207
use std::fmt;
208208

209-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
209+
#[derive(Debug, Clone, PartialEq)]
210+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
210211
pub struct T(pub Vec<${to_camel_case(name)}>);
211212

212213
impl ToCss for T {

servo/components/style/properties/helpers/animated_properties.mako.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ use values::computed::{CalcLengthOrPercentage, LengthOrPercentage};
3434

3535

3636

37-
#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf)]
37+
#[derive(Copy, Clone, Debug, PartialEq)]
38+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
3839
pub enum TransitionProperty {
3940
All,
4041
% for prop in data.longhands:
@@ -92,7 +93,8 @@ impl ToCss for TransitionProperty {
9293
}
9394
}
9495

95-
#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
96+
#[derive(Clone, Debug, PartialEq)]
97+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
9698
pub enum AnimatedProperty {
9799
% for prop in data.longhands:
98100
% if prop.animatable:

servo/components/style/properties/longhand/box.mako.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
618618

619619
pub use string_cache::Atom as SingleComputedValue;
620620

621-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
621+
#[derive(Debug, Clone, PartialEq)]
622+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
622623
pub struct T(pub Vec<Atom>);
623624

624625
impl ToCss for T {
@@ -683,7 +684,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
683684

684685
pub use self::AnimationIterationCount as SingleComputedValue;
685686

686-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
687+
#[derive(Debug, Clone, PartialEq)]
688+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
687689
pub enum AnimationIterationCount {
688690
Number(u32),
689691
Infinite,
@@ -698,7 +700,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
698700
}
699701
}
700702

701-
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
703+
#[derive(Debug, Clone, PartialEq)]
704+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
702705
pub struct T(pub Vec<AnimationIterationCount>);
703706

704707
impl ToCss for T {

servo/components/style/stylesheets.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ pub enum CSSRule<Impl: SelectorImpl> {
6767
}
6868

6969

70-
#[derive(Debug, HeapSizeOf, PartialEq)]
70+
#[derive(Debug, PartialEq)]
71+
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
7172
pub struct KeyframesRule {
7273
pub name: Atom,
7374
pub keyframes: Vec<Keyframe>,

servo/ports/geckolib/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ default = ["servo_features"]
1818
# recompiled when building both Servo and geckolib in the same source tree.
1919
servo_features = [
2020
"heapsize",
21+
"selectors/unstable",
2122
"style/servo",
2223
"time",
2324
"url/query_encoding",
@@ -36,7 +37,7 @@ lazy_static = "0.2"
3637
libc = "0.2"
3738
log = {version = "0.3.5", features = ["release_max_level_info"]}
3839
num_cpus = "0.2.2"
39-
selectors = {version = "0.6", features = ["unstable"]}
40+
selectors = "0.6"
4041
smallvec = "0.1"
4142
string_cache = {version = "0.2.20", features = ["unstable"]}
4243
style = {path = "../../components/style", features = ["gecko"]}

0 commit comments

Comments
 (0)