mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #14721 - emilio:bindgenup, r=Manishearth
Bindgenup <!-- Please describe your changes on the following line: --> r? @Manishearth <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14721) <!-- Reviewable:end -->
This commit is contained in:
commit
75b3d68fa7
6 changed files with 1796 additions and 1898 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -1409,7 +1409,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "libbindgen"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"aster 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1418,7 +1418,6 @@ dependencies = [
|
|||
"clang-sys 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quasi 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quasi_codegen 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2725,7 +2724,7 @@ dependencies = [
|
|||
"html5ever-atoms 0.1.2 (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.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libbindgen 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libbindgen 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nsstring_vendor 0.1.0",
|
||||
|
@ -3415,7 +3414,7 @@ dependencies = [
|
|||
"checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b"
|
||||
"checksum leak 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd100e01f1154f2908dfa7d02219aeab25d0b9c7fa955164192e3245255a0c73"
|
||||
"checksum leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40a8225d44241fd324a8af2806ba635fc7c8a7e9a7de4d5cf3ef54e71f5926fc"
|
||||
"checksum libbindgen 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "398d7148c9a542aeb0a21440ac05beb0317107121e48bc34f6f4c7173f51d0dd"
|
||||
"checksum libbindgen 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b08a166f5cce21f217bcf61f73f166bb9fb5618b8db893c1bc5d24912f2b4988"
|
||||
"checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70"
|
||||
"checksum libloading 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "84816a8c6ed8163dfe0dbdd2b09d35c6723270ea77a4c7afa4bedf038a36cb99"
|
||||
"checksum libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cbc058951ab6a3ef35ca16462d7642c4867e6403520811f28537a4e2f2db3e71"
|
||||
|
|
|
@ -230,6 +230,7 @@ mod bindings {
|
|||
"mozilla::DisplayItemClip", // Needed because bindgen generates
|
||||
// specialization tests for this even
|
||||
// though it shouldn't.
|
||||
"mozilla::StyleShapeRadius",
|
||||
".*ThreadSafe.*Holder",
|
||||
"AnonymousContent",
|
||||
"AudioContext",
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
use app_units::Au;
|
||||
use cssparser::RGBA;
|
||||
use gecko_bindings::structs::{NS_RADIUS_CLOSEST_SIDE, NS_RADIUS_FARTHEST_SIDE};
|
||||
use gecko_bindings::structs::nsStyleCoord;
|
||||
use gecko_bindings::structs::{nsStyleCoord, StyleShapeRadius};
|
||||
use gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
|
||||
use std::cmp::max;
|
||||
use values::{Auto, Either};
|
||||
|
@ -140,10 +139,10 @@ impl GeckoStyleCoordConvertible for ShapeRadius {
|
|||
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
|
||||
match *self {
|
||||
ShapeRadius::ClosestSide => {
|
||||
coord.set_value(CoordDataValue::Enumerated(NS_RADIUS_CLOSEST_SIDE))
|
||||
coord.set_value(CoordDataValue::Enumerated(StyleShapeRadius::ClosestSide as u32))
|
||||
}
|
||||
ShapeRadius::FarthestSide => {
|
||||
coord.set_value(CoordDataValue::Enumerated(NS_RADIUS_FARTHEST_SIDE))
|
||||
coord.set_value(CoordDataValue::Enumerated(StyleShapeRadius::FarthestSide as u32))
|
||||
}
|
||||
ShapeRadius::Length(lop) => lop.to_gecko_style_coord(coord),
|
||||
}
|
||||
|
@ -151,8 +150,15 @@ impl GeckoStyleCoordConvertible for ShapeRadius {
|
|||
|
||||
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
|
||||
match coord.as_value() {
|
||||
CoordDataValue::Enumerated(NS_RADIUS_CLOSEST_SIDE) => Some(ShapeRadius::ClosestSide),
|
||||
CoordDataValue::Enumerated(NS_RADIUS_FARTHEST_SIDE) => Some(ShapeRadius::FarthestSide),
|
||||
CoordDataValue::Enumerated(v) => {
|
||||
if v == StyleShapeRadius::ClosestSide as u32 {
|
||||
Some(ShapeRadius::ClosestSide)
|
||||
} else if v == StyleShapeRadius::FarthestSide as u32 {
|
||||
Some(ShapeRadius::FarthestSide)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
_ => LengthOrPercentage::from_gecko_style_coord(coord).map(ShapeRadius::Length),
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -434,7 +434,7 @@ class MachCommands(CommandBase):
|
|||
|
||||
print("GeckoLib build completed in %s" % format_duration(elapsed))
|
||||
|
||||
if with_gecko is not None and ret == 0:
|
||||
if with_gecko is not None:
|
||||
print("Copying binding files to style/gecko_bindings...")
|
||||
build_path = path.join(geckolib_build_path, "release" if release else "debug", "")
|
||||
target_style_path = find_dep_path_newest("style", build_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue