Hi Robert,
I found a minor improvement of my previous patch on the check condition for nondisplay outer svg frame.
Previously we use:
HasAllStateBits(NS_STATE_IS_OUTER_SVG | NS_FRAME_IS_NONDISPLAY) &&
GetContent()->IsSVGElement(nsGkAtoms::svg)
That's ok, but a better way would be:
IsSVGOuterSVGFrame() && HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)
So that we can directly check the frame and avoid a level of indirection to the element.
How to submit a minor improvement like this?
BTW, then I don't know what's the purpose of having the flag NS_STATE_IS_OUTER_SVG at all, we can just check IsSVGOuterSVGFrame(). Do we need to clean up this flag?
Bug 1504072 Comment 6 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Hi Robert,
I found a minor improvement of my previous patch on the check condition for nondisplay outer svg frame.
Previously we use:
HasAllStateBits(NS_STATE_IS_OUTER_SVG | NS_FRAME_IS_NONDISPLAY) &&
GetContent()->IsSVGElement(nsGkAtoms::svg)
That's ok, but a better way would be using https://dxr.mozilla.org/mozilla-central/source/layout/generic/nsIFrame.h#2804:
IsSVGOuterSVGFrame() && HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)
So that we can directly check the frame and avoid a level of indirection to the element.
How to submit a minor improvement like this?
BTW, then I don't know what's the purpose of having the flag NS_STATE_IS_OUTER_SVG at all, we can just check IsSVGOuterSVGFrame(). Do we need to clean up this flag?