mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
layout: Stop going to the DOM to guess width.
This commit is contained in:
parent
1593d2f695
commit
6be8482eef
1 changed files with 5 additions and 2 deletions
|
@ -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 {
|
||||
if !self.node.is_element() {
|
||||
return Au(0)
|
||||
match self.specific {
|
||||
GenericBox | ImageBox(_) => {}
|
||||
ScannedTextBox(_) | UnscannedTextBox(_) => return Au(0),
|
||||
}
|
||||
|
||||
let style = self.style();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue