зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #6637 - Don't crash when Firefox doesn't send autoMargins (from notriddle:master); r=jdm
Firefox Developer Tools doesn't always send autoMargins, as seen in this message: {"type":"getLayout","node":"node14","to":"pageStyle9"} So don't use unwrap. Source-Repo: https://github.com/servo/servo Source-Revision: 10f3a89313464c98f11ff64fed741abcba6352a6
This commit is contained in:
Родитель
f2de86fd3c
Коммит
42d8e855bf
|
@ -459,7 +459,8 @@ impl Actor for PageStyleActor {
|
|||
.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)
|
||||
// as specified in getLayout in
|
||||
|
|
Загрузка…
Ссылка в новой задаче