On Sat, Dec 5, 2015 at 3:21 AM, Martin Robinson <mrobin...@igalia.com> wrote:
> Every node and flow tree element (Flows and Fragments) have a bitflag > which tracks the type of damage caused by restyling and DOM > manipulation. This flag is used during incremental layout to only repair > parts of the tree that actually need it. There is a class of bugs where > damage is applied too liberally. This doesn't break layout, but it means > that too much work is done during reflow. These type of bugs become even > more important when display lists can be repaired without doing reflows. > > I would like to have a way to test against these kind of regressions, > but I'm a bit stumped on what sort of testing infrastructure to use. > Here are some ideas that I had: > > 1. Paint "dirty" regions of the page. We could create special reftests > that verify that only certain parts of the page are reflowed or repaired. > > 2. Textual dumps of the flow tree. It would be tricky to make this > resilient enough not to break all the time. > > 3. Simple assertions about what nodes are dirty and what aren't. This > could break when the internal structure of the flow tree changes. > > I'm certainly open to completely different ideas, because I have a lot > of reluctance about the three ideas that I mentioned. They all have some > significant drawbacks. > In Gecko reftests we have a MozReftestInvalidate event and a class "reftest-no-paint" on elements. The MozReftestInvalidate event fires after rendering has stabilized (that's complicated...), and the event handler is expected to do something that causes repainting or recompositing. There's a "painted" flag on nsIFrames (CSS boxes) that gets cleared for all frames before we run that event handler, and is set whenever we paint a display item for the frame into a layer. When the test ends, we assert that the frames for all reftest-no-paint elements don't have their painted flags set. Thus we can test that scrolling or animated transforms are recomposited without rerasterizing the elements. We don't have anything similar for reflows, but that sounds like it would be a good idea. The exact definitions of these flags depend somewhat on the implementation details of the engine, but they've been very robust and flexible for Gecko. Rob -- lbir ye,ea yer.tnietoehr rdn rdsme,anea lurpr edna e hnysnenh hhe uresyf toD selthor stor edna siewaoeodm or v sstvr esBa kbvted,t rdsme,aoreseoouoto o l euetiuruewFa kbn e hnystoivateweh uresyf tulsa rehr rdm or rnea lurpr .a war hsrer holsa rodvted,t nenh hneireseoouot.tniesiewaoeivatewt sstvr esn _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo