auto merge of #1166 : SimonSapin/servo/private, r=pcwalton

I.e. make every module private by default.
This commit is contained in:
bors-servo 2013-11-01 07:13:19 -07:00
commit bb71ee4541
16 changed files with 54 additions and 53 deletions

View file

@ -4,7 +4,7 @@
use style::Stylesheet;
use style::Stylist;
use style::selector_matching::UserAgentOrigin;
use style::UserAgentOrigin;
pub fn new_stylist() -> Stylist {
let mut stylist = Stylist::new();

View file

@ -26,16 +26,9 @@ use std::cmp::ApproxEq;
use std::num::Zero;
use std::unstable::raw::Box;
use style::ComputedValues;
use style::computed_values::border_style;
use style::computed_values::clear;
use style::computed_values::float;
use style::properties::longhands::font_family::FamilyName;
use style::computed_values::font_style;
use style::computed_values::line_height;
use style::computed_values::position;
use style::computed_values::text_align;
use style::computed_values::text_decoration;
use style::computed_values::vertical_align;
use style::computed_values::{
border_style, clear, float, font_family, font_style, line_height,
position, text_align, text_decoration, vertical_align};
use css::node_style::StyledNode;
use layout::display_list_builder::{DisplayListBuilder, ExtraDisplayListData, ToGfxColor};
@ -733,7 +726,7 @@ impl RenderBoxBase {
// FIXME: Too much allocation here.
let font_families = do my_style.Font.font_family.map |family| {
match *family {
FamilyName(ref name) => (*name).clone(),
font_family::FamilyName(ref name) => (*name).clone(),
}
};
let font_families = font_families.connect(", ");

View file

@ -23,7 +23,7 @@ pub type Nothing = ();
impl ExtraDisplayListData for AbstractNode<()> {
fn new(box: &@RenderBox) -> AbstractNode<()> {
unsafe {
unsafe {
transmute(box.base().node)
}
}
@ -61,7 +61,7 @@ pub trait ToGfxColor {
fn to_gfx_color(&self) -> gfx::color::Color;
}
impl ToGfxColor for style::properties::RGBA {
impl ToGfxColor for style::computed_values::RGBA {
fn to_gfx_color(&self) -> gfx::color::Color {
gfx::color::rgba(self.red, self.green, self.blue, self.alpha)
}

View file

@ -32,7 +32,7 @@ use gfx::render_task::{RenderMsg, RenderChan, RenderLayer};
use gfx::render_task;
use style::Stylist;
use style::Stylesheet;
use style::selector_matching::AuthorOrigin;
use style::AuthorOrigin;
use script::dom::event::ReflowEvent;
use script::dom::node::{AbstractNode, LayoutView};
use script::layout_interface::{AddStylesheetMsg, ContentBoxQuery};
@ -240,7 +240,7 @@ impl LayoutTask {
screen_size: None,
display_list: None,
stylist: RWArc::new(new_stylist()),
profiler_chan: profiler_chan,
}

View file

@ -8,7 +8,7 @@ use std::num::Zero;
use geom::side_offsets::SideOffsets2D;
use servo_util::geometry::Au;
use style::ComputedValues;
use style::properties::common_types::computed;
use computed = style::computed_values;
/// Encapsulates the borders, padding, and margins, which we collectively call the "box model".
#[deriving(Clone)]

View file

@ -23,8 +23,7 @@ use std::cast::transmute;
use std::unstable::raw::Box;
use extra::arc::Arc;
use js::jsapi::{JSObject, JSContext};
use style::ComputedValues;
use style::properties::PropertyDeclaration;
use style::{ComputedValues, PropertyDeclaration};
use servo_util::tree::{TreeNode, TreeNodeRef, TreeNodeRefAsElement};
use servo_util::range::Range;
use gfx::display_list::DisplayList;

View file

@ -9,7 +9,8 @@ pub type CSSFloat = f64;
pub mod specified {
use std::ascii::StrAsciiExt;
use cssparser::*;
use cssparser::ast;
use cssparser::ast::*;
use super::{Au, CSSFloat};
pub use CSSColor = cssparser::Color;

View file

@ -2,7 +2,7 @@
* 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/. */
use cssparser::{SyntaxError, SourceLocation};
use cssparser::ast::{SyntaxError, SourceLocation};
pub struct ErrorLoggerIterator<I>(I);

View file

@ -3,7 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::ascii::StrAsciiExt;
use cssparser::*;
use cssparser::parse_rule_list;
use cssparser::ast::*;
use errors::{ErrorLoggerIterator, log_css_error};
use stylesheets::{CSSRule, CSSMediaRule, parse_style_rule, parse_nested_at_rule};
use namespaces::NamespaceMap;

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::hashmap::HashMap;
use cssparser::*;
use cssparser::ast::*;
use errors::log_css_error;
pub struct NamespaceMap {

View file

@ -4,7 +4,7 @@
use std::ascii::StrAsciiExt;
use cssparser::*;
use cssparser::ast::{ComponentValue, Ident, SkipWhitespaceIterable};
pub fn one_component_value<'a>(input: &'a [ComponentValue]) -> Option<&'a ComponentValue> {

View file

@ -6,9 +6,10 @@
use std::ascii::StrAsciiExt;
pub use extra::arc::Arc;
pub use std::iter;
pub use cssparser::*;
pub use errors::{ErrorLoggerIterator, log_css_error};
pub use cssparser::ast::*;
use errors::{ErrorLoggerIterator, log_css_error};
pub use parsing_utils::*;
pub use self::common_types::*;
@ -401,20 +402,20 @@ pub mod longhands {
<%self:longhand name="font-family" inherited="True">
pub use to_computed_value = super::computed_as_specified;
#[deriving(Eq, Clone)]
pub enum FontFamily {
FamilyName(~str),
// Generic
// Serif,
// SansSerif,
// Cursive,
// Fantasy,
// Monospace,
}
pub type SpecifiedValue = ~[FontFamily];
pub mod computed_value {
pub type T = super::SpecifiedValue;
#[deriving(Eq, Clone)]
pub enum FontFamily {
FamilyName(~str),
// Generic
// Serif,
// SansSerif,
// Cursive,
// Fantasy,
// Monospace,
}
pub type T = ~[FontFamily];
}
pub type SpecifiedValue = computed_value::T;
#[inline] pub fn get_initial_value() -> computed_value::T { ~[FamilyName(~"serif")] }
/// <familiy-name>#
/// <familiy-name> = <string> | [ <ident>+ ]
@ -1118,4 +1119,9 @@ pub mod computed_values {
% endfor
// Don't use a side-specific name needlessly:
pub use border_style = super::longhands::border_top_style::computed_value;
pub use cssparser::RGBA;
pub use super::common_types::computed::{
LengthOrPercentage, LP_Length, LP_Percentage,
LengthOrPercentageOrAuto, LPA_Length, LPA_Percentage, LPA_Auto};
}

View file

@ -4,7 +4,7 @@
use std::{vec, iter};
use std::ascii::StrAsciiExt;
use cssparser::*;
use cssparser::ast::*;
use namespaces::NamespaceMap;

View file

@ -18,21 +18,20 @@ extern mod cssparser;
extern mod servo_util (name = "util");
// The "real" public API
// Public API
pub use stylesheets::Stylesheet;
pub use selector_matching::{Stylist, StylesheetOrigin};
pub use properties::{cascade, ComputedValues, computed_values};
pub use selector_matching::{Stylist, StylesheetOrigin, UserAgentOrigin, AuthorOrigin, UserOrigin};
pub use properties::{cascade, PropertyDeclaration, ComputedValues, computed_values};
pub use properties::{PropertyDeclarationBlock, parse_style_attribute}; // Style attributes
// Things that need to be public to make the compiler happy
pub mod stylesheets;
pub mod errors;
pub mod selectors;
pub mod selector_matching;
pub mod properties;
pub mod namespaces;
pub mod media_queries;
pub mod parsing_utils;
mod stylesheets;
mod errors;
mod selectors;
mod selector_matching;
mod properties;
mod namespaces;
mod media_queries;
mod parsing_utils;
#[cfg(test)]
mod tests;

View file

@ -5,7 +5,8 @@
use std::str;
use std::iter::Iterator;
use std::ascii::StrAsciiExt;
use cssparser::*;
use cssparser::{tokenize, parse_stylesheet_rules, ToCss};
use cssparser::ast::*;
use selectors;
use properties;
use errors::{ErrorLoggerIterator, log_css_error};

@ -1 +1 @@
Subproject commit 03d7044a13a78a34db196e2bce48cb4826a144f3
Subproject commit 1a7b4ca6d368f6035a4135504f89d66c5e225d09