mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Code review comments and upstream merge conflicts
Incorporated code review comments in components/net/http_loader.rs Resolved merge conflicts in cargo.lock file. Updated ReferrerPolicy in lib.rs
This commit is contained in:
commit
26dac98546
340 changed files with 9134 additions and 452 deletions
68
ports/cef/Cargo.lock
generated
68
ports/cef/Cargo.lock
generated
|
@ -159,14 +159,45 @@ name = "block"
|
|||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bluetooth"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bluetooth_traits 0.0.1",
|
||||
"device 0.0.1 (git+https://github.com/servo/devices)",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tinyfiledialogs 0.1.0 (git+https://github.com/jdm/tinyfiledialogs)",
|
||||
"util 0.0.1",
|
||||
"uuid 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bluetooth_traits"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blurdroid"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "blurmock"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blurz"
|
||||
version = "0.2.0"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"dbus 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -302,6 +333,7 @@ name = "constellation"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bluetooth_traits 0.0.1",
|
||||
"canvas 0.0.1",
|
||||
"canvas_traits 0.0.1",
|
||||
"compositing 0.0.1",
|
||||
|
@ -447,10 +479,11 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "device"
|
||||
version = "0.0.1"
|
||||
source = "git+https://github.com/servo/devices#6d40b1412fb496b0d9434ee2f46e9dfc4dc67ae7"
|
||||
source = "git+https://github.com/servo/devices#4a6ab4be0de229fafa6aa3657a5702646832ba08"
|
||||
dependencies = [
|
||||
"blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blurz 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blurmock 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blurz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -878,7 +911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -891,7 +924,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "html5ever-atoms"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1076,7 +1109,7 @@ dependencies = [
|
|||
"gfx_traits 0.0.1",
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1328,7 +1361,6 @@ dependencies = [
|
|||
"brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"content-blocker 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"device 0.0.1 (git+https://github.com/servo/devices)",
|
||||
"devtools_traits 0.0.1",
|
||||
"flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1346,7 +1378,6 @@ dependencies = [
|
|||
"openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"plugins 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1824,6 +1855,7 @@ dependencies = [
|
|||
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"audio-video-metadata 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bluetooth_traits 0.0.1",
|
||||
"canvas_traits 0.0.1",
|
||||
"caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1837,7 +1869,7 @@ dependencies = [
|
|||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1893,7 +1925,7 @@ dependencies = [
|
|||
"gfx_traits 0.0.1",
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1914,6 +1946,7 @@ name = "script_traits"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bluetooth_traits 0.0.1",
|
||||
"canvas_traits 0.0.1",
|
||||
"cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"devtools_traits 0.0.1",
|
||||
|
@ -2004,6 +2037,8 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"android_glue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bluetooth 0.0.1",
|
||||
"bluetooth_traits 0.0.1",
|
||||
"browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)",
|
||||
"canvas 0.0.1",
|
||||
"canvas_traits 0.0.1",
|
||||
|
@ -2222,7 +2257,7 @@ dependencies = [
|
|||
"fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2596,7 +2631,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "webrender"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/webrender#2be67987a0ff7bdd4820b65283e6fc1604cc301c"
|
||||
source = "git+https://github.com/servo/webrender#8b53081a3de714f8c1296e20658fabe4e75a6244"
|
||||
dependencies = [
|
||||
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2621,7 +2656,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "webrender_traits"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/servo/webrender#2be67987a0ff7bdd4820b65283e6fc1604cc301c"
|
||||
source = "git+https://github.com/servo/webrender#8b53081a3de714f8c1296e20658fabe4e75a6244"
|
||||
dependencies = [
|
||||
"app_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2712,7 +2747,7 @@ name = "xml5ever"
|
|||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"phf 0.7.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2739,7 +2774,8 @@ dependencies = [
|
|||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
|
||||
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
|
||||
"checksum blurdroid 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5fce4ea3366b583e9d49e1aa3a42252e53b42911bccd06f31c3e81c48ccfc79e"
|
||||
"checksum blurz 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96134f6ac62fa6925761dbdb4096617d65d7c1d383d90e5c2d4c489919f773dc"
|
||||
"checksum blurmock 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c3034c7372bc7951e0a916b7e952b0043cd4ccb5112cd30827f0e1708e05c2b1"
|
||||
"checksum blurz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d49796c8d5a1b5f6b2b8686e46ed4ab842987c477f765b69f1d3e8df6072608"
|
||||
"checksum brotli 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bff2d5511b5ba5840f46cc3f9c0c3ab09db20e9b9a4db344ef7df3fb547a627a"
|
||||
"checksum browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)" = "<none>"
|
||||
"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
|
||||
|
@ -2798,7 +2834,7 @@ dependencies = [
|
|||
"checksum heartbeats-simple-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53c4b67617665d7f4172f381f9843c1bec6a4fccc9a9226529e5b1be40dc1301"
|
||||
"checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58"
|
||||
"checksum html5ever 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2e00f17a864dfee00d41b46fda2a669e10e96bf71f8c712b3c88f4977188d7"
|
||||
"checksum html5ever-atoms 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "860439a63e39a4d3506b9cff6107fa238f89edf7aee41ca5a055acb301a556a3"
|
||||
"checksum html5ever-atoms 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daefa106438c66af58309c84842b5db1df2733fe35849f39adde6fdf63583d40"
|
||||
"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae"
|
||||
"checksum hyper 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "edd47c66782933e546a32ae89ca3c49263b2ba9bc29f3a0d5c52fff48e0ac67c"
|
||||
"checksum hyper_serde 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "572d2168173019de312a050a24f2ad33ac2ac7895a2139fbf21ee6b6f470a24e"
|
||||
|
|
|
@ -7,6 +7,7 @@ use cssparser::{Parser, ToCss};
|
|||
use env_logger;
|
||||
use euclid::Size2D;
|
||||
use parking_lot::RwLock;
|
||||
use std::fmt::Write;
|
||||
use std::mem::transmute;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use style::arc_ptr_eq;
|
||||
|
@ -25,9 +26,9 @@ use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSet
|
|||
use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
|
||||
use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
|
||||
use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
|
||||
use style::gecko_bindings::bindings::{nsACString, nsAString};
|
||||
use style::gecko_bindings::bindings::Gecko_Utf8SliceToString;
|
||||
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
|
||||
use style::gecko_bindings::bindings::nsACString;
|
||||
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom};
|
||||
use style::gecko_bindings::structs::ServoElementSnapshot;
|
||||
use style::gecko_bindings::structs::nsRestyleHint;
|
||||
|
@ -420,6 +421,18 @@ pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString) -> RawServo
|
|||
Arc::new(RwLock::new(GeckoElement::parse_style_attribute(value))).into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_CreateEmpty() -> RawServoDeclarationBlockStrong {
|
||||
Arc::new(RwLock::new(PropertyDeclarationBlock { declarations: vec![], important_count: 0 })).into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_Clone(declarations: RawServoDeclarationBlockBorrowed)
|
||||
-> RawServoDeclarationBlockStrong {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
Arc::new(RwLock::new(declarations.read().clone())).into_strong()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: RawServoDeclarationBlockBorrowed) {
|
||||
unsafe { RwLock::<PropertyDeclarationBlock>::addref(declarations) };
|
||||
|
@ -437,6 +450,13 @@ pub extern "C" fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorro
|
|||
*RwLock::<PropertyDeclarationBlock>::as_arc(&a).read() == *RwLock::<PropertyDeclarationBlock>::as_arc(&b).read()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_GetCssText(declarations: RawServoDeclarationBlockBorrowed,
|
||||
result: *mut nsAString) {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
declarations.read().to_css(unsafe { result.as_mut().unwrap() }).unwrap();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
||||
declarations: RawServoDeclarationBlockBorrowed,
|
||||
|
@ -469,6 +489,85 @@ pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
|
|||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_Count(declarations: RawServoDeclarationBlockBorrowed) -> u32 {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
declarations.read().declarations.len() as u32
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_GetNthProperty(declarations: RawServoDeclarationBlockBorrowed,
|
||||
index: u32, result: *mut nsAString) -> bool {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
if let Some(&(ref decl, _)) = declarations.read().declarations.get(index as usize) {
|
||||
let result = unsafe { result.as_mut().unwrap() };
|
||||
write!(result, "{}", decl.name()).unwrap();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME Methods of PropertyDeclarationBlock should take atoms directly.
|
||||
// This function is just a temporary workaround before that finishes.
|
||||
fn get_property_name_from_atom(atom: *mut nsIAtom, is_custom: bool) -> String {
|
||||
let atom = Atom::from(atom);
|
||||
if !is_custom {
|
||||
atom.to_string()
|
||||
} else {
|
||||
let mut result = String::with_capacity(atom.len() as usize + 2);
|
||||
write!(result, "--{}", atom).unwrap();
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_GetPropertyValue(declarations: RawServoDeclarationBlockBorrowed,
|
||||
property: *mut nsIAtom, is_custom: bool,
|
||||
value: *mut nsAString) {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
let property = get_property_name_from_atom(property, is_custom);
|
||||
declarations.read().property_value_to_css(&property, unsafe { value.as_mut().unwrap() }).unwrap();
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations: RawServoDeclarationBlockBorrowed,
|
||||
property: *mut nsIAtom, is_custom: bool) -> bool {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
let property = get_property_name_from_atom(property, is_custom);
|
||||
declarations.read().property_priority(&property).important()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_SetProperty(declarations: RawServoDeclarationBlockBorrowed,
|
||||
property: *mut nsIAtom, is_custom: bool,
|
||||
value: *mut nsACString, is_important: bool) -> bool {
|
||||
let property = get_property_name_from_atom(property, is_custom);
|
||||
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
|
||||
// FIXME Needs real URL and ParserContextExtraData.
|
||||
let base_url = &*DUMMY_BASE_URL;
|
||||
let extra_data = ParserContextExtraData::default();
|
||||
if let Ok(decls) = parse_one_declaration(&property, value, &base_url,
|
||||
Box::new(StdoutErrorReporter), extra_data) {
|
||||
let mut declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations).write();
|
||||
let importance = if is_important { Importance::Important } else { Importance::Normal };
|
||||
for decl in decls.into_iter() {
|
||||
declarations.set_parsed_declaration(decl, importance);
|
||||
}
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_DeclarationBlock_RemoveProperty(declarations: RawServoDeclarationBlockBorrowed,
|
||||
property: *mut nsIAtom, is_custom: bool) {
|
||||
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
|
||||
let property = get_property_name_from_atom(property, is_custom);
|
||||
declarations.write().remove_property(&property);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_CSSSupports(property: *const nsACString, value: *const nsACString) -> bool {
|
||||
let property = unsafe { property.as_ref().unwrap().as_str_unchecked() };
|
||||
|
|
|
@ -703,6 +703,19 @@ impl Window {
|
|||
VirtualKeyCode::Tab => Ok(Key::Tab),
|
||||
VirtualKeyCode::Subtract => Ok(Key::Minus),
|
||||
|
||||
VirtualKeyCode::F1 => Ok(Key::F1),
|
||||
VirtualKeyCode::F2 => Ok(Key::F2),
|
||||
VirtualKeyCode::F3 => Ok(Key::F3),
|
||||
VirtualKeyCode::F4 => Ok(Key::F4),
|
||||
VirtualKeyCode::F5 => Ok(Key::F5),
|
||||
VirtualKeyCode::F6 => Ok(Key::F6),
|
||||
VirtualKeyCode::F7 => Ok(Key::F7),
|
||||
VirtualKeyCode::F8 => Ok(Key::F8),
|
||||
VirtualKeyCode::F9 => Ok(Key::F9),
|
||||
VirtualKeyCode::F10 => Ok(Key::F10),
|
||||
VirtualKeyCode::F11 => Ok(Key::F11),
|
||||
VirtualKeyCode::F12 => Ok(Key::F12),
|
||||
|
||||
VirtualKeyCode::NavigateBackward => Ok(Key::NavigateBackward),
|
||||
VirtualKeyCode::NavigateForward => Ok(Key::NavigateForward),
|
||||
_ => Err(()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue