Bug 1032613 part 1: Promote FrameMaintainsOverflow to be a public nsIFrame method, & implement it using HasAllStateBits. r=dbaron

This commit is contained in:
Daniel Holbert 2015-10-01 20:05:25 -07:00
Родитель 31f93552de
Коммит 09893a542f
3 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -818,8 +818,7 @@ RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
} else {
NS_ASSERTION(frame, "This shouldn't happen");
if ((frame->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
(frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
if (!frame->FrameMaintainsOverflow()) {
// frame does not maintain overflow rects, so avoid calling
// FinishAndStoreOverflow on it:
hint = NS_SubtractHint(hint,

Просмотреть файл

@ -5555,18 +5555,10 @@ nsIFrame::GetPreEffectsVisualOverflowRect() const
return r ? *r : GetVisualOverflowRectRelativeToSelf();
}
inline static bool
FrameMaintainsOverflow(nsIFrame* aFrame)
{
return (aFrame->GetStateBits() &
(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY)) !=
(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
}
/* virtual */ bool
nsFrame::UpdateOverflow()
{
MOZ_ASSERT(FrameMaintainsOverflow(this),
MOZ_ASSERT(FrameMaintainsOverflow(),
"Non-display SVG do not maintain visual overflow rects");
nsRect rect(nsPoint(0, 0), GetSize());
@ -7586,7 +7578,7 @@ bool
nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
nsSize aNewSize, nsSize* aOldSize)
{
NS_ASSERTION(FrameMaintainsOverflow(this),
NS_ASSERTION(FrameMaintainsOverflow(),
"Don't call - overflow rects not maintained on these SVG frames");
nsRect bounds(nsPoint(0, 0), aNewSize);
@ -7744,7 +7736,7 @@ nsIFrame::RecomputePerspectiveChildrenOverflow(const nsIFrame* aStartFrame, cons
nsFrameList::Enumerator childFrames(lists.CurrentList());
for (; !childFrames.AtEnd(); childFrames.Next()) {
nsIFrame* child = childFrames.get();
if (!FrameMaintainsOverflow(child)) {
if (!child->FrameMaintainsOverflow()) {
continue; // frame does not maintain overflow rects
}
if (child->HasPerspective()) {
@ -7792,7 +7784,7 @@ RecomputePreserve3DChildrenOverflow(nsIFrame* aFrame, const nsRect* aBounds)
nsFrameList::Enumerator childFrames(lists.CurrentList());
for (; !childFrames.AtEnd(); childFrames.Next()) {
nsIFrame* child = childFrames.get();
if (!FrameMaintainsOverflow(child)) {
if (!child->FrameMaintainsOverflow()) {
continue; // frame does not maintain overflow rects
}
if (child->Extend3DContext()) {

Просмотреть файл

@ -3027,6 +3027,15 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
return GetStateBits() & NS_FRAME_FONT_INFLATION_CONTAINER;
}
/**
* Return whether this frame keeps track of overflow areas. (Frames for
* non-display SVG elements -- e.g. <clipPath> -- do not maintain overflow
* areas, because they're never painted.)
*/
bool FrameMaintainsOverflow() const {
return !HasAllStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
}
/**
* Returns the content node within the anonymous content that this frame
* generated and which corresponds to the specified pseudo-element type,