Skip to content

Commit 85ebfd8

Browse files
delanLoirooriol
authored andcommitted
Commit our changes on top of upstream Stylo
This is a rebase of 816c355 Signed-off-by: Oriol Brufau <[email protected]>
1 parent 81ef38e commit 85ebfd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+883
-169
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/_filtered/
33
/target/
44
/style/properties/__pycache__/
5+
Cargo.lock

Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[workspace]
2+
resolver = "2"
3+
members = [
4+
"dom",
5+
"malloc_size_of",
6+
"rustfmt.toml",
7+
"selectors",
8+
"servo_arc",
9+
"style",
10+
"style_derive",
11+
"style_static_prefs",
12+
"style_traits",
13+
"to_shmem",
14+
"to_shmem_derive",
15+
]
16+
default-members = ["style"]

atoms/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "servo_atoms"
3+
version = "0.0.1"
4+
authors = ["The Servo Project Developers"]
5+
license = "MPL-2.0"
6+
edition = "2018"
7+
publish = false
8+
build = "build.rs"
9+
10+
[lib]
11+
path = "lib.rs"
12+
13+
[dependencies]
14+
string_cache = "0.8"
15+
16+
[build-dependencies]
17+
string_cache_codegen = "0.5"

atoms/build.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4+
5+
use std::env;
6+
use std::fs::File;
7+
use std::io::{BufRead, BufReader};
8+
use std::path::Path;
9+
10+
fn main() {
11+
let static_atoms =
12+
Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("static_atoms.txt");
13+
let static_atoms = BufReader::new(File::open(&static_atoms).unwrap());
14+
let mut atom_type = string_cache_codegen::AtomType::new("Atom", "atom!");
15+
16+
macro_rules! predefined {
17+
($($name: expr,)+) => {
18+
{
19+
$(
20+
atom_type.atom($name);
21+
)+
22+
}
23+
}
24+
}
25+
include!("../style/counter_style/predefined.rs");
26+
27+
atom_type
28+
.atoms(static_atoms.lines().map(Result::unwrap))
29+
.write_to_file(&Path::new(&env::var_os("OUT_DIR").unwrap()).join("atom.rs"))
30+
.unwrap();
31+
}

atoms/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4+
5+
include!(concat!(env!("OUT_DIR"), "/atom.rs"));

atoms/static_atoms.txt

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
-moz-content-preferred-color-scheme
2+
-moz-device-pixel-ratio
3+
-moz-fixed-pos-containing-block
4+
-moz-gtk-csd-close-button-position
5+
-moz-gtk-csd-maximize-button-position
6+
-moz-gtk-csd-menu-radius
7+
-moz-gtk-csd-minimize-button-position
8+
-moz-gtk-csd-titlebar-button-spacing
9+
-moz-gtk-csd-titlebar-radius
10+
-moz-gtk-menu-radius
11+
-moz-mac-titlebar-height
12+
-moz-overlay-scrollbar-fade-duration
13+
DOMContentLoaded
14+
abort
15+
activate
16+
addtrack
17+
animationcancel
18+
animationend
19+
animationiteration
20+
animationstart
21+
aspect-ratio
22+
beforeunload
23+
block-size
24+
button
25+
canplay
26+
canplaythrough
27+
center
28+
change
29+
characteristicvaluechanged
30+
checkbox
31+
cancel
32+
click
33+
close
34+
closing
35+
color
36+
complete
37+
compositionend
38+
compositionstart
39+
compositionupdate
40+
controllerchange
41+
cursive
42+
dark
43+
datachannel
44+
date
45+
datetime-local
46+
dir
47+
device-pixel-ratio
48+
durationchange
49+
email
50+
emptied
51+
end
52+
ended
53+
error
54+
fantasy
55+
fetch
56+
file
57+
fill
58+
fill-opacity
59+
formdata
60+
fullscreenchange
61+
fullscreenerror
62+
gattserverdisconnected
63+
hashchange
64+
height
65+
hidden
66+
icecandidate
67+
iceconnectionstatechange
68+
icegatheringstatechange
69+
image
70+
inline-size
71+
input
72+
inputsourceschange
73+
invalid
74+
keydown
75+
keypress
76+
kind
77+
left
78+
light
79+
ltr
80+
load
81+
loadeddata
82+
loadedmetadata
83+
loadend
84+
loadstart
85+
message
86+
message
87+
messageerror
88+
monospace
89+
month
90+
mousedown
91+
mousemove
92+
mouseover
93+
mouseup
94+
negotiationneeded
95+
none
96+
normal
97+
number
98+
onchange
99+
open
100+
orientation
101+
pagehide
102+
pageshow
103+
password
104+
pause
105+
play
106+
playing
107+
popstate
108+
postershown
109+
prefers-color-scheme
110+
print
111+
progress
112+
radio
113+
range
114+
ratechange
115+
readystatechange
116+
referrer
117+
reftest-wait
118+
rejectionhandled
119+
removetrack
120+
reset
121+
resize
122+
resolution
123+
resourcetimingbufferfull
124+
right
125+
rtl
126+
sans-serif
127+
safe-area-inset-top
128+
safe-area-inset-bottom
129+
safe-area-inset-left
130+
safe-area-inset-right
131+
scan
132+
screen
133+
scroll-position
134+
scrollbar-inline-size
135+
search
136+
seeked
137+
seeking
138+
select
139+
selectend
140+
selectionchange
141+
selectstart
142+
serif
143+
sessionavailable
144+
signalingstatechange
145+
slotchange
146+
squeeze
147+
squeezeend
148+
squeezestart
149+
srclang
150+
statechange
151+
stroke
152+
stroke-opacity
153+
storage
154+
submit
155+
suspend
156+
system-ui
157+
tel
158+
text
159+
time
160+
timeupdate
161+
toggle
162+
track
163+
transitioncancel
164+
transitionend
165+
transitionrun
166+
transitionstart
167+
uncapturederror
168+
unhandledrejection
169+
unload
170+
url
171+
visibilitychange
172+
volumechange
173+
waiting
174+
webglcontextcreationerror
175+
webkitAnimationEnd
176+
webkitAnimationIteration
177+
webkitAnimationStart
178+
webkitTransitionEnd
179+
webkitTransitionRun
180+
week
181+
width

dom/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "dom"
3+
version = "0.0.1"
4+
authors = ["The Servo Project Developers"]
5+
license = "MPL-2.0"
6+
edition = "2021"
7+
publish = false
8+
9+
[lib]
10+
path = "lib.rs"
11+
12+
[dependencies]
13+
bitflags = "2"
14+
malloc_size_of = { path = "../malloc_size_of" }

0 commit comments

Comments
 (0)