Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for the rustup. #5888

Merged
merged 2 commits into from Apr 28, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -149,7 +149,7 @@ impl<'a> CanvasPaintTask<'a> {
}
let image_rect = Rect(Point2D(0f64, 0f64), image_size);
// rgba -> bgra
byte_swap(imagedata.as_mut_slice());
byte_swap(&mut imagedata);
self.write_pixels(&imagedata, image_size, image_rect, dest_rect, smoothing_enabled);
}

@@ -145,7 +145,7 @@ enum CompositionRequest {
CompositeNow(CompositingReason),
}

#[derive(Copy, PartialEq, Debug)]
#[derive(Clone, Copy, PartialEq, Debug)]
enum ShutdownState {
NotShuttingDown,
ShuttingDown,
@@ -95,7 +95,7 @@ impl ScriptListener for Box<CompositorProxy+'static+Send> {
}

/// Information about each layer that the compositor keeps.
#[derive(Copy)]
#[derive(Clone, Copy)]
pub struct LayerProperties {
pub pipeline_id: PipelineId,
pub epoch: Epoch,
@@ -170,7 +170,7 @@ pub struct SendableFrameTree {
pub children: Vec<SendableFrameTree>,
}

#[derive(Copy)]
#[derive(Clone, Copy)]
enum ExitPipelineMode {
Normal,
Force,
@@ -26,7 +26,7 @@ pub struct BufferMap {
}

/// A key with which to store buffers. It is based on the size of the buffer.
#[derive(Eq, Copy)]
#[derive(Eq, Copy, Clone)]
struct BufferKey([usize; 2]);

impl Hash for BufferKey {
@@ -57,15 +57,15 @@ pub struct PaintContext<'a> {
pub transient_clip: Option<ClippingRegion>,
}

#[derive(Copy)]
#[derive(Copy, Clone)]
enum Direction {
Top,
Left,
Right,
Bottom
}

#[derive(Copy)]
#[derive(Copy, Clone)]
enum DashSize {
DottedBorder = 1,
DashedBorder = 3
@@ -87,7 +87,7 @@ impl GlyphEntry {
pub type GlyphId = u32;

// TODO: unify with bit flags?
#[derive(PartialEq, Copy)]
#[derive(PartialEq, Copy, Clone)]
pub enum BreakType {
None,
Normal,
@@ -415,7 +415,7 @@ impl<'a> DetailedGlyphStore {

// This struct is used by GlyphStore clients to provide new glyph data.
// It should be allocated on the stack and passed by reference to GlyphStore.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct GlyphData {
id: GlyphId,
advance: Au,
@@ -449,7 +449,7 @@ impl GlyphData {
// through glyphs (either for a particular TextRun offset, or all glyphs).
// Rather than eagerly assembling and copying glyph data, it only retrieves
// values as they are needed from the GlyphStore, using provided offsets.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub enum GlyphInfo<'a> {
Simple(&'a GlyphStore, CharIndex),
Detail(&'a GlyphStore, CharIndex, u16),
@@ -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/. */

#[derive(PartialEq, Eq, Copy)]
#[derive(PartialEq, Eq, Copy, Clone)]
pub enum CompressionMode {
CompressNone,
CompressWhitespace,
@@ -88,7 +88,7 @@ impl FloatedBlockInfo {
}

/// The solutions for the block-size-and-margins constraint equation.
#[derive(Copy)]
#[derive(Copy, Clone)]
struct BSizeConstraintSolution {
block_start: Au,
block_size: Au,
@@ -1962,7 +1962,7 @@ impl fmt::Debug for BlockFlow {
}

/// The inputs for the inline-sizes-and-margins constraint equation.
#[derive(Debug, Copy)]
#[derive(Debug, Copy, Clone)]
pub struct ISizeConstraintInput {
pub computed_inline_size: MaybeAuto,
pub inline_start_margin: MaybeAuto,
@@ -1992,7 +1992,7 @@ impl ISizeConstraintInput {
}

/// The solutions for the inline-size-and-margins constraint equation.
#[derive(Copy, Debug)]
#[derive(Copy, Clone, Debug)]
pub struct ISizeConstraintSolution {
pub inline_start: Au,
pub inline_size: Au,
@@ -1584,7 +1584,7 @@ impl BaseFlowDisplayListBuilding for BaseFlow {
}

// A helper data structure for gradients.
#[derive(Copy)]
#[derive(Copy, Clone)]
struct StopRun {
start_offset: f32,
end_offset: f32,
@@ -29,7 +29,7 @@ impl FloatKind {
}

/// The kind of clearance: left, right, or both.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub enum ClearType {
Left,
Right,
@@ -693,7 +693,7 @@ pub type DescendantOffsetIter<'a> = Zip<DescendantIter<'a>, IterMut<'a, Au>>;

/// Information needed to compute absolute (i.e. viewport-relative) flow positions (not to be
/// confused with absolutely-positioned flows).
#[derive(RustcEncodable, Copy)]
#[derive(RustcEncodable, Copy, Clone)]
pub struct AbsolutePositionInfo {
/// The size of the containing block for relatively-positioned descendants.
pub relative_containing_block_size: LogicalSize<Au>,
@@ -65,7 +65,7 @@ static FONT_SUPERSCRIPT_OFFSET_RATIO: f64 = 0.34;
/// with a float or a horizontal wall of the containing block. The block-start
/// inline-start corner of the green zone is the same as that of the line, but
/// the green zone can be taller and wider than the line itself.
#[derive(RustcEncodable, Debug, Copy)]
#[derive(RustcEncodable, Debug, Copy, Clone)]
pub struct Line {
/// A range of line indices that describe line breaks.
///
@@ -19,7 +19,7 @@ use util::geometry::Au;
use util::logical_geometry::LogicalMargin;

/// A collapsible margin. See CSS 2.1 § 8.3.1.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct AdjoiningMargins {
/// The value of the greatest positive margin.
pub most_positive: Au,
@@ -62,7 +62,7 @@ impl AdjoiningMargins {
}

/// Represents the block-start and block-end margins of a flow with collapsible margins. See CSS 2.1 § 8.3.1.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub enum CollapsibleMargins {
/// Margins may not collapse with this flow.
None(Au, Au),
@@ -260,7 +260,7 @@ impl MarginCollapseInfo {
}
}

#[derive(Copy)]
#[derive(Copy, Clone)]
pub enum MarginCollapseState {
AccumulatingCollapsibleTopMargin,
AccumulatingMarginIn,
@@ -357,7 +357,7 @@ impl IntrinsicISizesContribution {
}

/// Useful helper data type when computing values for blocks and positioned elements.
#[derive(Copy, PartialEq, Debug)]
#[derive(Copy, Clone, PartialEq, Debug)]
pub enum MaybeAuto {
Auto,
Specified(Au),
@@ -66,7 +66,7 @@ impl Encodable for TableRowFlow {
}

/// Information about the column inline size and span for each cell.
#[derive(RustcEncodable, Copy)]
#[derive(RustcEncodable, Copy, Clone)]
pub struct CellIntrinsicInlineSize {
/// Inline sizes that this cell contributes to the column.
pub column_size: ColumnIntrinsicInlineSize,
@@ -37,7 +37,7 @@ use style::properties::ComputedValues;
use style::values::CSSFloat;
use style::values::computed::LengthOrPercentageOrAuto;

#[derive(Copy, RustcEncodable, Debug)]
#[derive(Copy, Clone, RustcEncodable, Debug)]
pub enum TableLayout {
Fixed,
Auto
@@ -565,7 +565,7 @@ impl<'a> Add for &'a AutoLayoutCandidateGuess {

/// The `CSSFloat` member specifies the weight of the smaller of the two guesses, on a scale from
/// 0.0 to 1.0.
#[derive(Copy, PartialEq, Debug)]
#[derive(Copy, Clone, PartialEq, Debug)]
enum SelectedAutoLayoutCandidateGuess {
UseMinimumGuess,
InterpolateBetweenMinimumGuessAndMinimumPercentageGuess(CSSFloat),
@@ -119,7 +119,7 @@ fn insert_ancestors_into_bloom_filter(bf: &mut Box<BloomFilter>,

/// The recalc-style-for-node traversal, which styles each node and must run before
/// layout computation. This computes the styles applied to each node.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct RecalcStyleForNode<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
@@ -211,7 +211,7 @@ impl<'a> PreorderDomTraversal for RecalcStyleForNode<'a> {
}

/// The flow construction traversal, which builds flows for styled nodes.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct ConstructFlows<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
@@ -310,7 +310,7 @@ impl<'a> PostorderFlowTraversal for BubbleISizes<'a> {
}

/// The assign-inline-sizes traversal. In Gecko this corresponds to `Reflow`.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct AssignISizes<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
@@ -331,7 +331,7 @@ impl<'a> PreorderFlowTraversal for AssignISizes<'a> {
/// layout computation. Determines the final block-sizes for all layout objects, computes
/// positions, and computes overflow regions. In Gecko this corresponds to `Reflow` and
/// `FinishAndStoreOverflow`.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct AssignBSizesAndStoreOverflow<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
@@ -356,7 +356,7 @@ impl<'a> PostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {
}
}

#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct ComputeAbsolutePositions<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
@@ -368,7 +368,7 @@ impl<'a> PreorderFlowTraversal for ComputeAbsolutePositions<'a> {
}
}

#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct BuildDisplayList<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
@@ -170,7 +170,7 @@ pub trait TLayoutNode {

/// A wrapper so that layout can access only the methods that it should have access to. Layout must
/// only ever see these and must never see instances of `LayoutJS`.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct LayoutNode<'a> {
/// The wrapped node.
node: LayoutJS<Node>,
@@ -179,15 +179,6 @@ pub struct LayoutNode<'a> {
pub chain: PhantomData<&'a ()>,
}

impl<'ln> Clone for LayoutNode<'ln> {
fn clone(&self) -> LayoutNode<'ln> {
LayoutNode {
node: self.node.clone(),
chain: self.chain,
}
}
}

impl<'a> PartialEq for LayoutNode<'a> {
#[inline]
fn eq(&self, other: &LayoutNode) -> bool {
@@ -520,7 +511,7 @@ impl<'a> Iterator for LayoutTreeIterator<'a> {
}

/// A wrapper around elements that ensures layout can only ever access safe properties.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct LayoutElement<'le> {
element: &'le Element,
}
@@ -33,7 +33,7 @@ pub enum ReadyState {
}

/// A newtype struct for denoting the age of messages; prevents race conditions.
#[derive(PartialEq, Eq, Debug, Copy)]
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub struct Epoch(pub u32);

impl Epoch {
@@ -71,7 +71,7 @@ pub enum ScrollPolicy {

/// All layer-specific information that the painting task sends to the compositor other than the
/// buffer contents of the layer itself.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct LayerMetadata {
/// An opaque ID. This is usually the address of the flow and index of the box within it.
pub id: LayerId,
@@ -27,7 +27,7 @@ impl ConstellationChan {
}
}

#[derive(PartialEq, Eq, Copy, Debug)]
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum IFrameSandboxState {
IFrameSandboxed,
IFrameUnsandboxed
@@ -40,7 +40,7 @@ pub struct Failure {
pub parent_info: Option<(PipelineId, SubpageId)>,
}

#[derive(Copy)]
#[derive(Copy, Clone)]
pub struct WindowSizeData {
/// The size of the initial layout viewport, before parsing an
/// http://www.w3.org/TR/css-device-adapt/#initial-viewport
@@ -196,7 +196,7 @@ bitflags! {
}

/// Specifies the type of focus event that is sent to a pipeline
#[derive(Copy, PartialEq)]
#[derive(Copy, Clone, PartialEq)]
pub enum FocusType {
Element, // The first focus message - focus the element itself
Parent, // Focusing a parent element (an iframe)
@@ -342,7 +342,7 @@ pub struct SubpageId(pub u32);

// The type of pipeline exit. During complete shutdowns, pipelines do not have to
// release resources automatically released on process termination.
#[derive(Copy)]
#[derive(Copy, Clone)]
pub enum PipelineExitType {
PipelineOnly,
Complete,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.