mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Remove some magic from the bindings
This simplifies a tiny bit our bindings in some places, and complicates it in others, but over all I think it's better. It requires a bit more manual code in the rust side to drop and cast the relevant pointers (which was done implicitly before), but it's a lot less magic than it used to be, and that's all autogenerated so consumers don't need to care about it. The set up is still not ideal. I don't like that we rely on destructors running in both sides of the FFI boundary, but that's for another day. This is the last usage of RawOffsetArc, so remove that. We now support proper Arc<> in structs (GridTemplateAreas uses it), so I don't think we'll need it any time soon. Differential Revision: https://phabricator.services.mozilla.com/D177905
This commit is contained in:
parent
e9bf977369
commit
d1046739fc
7 changed files with 320 additions and 472 deletions
|
@ -131,7 +131,7 @@ impl Device {
|
|||
line_height,
|
||||
pres_context.map_or(std::ptr::null(), |pc| pc),
|
||||
vertical,
|
||||
font.gecko(),
|
||||
&**font,
|
||||
element.map_or(std::ptr::null(), |e| e.0)
|
||||
)
|
||||
});
|
||||
|
@ -231,7 +231,7 @@ impl Device {
|
|||
bindings::Gecko_GetFontMetrics(
|
||||
pc,
|
||||
vertical,
|
||||
font.gecko(),
|
||||
&**font,
|
||||
base_size,
|
||||
// we don't use the user font set in a media query
|
||||
!in_media_query,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue