Re: [dev-servo] CSSOM ownership woes

2016-11-14 Thread Manish Goregaokar
On Mon, Nov 14, 2016 at 5:11 PM, Xidorn Quan wrote: > I guess it is probably doable, but that means parsing and traversing the > tree would involve lots of additional FFI calls to build and access the > tree in Gecko side. It also can't be done lazily if it's a single tree. My current Servo-side

Re: [dev-servo] CSSOM ownership woes

2016-11-14 Thread Xidorn Quan
On Tue, Nov 15, 2016, at 04:03 AM, Simon Sapin wrote: > On 11/11/16 12:22, Manish Goregaokar wrote: > > Servo currently has a style tree (stylesheets->rulelist->rules->other > > rules and rule lists) in style::Stylesheet[1], and this is shared with > > the DOM via Arcs. As I understand it, Gecko, o

Re: [dev-servo] CSSOM ownership woes

2016-11-14 Thread Simon Sapin
On 11/11/16 12:22, Manish Goregaokar wrote: Servo currently has a style tree (stylesheets->rulelist->rules->other rules and rule lists) in style::Stylesheet[1], and this is shared with the DOM via Arcs. As I understand it, Gecko, on the other hand, just uses the CSSOM DOM tree and has no "style t

Re: [dev-servo] CSSOM ownership woes

2016-11-11 Thread Manish Goregaokar
> Or probably asserting that we're not in a Servo Layout thread when we > `borrow_mut`? Not perfect, but... Extra runtime check and I'm not fond of this solution in general, since it's runtime. The token thing is a pure compile time option. Making it !Send+!Sync means that it's hard to make it ac

Re: [dev-servo] CSSOM ownership woes

2016-11-11 Thread Emilio Cobos Álvarez
On Fri, Nov 11, 2016 at 03:22:16AM -0800, Manish Goregaokar wrote: > A possible solution is to have a opaquish DOM backpointer to > corresponding rule objects in the style tree and have it call some > update function to update the DOM when mutating. This isn't a great > solution IMO. Note that thi

[dev-servo] CSSOM ownership woes

2016-11-11 Thread Manish Goregaokar
This is basically the gist of a discussion that I and xidorn were having, pertaining to CSSOM in both Servo and Stylo. We mostly wrapped it up, but there are loose ends and I'm not sure if the choices made are correct. In CSSOM, you basically have a StyleSheetList holding many StyleSheets holding