1. Install http://mxr.mozilla.org/mozilla/source/testing/performance/talos/page_load_test/scroll/iframe.svg locally together with drac.htm and possibly scroll-frame.js. 2. Load iframe.svg. 3. Use the mouse to select text in the iframe. Expected results: Selected text is highlighted. Actual results: Text is not highlighted until after scrolling or focus change. Regression sometime after 633756e2a580 2010-06-01.
nsSVGForeignObjectFrame::InvalidateInternal doesn't do any invalidating of thebes layers like all other implementations of InvalidateInternal. I don't know SVG very well so that might not be the problem.
That does sound like the problem. Any volunteers to fix it? :-)
Well hmm, the nsSVGForeignObjectFrame should be in the same layer as the nsSVGOuterSVGFrame, so the current code actually should work.
Yeah, I realized that later. But if foreign object frames get layers we would need to fix that.
A regression window and simplified testcase would be nice here.
So the mScrollPosAtLastPaint of the scroll frame inside the svg foreign object never gets updated because PaintFrame call used to draw the contents of the svg foreign object doesn't pass the widget layers flag and hence doesn't set the painting to window flag on the display list builder.
Hmm, I see! We could add a new flag for nsLayoutUtils::PaintFrame that sets SetPaintingToWindow even if PAINT_WIDGET_LAYERS is false. This will only be temporary; once we convert SVG to use display lists, this won't be an issue.
Created attachment 482166 [details] [diff] [review] Part 1. Pass invalidation flags through SVG foreign objects. Just noticed this while reading code. I don't know of anything that it fixes, we don't need to take it for that reason.
Created attachment 482167 [details] [diff] [review] Part 2. Set painting to window flag when painting SVG foreign objects. The real fix for this bug.
A couple of nits in passing... In nsSVGUtils.h mPaintingToWindow should be a PRPackedBool Also IsPaintingToWindow (and the other existing accessors) should be const which would allow the additional argument to nsSVGOuterSVGFrame::Paint to be const too.
Thanks Robert. I made those changes in my queue.