From ee48599d1bf6c2d5b4c5455add93c60b87eacbc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 2 Jan 2017 04:53:38 +0100 Subject: [PATCH] style: Document Gecko conversions module. --- components/style/gecko/conversions.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 8b9aaeec065..4c2d3c16329 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -99,6 +99,7 @@ impl From for nsStyleCoord_CalcValue { } impl LengthOrPercentageOrAuto { + /// Convert this value in an appropriate `nsStyleCoord::CalcValue`. pub fn to_calc_value(&self) -> Option { match *self { LengthOrPercentageOrAuto::Length(au) => { @@ -132,6 +133,7 @@ impl From for LengthOrPercentage { } impl nsStyleImage { + /// Set a given Servo `Image` value into this `nsStyleImage`. pub fn set(&mut self, image: Image, with_url: bool, cacheable: &mut bool) { match image { Image::Gradient(gradient) => { @@ -154,6 +156,9 @@ impl nsStyleImage { // the applicable declarations cache is not per document, but // global, and the imgRequestProxy objects we store in the style // structs don't like to be tracked by more than one document. + // + // FIXME(emilio): With the scoped TLS thing this is no longer + // true, remove this line in a follow-up! *cacheable = false; }, _ => (), @@ -326,6 +331,8 @@ impl nsStyleImage { } pub mod basic_shape { + //! Conversions from and to CSS shape representations. + use euclid::size::Size2D; use gecko::values::GeckoStyleCoordConvertible; use gecko_bindings::structs; @@ -418,6 +425,7 @@ pub mod basic_shape { // Can't be a From impl since we need to set an existing // nsStyleCorners, not create a new one impl BorderRadius { + /// Set this `BorderRadius` into a given `nsStyleCoord`. pub fn set_corners(&self, other: &mut nsStyleCorners) { let mut set_corner = |field: &BorderRadiusSize, index| { field.0.width.to_gecko_style_coord(&mut other.data_at_mut(index));