mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
style: Miscellaneous Servo build fixes.
This commit is contained in:
parent
18cda1567a
commit
e227715aee
12 changed files with 59 additions and 10 deletions
|
@ -2902,6 +2902,7 @@ pub struct ComputedValues {
|
|||
|
||||
impl ComputedValues {
|
||||
/// Returns the pseudo-element that this style represents.
|
||||
#[cfg(feature = "servo")]
|
||||
pub fn pseudo(&self) -> Option<<&PseudoElement> {
|
||||
self.pseudo.as_ref()
|
||||
}
|
||||
|
|
|
@ -1718,6 +1718,7 @@ impl Clone for StrongRuleNode {
|
|||
}
|
||||
|
||||
impl Drop for StrongRuleNode {
|
||||
#[cfg_attr(feature = "servo", allow(unused_mut))]
|
||||
fn drop(&mut self) {
|
||||
let node = unsafe { &*self.ptr() };
|
||||
|
||||
|
|
|
@ -378,6 +378,19 @@ impl LengthPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
/// Converts to a `<percentage>` if possible.
|
||||
#[inline]
|
||||
pub fn to_percentage(&self) -> Option<Percentage> {
|
||||
match self.unpack() {
|
||||
Unpacked::Length(..) => None,
|
||||
Unpacked::Percentage(p) => Some(p),
|
||||
Unpacked::Calc(ref c) => {
|
||||
debug_assert!(!c.length.is_zero());
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the specified percentage if any.
|
||||
#[inline]
|
||||
pub fn specified_percentage(&self) -> Option<Percentage> {
|
||||
|
@ -405,7 +418,7 @@ impl LengthPercentage {
|
|||
|
||||
/// Convert the computed value into used value.
|
||||
#[inline]
|
||||
fn maybe_to_used_value(&self, container_len: Option<Length>) -> Option<Au> {
|
||||
pub fn maybe_to_used_value(&self, container_len: Option<Length>) -> Option<Au> {
|
||||
self.maybe_percentage_relative_to(container_len).map(Au::from)
|
||||
}
|
||||
|
||||
|
|
|
@ -168,8 +168,9 @@ pub enum GenericContent<ImageUrl> {
|
|||
pub use self::GenericContent as Content;
|
||||
|
||||
impl<ImageUrl> Content<ImageUrl> {
|
||||
/// Whether `self` represents list of items.
|
||||
#[inline]
|
||||
pub(crate) fn is_items(&self) -> bool {
|
||||
pub fn is_items(&self) -> bool {
|
||||
matches!(*self, Self::Items(..))
|
||||
}
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ impl Parse for Content {
|
|||
// normal | none | [ <string> | <counter> | open-quote | close-quote | no-open-quote |
|
||||
// no-close-quote ]+
|
||||
// TODO: <uri>, attr(<identifier>)
|
||||
#[cfg_attr(feature = "servo", allow(unused_mut))]
|
||||
fn parse<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue