I filed https://github.com/mozilla/servo/issues/1676 a few days ago but there hasn't been any discussion yet; I think it's important to sort out this problem now so we don't have to do a lot of backtracking when we get around to implementing the COW DOM.

In brief, we have various methods in layout that cast a node to its concrete type and fetch a data member (such as HTMLImageElement's |image|, which is a Url that's set in content when the src attribute changes). As of right now, this particular operation is racy, since we don't have any calls to Node::wait_until_safe_to_modify_dom in place around the writing code in script to guarantee exclusion.

This brings up the larger point that we're doing this same thing in various places, and we need to sort out a strategy. In the COW DOM world, we would either need to implement COW for certain Node-derived members or declare that layout always fetches the attribute value, which will be set up for COW. This latter strategy still means that properties such as CharacterData's content will need to be COW, since they're not attribute-based.

For the short term I'm interested in making layout code always go for the attributes, because relying on sprinkling wait_until_safe_to_modify_dom all over content code is easy to get wrong. Thoughts?

Cheers,
Josh
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to