mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.
This commit is contained in:
parent
b8900782b0
commit
466faac2a5
223 changed files with 4414 additions and 4105 deletions
|
@ -9,7 +9,7 @@ use incremental::{mod, RestyleDamage};
|
|||
use util::{LayoutDataAccess, LayoutDataWrapper};
|
||||
use wrapper::{LayoutElement, LayoutNode, TLayoutNode};
|
||||
|
||||
use script::dom::node::{TextNodeTypeId};
|
||||
use script::dom::node::NodeTypeId;
|
||||
use servo_util::bloom::BloomFilter;
|
||||
use servo_util::cache::{Cache, LRUCache, SimpleHashCache};
|
||||
use servo_util::smallvec::{SmallVec, SmallVec16};
|
||||
|
@ -18,8 +18,8 @@ use std::mem;
|
|||
use std::hash::{Hash, sip};
|
||||
use std::slice::Items;
|
||||
use string_cache::{Atom, Namespace};
|
||||
use style::{mod, After, Before, ComputedValues, DeclarationBlock, Stylist, TElement, TNode};
|
||||
use style::{AttrIsEqualMode, AttrIsPresentMode, CommonStyleAffectingAttributes, cascade};
|
||||
use style::{mod, PseudoElement, ComputedValues, DeclarationBlock, Stylist, TElement, TNode};
|
||||
use style::{CommonStyleAffectingAttributeMode, CommonStyleAffectingAttributes, cascade};
|
||||
use sync::Arc;
|
||||
|
||||
pub struct ApplicableDeclarations {
|
||||
|
@ -153,12 +153,12 @@ fn create_common_style_affecting_attributes_from_element(element: &LayoutElement
|
|||
let mut flags = CommonStyleAffectingAttributes::empty();
|
||||
for attribute_info in style::common_style_affecting_attributes().iter() {
|
||||
match attribute_info.mode {
|
||||
AttrIsPresentMode(flag) => {
|
||||
CommonStyleAffectingAttributeMode::IsPresent(flag) => {
|
||||
if element.get_attr(&ns!(""), &attribute_info.atom).is_some() {
|
||||
flags.insert(flag)
|
||||
}
|
||||
}
|
||||
AttrIsEqualMode(target_value, flag) => {
|
||||
CommonStyleAffectingAttributeMode::IsEqual(target_value, flag) => {
|
||||
match element.get_attr(&ns!(""), &attribute_info.atom) {
|
||||
Some(element_value) if element_value == target_value => {
|
||||
flags.insert(flag)
|
||||
|
@ -273,13 +273,13 @@ impl StyleSharingCandidate {
|
|||
|
||||
for attribute_info in style::common_style_affecting_attributes().iter() {
|
||||
match attribute_info.mode {
|
||||
AttrIsPresentMode(flag) => {
|
||||
CommonStyleAffectingAttributeMode::IsPresent(flag) => {
|
||||
if self.common_style_affecting_attributes.contains(flag) !=
|
||||
element.get_attr(&ns!(""), &attribute_info.atom).is_some() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
AttrIsEqualMode(target_value, flag) => {
|
||||
CommonStyleAffectingAttributeMode::IsEqual(target_value, flag) => {
|
||||
match element.get_attr(&ns!(""), &attribute_info.atom) {
|
||||
Some(ref element_value) if self.common_style_affecting_attributes
|
||||
.contains(flag) &&
|
||||
|
@ -501,12 +501,12 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
|||
stylist.push_applicable_declarations(self,
|
||||
parent_bf,
|
||||
None,
|
||||
Some(Before),
|
||||
Some(PseudoElement::Before),
|
||||
&mut applicable_declarations.before);
|
||||
stylist.push_applicable_declarations(self,
|
||||
parent_bf,
|
||||
None,
|
||||
Some(After),
|
||||
Some(PseudoElement::After),
|
||||
&mut applicable_declarations.after);
|
||||
|
||||
*shareable = applicable_declarations.normal_shareable &&
|
||||
|
@ -520,7 +520,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
|||
parent: Option<LayoutNode>)
|
||||
-> StyleSharingResult {
|
||||
if !self.is_element() {
|
||||
return CannotShare(false)
|
||||
return StyleSharingResult::CannotShare(false)
|
||||
}
|
||||
let ok = {
|
||||
let element = self.as_element();
|
||||
|
@ -528,7 +528,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
|||
element.get_attr(&ns!(""), &atom!("id")).is_none()
|
||||
};
|
||||
if !ok {
|
||||
return CannotShare(false)
|
||||
return StyleSharingResult::CannotShare(false)
|
||||
}
|
||||
|
||||
for (i, &(ref candidate, ())) in style_sharing_candidate_cache.iter().enumerate() {
|
||||
|
@ -540,13 +540,13 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
|||
let style = &mut shared_data.style;
|
||||
let damage = incremental::compute_damage(style, &*shared_style);
|
||||
*style = Some(shared_style);
|
||||
return StyleWasShared(i, damage)
|
||||
return StyleSharingResult::StyleWasShared(i, damage)
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
|
||||
CannotShare(true)
|
||||
StyleSharingResult::CannotShare(true)
|
||||
}
|
||||
|
||||
// The below two functions are copy+paste because I can't figure out how to
|
||||
|
@ -614,7 +614,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
|
|||
&None => panic!("no layout data"),
|
||||
&Some(ref mut layout_data) => {
|
||||
match self.type_id() {
|
||||
Some(TextNodeTypeId) => {
|
||||
Some(NodeTypeId::Text) => {
|
||||
// Text nodes get a copy of the parent style. This ensures
|
||||
// that during fragment construction any non-inherited
|
||||
// CSS properties (such as vertical-align) are correctly
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
//! Style retrieval from DOM elements.
|
||||
|
||||
use wrapper::{After, Before, Normal, ThreadSafeLayoutNode};
|
||||
use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
|
||||
|
||||
use std::mem;
|
||||
use style::ComputedValues;
|
||||
|
@ -27,7 +27,7 @@ impl<'ln> StyledNode for ThreadSafeLayoutNode<'ln> {
|
|||
unsafe {
|
||||
let layout_data_ref = self.borrow_layout_data();
|
||||
match self.get_pseudo_element_type() {
|
||||
Before(_) => {
|
||||
PseudoElementType::Before(_) => {
|
||||
mem::transmute(layout_data_ref.as_ref()
|
||||
.unwrap()
|
||||
.data
|
||||
|
@ -35,7 +35,7 @@ impl<'ln> StyledNode for ThreadSafeLayoutNode<'ln> {
|
|||
.as_ref()
|
||||
.unwrap())
|
||||
}
|
||||
After(_) => {
|
||||
PseudoElementType::After(_) => {
|
||||
mem::transmute(layout_data_ref.as_ref()
|
||||
.unwrap()
|
||||
.data
|
||||
|
@ -43,7 +43,7 @@ impl<'ln> StyledNode for ThreadSafeLayoutNode<'ln> {
|
|||
.as_ref()
|
||||
.unwrap())
|
||||
}
|
||||
Normal => {
|
||||
PseudoElementType::Normal => {
|
||||
mem::transmute(layout_data_ref.as_ref()
|
||||
.unwrap()
|
||||
.shared_data
|
||||
|
@ -66,9 +66,9 @@ impl<'ln> StyledNode for ThreadSafeLayoutNode<'ln> {
|
|||
|
||||
let style =
|
||||
match self.get_pseudo_element_type() {
|
||||
Before(_) => &mut layout_data.data.before_style,
|
||||
After (_) => &mut layout_data.data.after_style,
|
||||
Normal => &mut layout_data.shared_data.style,
|
||||
PseudoElementType::Before(_) => &mut layout_data.data.before_style,
|
||||
PseudoElementType::After (_) => &mut layout_data.data.after_style,
|
||||
PseudoElementType::Normal => &mut layout_data.shared_data.style,
|
||||
};
|
||||
|
||||
*style = None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue