Wednesday, November 28, 2012

Forcing active layers

When implementing or debugging layers stuff it is often useful to force a layer to be active - active layers have different behaviour from inactive ones, e.g., only active layers can have mask layers - and it is nice to know whether a glitch is due to code on the active or inactive path, or because a layer should be active and isn't, or vice versa. The easiest way to force a single layer to be active is to give it a 1 pixel 3d transform (this is ultra-hackey, please don't use this except for debugging). But sometimes it is nice to make all layers active, or be able to switch between active/inactive without editing HTML. So, I added a pref to do just that, in about:config, set layers.force-active to true and all possible layers should become active. This shouldn't affect which content gets a layer, if it didn't get its own layer before it won't get one with the pref. This is not meant for normal browsing and may cause all kinds of bugs.

4 comments:

Unknown said...

Thanks for doing this. When you say that it may cause of kinds of bugs do you expect this to show any false positive bugs? I would expect any bugs we see by forcing this on to be a real layers bug. Is that the case?

Nick Cameron. said...

Hmm, good question, I don't expect any bugs, but since it will be using a path which is sometimes untested, then it is possible (likely) some bugs might appear. As far as I know, any layer that is inactive can sometimes be active and so any bugs should be real bugs. But there are (or could be in the future) edge cases (e.g., an image layer where the image container is not ready, although in this case I think this should give layers_none and therefore no problem) where we might get a crash or rendering glitch we might otherwise not see. I guess we could argue these are 'real' bugs because they break an implicit inactive => could be active invariant.

mayankleoboy1 said...

Hi Nick
I have filed a bunch of bugs that occur only with HWA off, on win7 Nightly.
Are you the person who looks at these types of bugs ?

Nick Cameron. said...

mayankleoboy1: sometimes, depends on where the bugs are likely to be in the code. I'll have a look and grab any that I think I can fix...