I've just been working through an invalidation bug, and I wanted to know if
my understanding of these is correct:
Relationship of Rect and OverflowRect
-------------------------------------
1. mRect is anchored in the parent's coordinate system
2. overflowRect is anchored in the frame's own coordinate system
3. overflowRect must contain mRect except in certain cases concerning 'clip'
Reflow Expectations
-------------------
4. The frame is expected to take care of any invalidation required by
its children, its borders, its outline, and its background.
5. The reflower is expected to take care of any invalidation required by
changes in the child's a) position
b) size
Comments
--------
Assertion 3 is not strictly true because of the way nsRect::UnionRect is
implemented: if one rect is empty, then UnionRect takes the value of the
other rect, and therefore does not necessarily encompass any of the first
rect's coordinates. This means an assertion
frame->GetOverflowRect().Contains(frame->GetRect())
will sometimes fail.
Assertions 4 and 5 mean that the reflower can assume
- if the position is the same, it only needs to invalidate delta-mRect.
- if the position has changed, it needs to invalidate the old and new
overflowRects.
~fantasai
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout