Introduce MaxRect trait

It is implemented for LayoutRect and Rect<Au>.
Replaces the max_rect() function from servo_geometry.
This commit is contained in:
Pyfisch 2018-01-17 23:17:39 +01:00
parent 8c7c5f6e79
commit af52233ae5
9 changed files with 56 additions and 28 deletions

View file

@ -108,7 +108,7 @@ use servo_atoms::Atom;
use servo_config::opts;
use servo_config::prefs::PREFS;
use servo_config::resource_files::read_resource_file;
use servo_geometry::max_rect;
use servo_geometry::MaxRect;
use servo_url::ServoUrl;
use std::borrow::ToOwned;
use std::cell::{Cell, RefCell};
@ -1467,7 +1467,7 @@ impl LayoutThread {
if let Some(mut root_flow) = self.root_flow.borrow().clone() {
let reflow_info = Reflow {
page_clip_rect: max_rect(),
page_clip_rect: Rect::max_rect(),
};
// Unwrap here should not panic since self.root_flow is only ever set to Some(_)