Skip to content

Commit

Permalink
Commit our changes on top of upstream Stylo
Browse files Browse the repository at this point in the history
This is a rebase of 18ca509

Signed-off-by: Martin Robinson <[email protected]>
  • Loading branch information
delan authored and Loirooriol committed Dec 5, 2024
1 parent 67a63bc commit 35e0fa2
Show file tree
Hide file tree
Showing 71 changed files with 1,499 additions and 400 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/_filtered/
/target/
/style/properties/__pycache__/
Cargo.lock
16 changes: 16 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[workspace]
resolver = "2"
members = [
"dom",
"malloc_size_of",
"rustfmt.toml",
"selectors",
"servo_arc",
"style",
"style_derive",
"style_static_prefs",
"style_traits",
"to_shmem",
"to_shmem_derive",
]
default-members = ["style"]
17 changes: 17 additions & 0 deletions atoms/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "servo_atoms"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
build = "build.rs"

[lib]
path = "lib.rs"

[dependencies]
string_cache = "0.8"

[build-dependencies]
string_cache_codegen = "0.5"
31 changes: 31 additions & 0 deletions atoms/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;

fn main() {
let static_atoms =
Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("static_atoms.txt");
let static_atoms = BufReader::new(File::open(&static_atoms).unwrap());
let mut atom_type = string_cache_codegen::AtomType::new("Atom", "atom!");

macro_rules! predefined {
($($name: expr,)+) => {
{
$(
atom_type.atom($name);
)+
}
}
}
include!("../style/counter_style/predefined.rs");

atom_type
.atoms(static_atoms.lines().map(Result::unwrap))
.write_to_file(&Path::new(&env::var_os("OUT_DIR").unwrap()).join("atom.rs"))
.unwrap();
}
5 changes: 5 additions & 0 deletions atoms/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

include!(concat!(env!("OUT_DIR"), "/atom.rs"));
179 changes: 179 additions & 0 deletions atoms/static_atoms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
-moz-content-preferred-color-scheme
-moz-device-pixel-ratio
-moz-fixed-pos-containing-block
-moz-gtk-csd-close-button-position
-moz-gtk-csd-maximize-button-position
-moz-gtk-csd-menu-radius
-moz-gtk-csd-minimize-button-position
-moz-gtk-csd-titlebar-button-spacing
-moz-gtk-csd-titlebar-radius
-moz-gtk-menu-radius
-moz-mac-titlebar-height
-moz-overlay-scrollbar-fade-duration
DOMContentLoaded
abort
activate
addtrack
animationcancel
animationend
animationiteration
animationstart
aspect-ratio
beforeunload
block-size
button
canplay
canplaythrough
center
change
characteristicvaluechanged
checkbox
click
close
closing
color
complete
compositionend
compositionstart
compositionupdate
controllerchange
cursive
dark
datachannel
date
datetime-local
dir
device-pixel-ratio
durationchange
email
emptied
end
ended
error
fantasy
fetch
file
fill
fill-opacity
formdata
fullscreenchange
fullscreenerror
gattserverdisconnected
hashchange
height
hidden
icecandidate
iceconnectionstatechange
icegatheringstatechange
image
inline-size
input
inputsourceschange
invalid
keydown
keypress
kind
left
light
ltr
load
loadeddata
loadedmetadata
loadend
loadstart
message
message
messageerror
monospace
month
mousedown
mousemove
mouseover
mouseup
negotiationneeded
none
normal
number
onchange
open
orientation
pagehide
pageshow
password
pause
play
playing
popstate
postershown
prefers-color-scheme
print
progress
radio
range
ratechange
readystatechange
referrer
reftest-wait
rejectionhandled
removetrack
reset
resize
resolution
resourcetimingbufferfull
right
rtl
sans-serif
safe-area-inset-top
safe-area-inset-bottom
safe-area-inset-left
safe-area-inset-right
scan
screen
scroll-position
scrollbar-inline-size
search
seeked
seeking
select
selectend
selectionchange
selectstart
serif
sessionavailable
signalingstatechange
squeeze
squeezeend
squeezestart
srclang
statechange
stroke
stroke-opacity
storage
submit
suspend
system-ui
tel
text
time
timeupdate
toggle
track
transitioncancel
transitionend
transitionrun
transitionstart
uncapturederror
unhandledrejection
unload
url
visibilitychange
volumechange
waiting
webglcontextcreationerror
webkitAnimationEnd
webkitAnimationIteration
webkitAnimationStart
webkitTransitionEnd
webkitTransitionRun
week
width
14 changes: 14 additions & 0 deletions dom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "dom"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2021"
publish = false

[lib]
path = "lib.rs"

[dependencies]
bitflags = "2"
malloc_size_of = { path = "../malloc_size_of" }
Loading

0 comments on commit 35e0fa2

Please sign in to comment.