Closed Bug 734656 Opened 13 years ago Closed 13 years ago

Make the NS_STATE_SVG_NONDISPLAY_CHILD classes easier to find

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(2 files, 2 obsolete files)

The way we have nsSVGContainerFrame set NS_STATE_SVG_NONDISPLAY_CHILD, and then have nsSVGDisplayContainerFrame inherit nsSVGContainerFrame is not great design. Worse, nsSVGDisplayContainerFrame and its sub-classes do not clear that bit which makes the code confusing when you're trying to understand how NS_STATE_SVG_NONDISPLAY_CHILD works. The (very easy to miss) trick is that nsSVGDisplayContainerFrame::Init calls nsSVGContainerFrameBase::Init, and _not_ nsSVGDisplayContainerFrameBase::Init, thereby skipping over the nsSVGContainerFrame::Init method which sets the NS_STATE_SVG_NONDISPLAY_CHILD bit. I assume the reason for this ugly way of doing things was to avoid adding extra virtual Init methods to the frames that need NS_STATE_SVG_NONDISPLAY_CHILD set. However, we can set the bit in their ctors instead, which is what we should do I think. Setting the bit on the frames than need it helps clarify which frames have this bit set rather than obfuscating it, and in fact it allows us to _remove_ the virtual Init method on nsSVGContainerFrame.
Attached patch patch (obsolete) (deleted) — Splinter Review
Attachment #604654 - Flags: review?
Attached patch patch (obsolete) (deleted) — Splinter Review
Attachment #604654 - Attachment is obsolete: true
Attachment #604655 - Flags: review?(longsonr)
Attachment #604654 - Flags: review?
Attached patch patch (deleted) — Splinter Review
This adds handling for the <defs> and unknown SVG element case, which I forgot.
Attachment #604655 - Attachment is obsolete: true
Attachment #604656 - Flags: review?(longsonr)
Attachment #604655 - Flags: review?(longsonr)
Attachment #604656 - Flags: review?(longsonr) → review+
Attachment #604657 - Attachment is patch: true
Attachment #604657 - Flags: review?(longsonr) → review+
Blocks: 734079
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: