Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container.

This allows us to eliminate the unsafe borrows. \o/

MozReview-Commit-ID: 29hpGaWUFQz
This commit is contained in:
Bobby Holley 2016-09-29 17:09:06 -07:00
parent 5bcc4192bf
commit 687e1f701c
12 changed files with 96 additions and 142 deletions

View file

@ -4,15 +4,15 @@
use construct::ConstructionResult;
use script_layout_interface::restyle_damage::RestyleDamage;
use style::data::PrivateStyleData;
use style::data::PersistentStyleData;
/// Data that layout associates with a node.
pub struct PrivateLayoutData {
pub struct PersistentLayoutData {
/// Data that the style system associates with a node. When the
/// style system is being used standalone, this is all that hangs
/// off the node. This must be first to permit the various
/// transmuations between PrivateStyleData PrivateLayoutData.
pub style_data: PrivateStyleData,
/// transmutations between PersistentStyleData and PersistentLayoutData.
pub style_data: PersistentStyleData,
/// Description of how to account for recent style changes.
pub restyle_damage: RestyleDamage,
@ -34,11 +34,11 @@ pub struct PrivateLayoutData {
pub flags: LayoutDataFlags,
}
impl PrivateLayoutData {
impl PersistentLayoutData {
/// Creates new layout data.
pub fn new() -> PrivateLayoutData {
PrivateLayoutData {
style_data: PrivateStyleData::new(),
pub fn new() -> PersistentLayoutData {
PersistentLayoutData {
style_data: PersistentStyleData::new(),
restyle_damage: RestyleDamage::empty(),
flow_construction_result: ConstructionResult::None,
before_flow_construction_result: ConstructionResult::None,