Closed Bug 329600 Opened 20 years ago Closed 20 years ago

Eliminate SVG observer usage in nsSVGStopFrame

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: scootermorris)

Details

Attachments

(1 file, 3 obsolete files)

Eliminate SVG observer usage in nsSVGStopFrame.
Attached patch Remove observers (obsolete) — Splinter Review
Assignee: general → scootermorris
Status: NEW → ASSIGNED
Attachment #214453 - Flags: review?(jwatt)
Comment on attachment 214453 [details] [diff] [review] Remove observers Might as well loose the protected: declaration from the class declaration, but there should be a public: declaration in there for many of those functions. > /** > * Get the "type" of the frame > * > * @see nsLayoutAtoms::svgStopFrame > */ This should say nsGkAtoms now. > NS_INTERFACE_MAP_BEGIN(nsSVGStopFrame) >- NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver) >- NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) > NS_INTERFACE_MAP_END_INHERITING(nsSVGStopFrameBase) I wonder if there's a prefered macro for when there are no interface map entries. >+nsSVGStopFrame::AttributeChanged(PRInt32 aNameSpaceID, >+ nsIAtom* aAttribute, >+ PRInt32 aModType) >+{ >+ if (aNameSpaceID == kNameSpaceID_None && >+ aAttribute == nsGkAtoms::offset) { Uh, what about the Begin/EndBatchUpdate thing?
Attached patch Address review comments (obsolete) — Splinter Review
Attachment #214453 - Attachment is obsolete: true
Attachment #214474 - Flags: review?(jwatt)
Attachment #214453 - Flags: review?(jwatt)
Can you put AttributeChanged above GetType, and DidSetStyleContext plus the nsIFrame comment above that? (That's the order they appear in in nsIFrame.h, and it puts the nsIFrame comment in the right place.) Also can you put an: // nsIFrameDebug interface: comment above the definition of GetFrameName (after the ifdef). You can also loose the "protected:" above the friend declaration. Can you replace |mParent->QueryInterface| with |CallQueryInterface|, and can you change |value| to |svgParent| to give it a more helpful name.
Attached patch Address second round of comments (obsolete) — Splinter Review
Attachment #214474 - Attachment is obsolete: true
Attachment #214566 - Flags: review?(jwatt)
Attachment #214474 - Flags: review?(jwatt)
Comment on attachment 214566 [details] [diff] [review] Address second round of comments r=me. It is now a thing of beauty. :-)
Attachment #214566 - Flags: review?(jwatt) → review+
Although when I suggested using CallQueryInterface I actually meant like this: if (NS_SUCCEEDED(CallQueryInterface(mParent, &svgParent))) {
Attachment #214566 - Flags: superreview?(roc)
Comment on attachment 214566 [details] [diff] [review] Address second round of comments This is OK, but the usage of Begin/EndBatchUpdate is hackish. nsSVGGradientFrame really needs a method to notify it that the stop has changed. We could make nsSVGGradientFrame public in its own .h file, and give it an IID so you can QI to it and call the method. Please file a followup bug on this.
Attachment #214566 - Flags: superreview?(roc) → superreview+
Comment on attachment 214566 [details] [diff] [review] Address second round of comments This is OK, but the usage of Begin/EndBatchUpdate is hackish. nsSVGGradientFrame really needs a method to notify it that the stop has changed. We could make nsSVGGradientFrame public in its own .h file, and give it an IID so you can QI to it and call the method. Please file a followup bug on this.
Checking in layout/svg/base/src/nsSVGStopFrame.cpp; /cvsroot/mozilla/layout/svg/base/src/nsSVGStopFrame.cpp,v <-- nsSVGStopFrame.cpp new revision: 1.9; previous revision: 1.8 done checked in on trunk r=jwatt/sr=roc
Attached patch Patch checked inSplinter Review
Attachment #214566 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: