mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update to string-cache 0.3
This commit is contained in:
parent
9fcc9d9d3f
commit
53b638c0e2
170 changed files with 1309 additions and 1050 deletions
16
components/atoms/Cargo.toml
Normal file
16
components/atoms/Cargo.toml
Normal file
|
@ -0,0 +1,16 @@
|
|||
[package]
|
||||
name = "servo_atoms"
|
||||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
publish = false
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
string_cache = {version = "0.3", features = ["heap_size"]}
|
||||
|
||||
[build-dependencies]
|
||||
string_cache_codegen = "0.3"
|
19
components/atoms/build.rs
Normal file
19
components/atoms/build.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* 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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
extern crate string_cache_codegen;
|
||||
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io::{BufReader, BufRead};
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let static_atoms = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("static_atoms.txt");
|
||||
let static_atoms = BufReader::new(File::open(&static_atoms).unwrap());
|
||||
string_cache_codegen::AtomType::new("Atom", "atom!")
|
||||
.atoms(static_atoms.lines().map(Result::unwrap))
|
||||
.write_to_file(&Path::new(&env::var("OUT_DIR").unwrap()).join("atom.rs"))
|
||||
.unwrap();
|
||||
}
|
7
components/atoms/lib.rs
Normal file
7
components/atoms/lib.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* 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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
extern crate string_cache;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/atom.rs"));
|
73
components/atoms/static_atoms.txt
Normal file
73
components/atoms/static_atoms.txt
Normal file
|
@ -0,0 +1,73 @@
|
|||
serif
|
||||
sans-serif
|
||||
cursive
|
||||
fantasy
|
||||
monospace
|
||||
|
||||
left
|
||||
center
|
||||
right
|
||||
|
||||
hidden
|
||||
submit
|
||||
button
|
||||
reset
|
||||
radio
|
||||
checkbox
|
||||
file
|
||||
image
|
||||
password
|
||||
text
|
||||
search
|
||||
url
|
||||
tel
|
||||
email
|
||||
datetime
|
||||
date
|
||||
month
|
||||
week
|
||||
time
|
||||
datetime-local
|
||||
number
|
||||
|
||||
dir
|
||||
|
||||
bottom
|
||||
top
|
||||
left
|
||||
right
|
||||
width
|
||||
height
|
||||
margin-bottom
|
||||
margin-top
|
||||
margin-left
|
||||
margin-right
|
||||
padding-bottom
|
||||
padding-top
|
||||
padding-left
|
||||
padding-right
|
||||
|
||||
DOMContentLoaded
|
||||
select
|
||||
input
|
||||
load
|
||||
loadstart
|
||||
loadend
|
||||
progress
|
||||
transitionend
|
||||
error
|
||||
readystatechange
|
||||
message
|
||||
close
|
||||
storage
|
||||
activate
|
||||
webglcontextcreationerror
|
||||
mouseover
|
||||
beforeunload
|
||||
message
|
||||
click
|
||||
keydown
|
||||
abort
|
||||
beforescriptexecute
|
||||
afterscriptexecute
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue