[Following up on bug 13391].
RenderBox::computeAbsoluteRepaintRect() ignores the lightweight clip used by some form controls, the reason being that when it's called during layout, controlClipRect() returns a wrong result. In the context of a child of the control repainting during layout, you need the control's clip rect before layout. I have considered several ways to fix this:
1) Cache the clip rects in the controls themselves post layout(). This is a very fast and simple solution, but it increases the memory footprint of controls for information that's basically needed only during layout.
2) Cache the clip rects in a hash table kept in the RenderView. Controls can cache their current clip rect when entering layout() and delete it from the hash before returning from layout().
3) Similar to 2) but use a stack, so each control pushes its clip rect onto the stack. Since controls are very rarely nested, computeAbsoluteRepaintRect() could simply walk the stack looking for |o| (no need to pass the current stack pointer when recurring).
4) Maintain a true clipping rect stack in RenderView, including the "current clip", and pushing both control clip and layer clip. This will fix bug 11489 as well.
The disadvantage of 2-4 is the complexity, which includes having to keep a "during layout" code path separate from the "after layout" code path. I'd go with 1) or 2), assuming bug 11489 will be addressed by flexbox changes.
On second thought, I like 3) better than 2).
Created attachment 14136 [details]
Controls only clip children's foreground
I had written a patch and when I wanted to test it I realized that control clip is applied only to the children's foreground. I think it's a bug, but if it isn't, then this bug is INVALID.
(In reply to comment #2)
> I think it's a bug