aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/display_list/mod.rs6
-rw-r--r--components/gfx/paint_context.rs4
-rw-r--r--components/layout/flow.rs3
-rw-r--r--components/layout/inline.rs3
-rw-r--r--components/layout/table_colgroup.rs3
-rw-r--r--components/util/geometry.rs11
6 files changed, 8 insertions, 22 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index 3f03ecf88ef..b1220e8bc9c 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -43,7 +43,7 @@ use style::properties::ComputedValues;
use text::TextRun;
use text::glyph::CharIndex;
use util::cursor::Cursor;
-use util::geometry::{self, MAX_RECT, ZERO_RECT};
+use util::geometry::{self, MAX_RECT};
use util::linked_list::prepend_from;
use util::mem::HeapSizeOf;
use util::opts;
@@ -1043,7 +1043,7 @@ impl ClippingRegion {
#[inline]
pub fn empty() -> ClippingRegion {
ClippingRegion {
- main: ZERO_RECT,
+ main: Rect::zero(),
complex: Vec::new(),
}
}
@@ -1073,7 +1073,7 @@ impl ClippingRegion {
#[inline]
pub fn intersect_rect(self, rect: &Rect<Au>) -> ClippingRegion {
ClippingRegion {
- main: self.main.intersection(rect).unwrap_or(ZERO_RECT),
+ main: self.main.intersection(rect).unwrap_or(Rect::zero()),
complex: self.complex,
}
}
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs
index 5c7eb8c2016..33422fe076a 100644
--- a/components/gfx/paint_context.rs
+++ b/components/gfx/paint_context.rs
@@ -35,7 +35,7 @@ use std::{f32, mem, ptr};
use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};
use text::TextRun;
use text::glyph::CharIndex;
-use util::geometry::{self, MAX_RECT, PagePx, ScreenPx, ZERO_POINT, ZERO_RECT};
+use util::geometry::{self, MAX_RECT, PagePx, ScreenPx, ZERO_POINT};
use util::opts;
use util::range::Range;
@@ -1580,7 +1580,7 @@ impl<'a> PaintContext<'a> {
let side_inflation = blur_radius * BLUR_INFLATION_FACTOR;
let tile_box_bounds =
geometry::f32_rect_to_au_rect(self.page_rect.to_untyped()).intersection(box_bounds)
- .unwrap_or(ZERO_RECT)
+ .unwrap_or(Rect::zero())
.inflate(side_inflation, side_inflation);
TemporaryDrawTarget::from_bounds(&self.draw_target, &tile_box_bounds)
}
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 3af799fc82e..0df6a7bd1d0 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -56,7 +56,6 @@ use table_colgroup::TableColGroupFlow;
use table_row::TableRowFlow;
use table_rowgroup::TableRowGroupFlow;
use table_wrapper::TableWrapperFlow;
-use util::geometry::ZERO_RECT;
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use util::print_tree::PrintTree;
use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
@@ -1054,7 +1053,7 @@ impl BaseFlow {
children: FlowList::new(),
intrinsic_inline_sizes: IntrinsicISizes::new(),
position: LogicalRect::zero(writing_mode),
- overflow: ZERO_RECT,
+ overflow: Rect::zero(),
parallel: FlowParallelInfo::new(),
floats: Floats::new(writing_mode),
collapsible_margins: CollapsibleMargins::new(),
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index 15c1beae31b..232de1bb5f2 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -31,7 +31,6 @@ use style::values::computed::LengthOrPercentage;
use text;
use unicode_bidi;
use util;
-use util::geometry::ZERO_RECT;
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use util::print_tree::PrintTree;
use util::range::{Range, RangeIndex};
@@ -1749,7 +1748,7 @@ impl Flow for InlineFlow {
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
fn compute_overflow(&self) -> Rect<Au> {
- let mut overflow = ZERO_RECT;
+ let mut overflow = Rect::zero();
let flow_size = self.base.position.size.to_physical(self.base.writing_mode);
let relative_containing_block_size =
&self.base.early_absolute_position_info.relative_containing_block_size;
diff --git a/components/layout/table_colgroup.rs b/components/layout/table_colgroup.rs
index 12273d0e173..4b6dd537fe0 100644
--- a/components/layout/table_colgroup.rs
+++ b/components/layout/table_colgroup.rs
@@ -17,7 +17,6 @@ use std::fmt;
use std::sync::Arc;
use style::properties::ComputedValues;
use style::values::computed::LengthOrPercentageOrAuto;
-use util::geometry::ZERO_RECT;
use util::logical_geometry::LogicalSize;
/// A table formatting context.
@@ -96,7 +95,7 @@ impl Flow for TableColGroupFlow {
fn repair_style(&mut self, _: &Arc<ComputedValues>) {}
fn compute_overflow(&self) -> Rect<Au> {
- ZERO_RECT
+ Rect::zero()
}
fn generated_containing_block_size(&self, _: OpaqueFlow) -> LogicalSize<Au> {
diff --git a/components/util/geometry.rs b/components/util/geometry.rs
index 7b5f89dc53e..d9599a11369 100644
--- a/components/util/geometry.rs
+++ b/components/util/geometry.rs
@@ -64,17 +64,6 @@ pub static ZERO_POINT: Point2D<Au> = Point2D {
y: Au(0),
};
-pub static ZERO_RECT: Rect<Au> = Rect {
- origin: Point2D {
- x: Au(0),
- y: Au(0),
- },
- size: Size2D {
- width: Au(0),
- height: Au(0),
- }
-};
-
pub static MAX_RECT: Rect<Au> = Rect {
origin: Point2D {
x: Au(i32::MIN / 2),