layout: Stop going to the DOM to guess width.

This commit is contained in:
Patrick Walton 2013-12-13 15:17:07 -08:00
parent 1593d2f695
commit 6be8482eef

View file

@ -284,9 +284,12 @@ impl Box {
} }
} }
/// Returns the shared part of the width for computation of minimum and preferred width per
/// CSS 2.1.
fn guess_width(&self) -> Au { fn guess_width(&self) -> Au {
if !self.node.is_element() { match self.specific {
return Au(0) GenericBox | ImageBox(_) => {}
ScannedTextBox(_) | UnscannedTextBox(_) => return Au(0),
} }
let style = self.style(); let style = self.style();