mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Deny unsafe code in style.
This commit is contained in:
parent
3f407ea3d6
commit
2fa45aa064
4 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,8 @@
|
|||
#![plugin(serde_macros)]
|
||||
#![plugin(plugins)]
|
||||
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
extern crate app_units;
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
@ -61,6 +63,7 @@ pub mod viewport;
|
|||
|
||||
// Generated from the properties.mako.rs template by build.rs
|
||||
#[macro_use]
|
||||
#[allow(unsafe_code)]
|
||||
pub mod properties {
|
||||
include!(concat!(env!("OUT_DIR"), "/properties.rs"));
|
||||
}
|
||||
|
|
|
@ -197,6 +197,7 @@ impl StyleSharingCandidate {
|
|||
/// Attempts to create a style sharing candidate from this node. Returns
|
||||
/// the style sharing candidate or `None` if this node is ineligible for
|
||||
/// style sharing.
|
||||
#[allow(unsafe_code)]
|
||||
fn new<'le, E: TElement<'le>>(element: &E) -> Option<StyleSharingCandidate> {
|
||||
let parent_element = match element.parent_element() {
|
||||
None => return None,
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// For lazy_static
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use cssparser::{Parser, SourcePosition};
|
||||
use dom::TElement;
|
||||
use log;
|
||||
|
|
|
@ -277,6 +277,7 @@ impl ViewportRule {
|
|||
Ok(ViewportRule { declarations: valid_declarations.iter().cascade() })
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn from_meta(content: &str) -> Option<ViewportRule> {
|
||||
let mut declarations = HashMap::new();
|
||||
macro_rules! push_descriptor {
|
||||
|
@ -458,6 +459,7 @@ impl ViewportDescriptorDeclaration {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn cascade<'a, I>(iter: I) -> Vec<ViewportDescriptorDeclaration>
|
||||
where I: Iterator<Item=&'a ViewportDescriptorDeclaration>
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue