Closed Bug 232780 Opened 21 years ago Closed 20 years ago

nsViewManager::CreateDisplayList parameters aX/aY used inconsistently

Categories

(Core :: Web Painting, defect, P1)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file)

The aX and aY parameters to nsViweManager::CreateDisplayList are used
inconsistently. Sometimes we add them to the result of aView->GetBounds(), or
add them to the result of the old nsView::GetClippedRect (which returned a rect
relative to the origin of aView's parent) --- indicating that they should be an
offset to the origin of aView's parent. However, it's clear that in the call to
CreateDisplayList from BuildDisplayList, aX and aY are the offset from the
topmost root view (the view with no parent) to displayRoot (NOT displayRoot's
parent). In fact there's code "if (aTopView == aView)" in CreateDisplayList that
compensates for this fact by adjusting "bounds" and "pos". But this code does
not correct aX and aY so errors can still creep in later (as it turns out, only
if displayRoot is not the topmost root view, i.e., only when we're painting a
floating view or handling event capturing).

This is why the "if (!clipped) clipRect = aClipRect;" code is 'needed' in
AddToDisplayList ... it wipes out the incorrect clipRect computed by this bug.
Summary: nsViweManager::CreateDisplayList parameters aX/aY used inconsistently → nsViewManager::CreateDisplayList parameters aX/aY used inconsistently
Attached patch fixSplinter Review
This patch makes aX/aY consistently represent an offset to the origin of
aView's parent. It also adds some much needed comments.

With this patch, the offensive code in AddToDisplayList can be deleted.
Attachment #140346 - Flags: superreview?(dbaron)
Attachment #140346 - Flags: review?(dbaron)
Comment on attachment 140346 [details] [diff] [review]
fix

r+sr=dbaron, but why not remove the |aTopView| parameter entirely?
Attachment #140346 - Flags: superreview?(dbaron)
Attachment #140346 - Flags: superreview+
Attachment #140346 - Flags: review?(dbaron)
Attachment #140346 - Flags: review+
the other patch I just submitted to you adds a new use of aTopView in the body
of CreateDisplayList.
But in general CreateDisplayList could use some cleanup, yeah.
Priority: -- → P1
checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: