Closed Bug 1751473 Opened 2 years ago Closed 2 years ago

Improve type-safety and clean up for image frame and html canvas frame

Categories

(Core :: Layout: Images, Video, and HTML Frames, task)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Details in upcoming patches.

The method is equivalent to GetContentRectRelativeToSelf().

The old code operates in the CSS pixel coordinate, so we should use the type
system to express that. With this patch, nsImageControlFrame, nsImageFrame, and
nsImageMap now have no usage of nsIntPoint.

Depends on D136646

The method is equivalent to GetContentRectRelativeToSelf().

Depends on D136647

In general, we don't need to store used border and padding in a derived frame
class, nsIFrame::GetLogicalUsedBorderAndPadding() already provides the data.

While auditing the consumer of mBorderPadding, I realize that
nsHTMLCanvasFrame's fragmentation never works because
nsCSSFrameConstructor::CreateContinuingFrame() never creates its continuation,
and nsHTMLCanvasFrame::Reflow() never returns an incomplete reflow status to its
parent.

This patch removes the code that pretended to handle fragmentation to avoid any
confusion. Luckily, with layout.display-list.improve-fragmentation enabled by
default, we can still print <canvas> without data loss.

Depends on D136648

Blocks: 1751529
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/28e882f6e630
Part 1 - Remove nsImageFrame::GetInnerArea(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/e360e9830929
Part 2 - Use CSSIntPoint instead of nsIntPoint in image event handling code. r=emilio
https://hg.mozilla.org/integration/autoland/rev/11035bf5e573
Part 3 - Remove nsHTMLCanvasFrame::GetInnerArea(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/7b6739a30266
Part 4 - Delete nsHTMLCanvasFrame::mBorderPadding and unused code for handling fragmentation. r=emilio
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: