mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Remove a couple trivial dependencies on nsPresContext.
Differential Revision: https://phabricator.services.mozilla.com/D20141
This commit is contained in:
parent
3231714758
commit
dcfe30ff18
9 changed files with 32 additions and 34 deletions
|
@ -10,7 +10,6 @@ use crate::counter_style::{Symbol, Symbols};
|
|||
use crate::gecko_bindings::structs::{nsStyleCoord, CounterStylePtr};
|
||||
use crate::gecko_bindings::structs::{StyleGridTrackBreadth, StyleShapeRadius};
|
||||
use crate::gecko_bindings::sugar::ns_style_coord::{CoordData, CoordDataMut, CoordDataValue};
|
||||
use crate::media_queries::Device;
|
||||
use crate::values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
|
||||
use crate::values::computed::{Angle, Length, LengthPercentage};
|
||||
use crate::values::computed::{Number, NumberOrPercentage, Percentage};
|
||||
|
@ -387,16 +386,15 @@ pub fn round_border_to_device_pixels(width: Au, au_per_device_px: Au) -> Au {
|
|||
|
||||
impl CounterStyleOrNone {
|
||||
/// Convert this counter style to a Gecko CounterStylePtr.
|
||||
pub fn to_gecko_value(self, gecko_value: &mut CounterStylePtr, device: &Device) {
|
||||
pub fn to_gecko_value(self, gecko_value: &mut CounterStylePtr) {
|
||||
use crate::gecko_bindings::bindings::Gecko_SetCounterStyleToName as set_name;
|
||||
use crate::gecko_bindings::bindings::Gecko_SetCounterStyleToSymbols as set_symbols;
|
||||
let pres_context = device.pres_context();
|
||||
match self {
|
||||
CounterStyleOrNone::None => unsafe {
|
||||
set_name(gecko_value, atom!("none").into_addrefed(), pres_context);
|
||||
set_name(gecko_value, atom!("none").into_addrefed());
|
||||
},
|
||||
CounterStyleOrNone::Name(name) => unsafe {
|
||||
set_name(gecko_value, name.0.into_addrefed(), pres_context);
|
||||
set_name(gecko_value, name.0.into_addrefed());
|
||||
},
|
||||
CounterStyleOrNone::Symbols(symbols_type, symbols) => {
|
||||
let symbols: Vec<_> = symbols
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue