mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Auto merge of #6637 - notriddle:master, r=jdm
Don't crash when Firefox doesn't send autoMargins. Firefox Developer Tools doesn't always send autoMargins, as seen in this message: {"type":"getLayout","node":"node14","to":"pageStyle9"} So don't use unwrap. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6637) <!-- Reviewable:end -->
This commit is contained in:
commit
10f3a89313
1 changed files with 2 additions and 1 deletions
|
@ -459,7 +459,8 @@ impl Actor for PageStyleActor {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let (width, height) = rx.recv().unwrap();
|
let (width, height) = rx.recv().unwrap();
|
||||||
|
|
||||||
let auto_margins = msg.get(&"autoMargins".to_string()).unwrap().as_boolean().unwrap();
|
let auto_margins = msg.get(&"autoMargins".to_string())
|
||||||
|
.and_then(&Json::as_boolean).unwrap_or(false);
|
||||||
|
|
||||||
//TODO: the remaining layout properties (margin, border, padding, position)
|
//TODO: the remaining layout properties (margin, border, padding, position)
|
||||||
// as specified in getLayout in
|
// as specified in getLayout in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue