Closed Bug 324096 Opened 15 years ago Closed 15 years ago

nsXFormsNodeState should work with NS_EVENT constants

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: surkov, Assigned: allan)

References

Details

(Keywords: fixed1.8.0.4, fixed1.8.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20051212 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20051212 Firefox/1.6a1

http://lxr.mozilla.org/mozilla/source/extensions/xforms/nsXFormsModelElement.cpp#723

XXX: nsXFormsNodeState could expose a bitmask using NS_EVENTs, to avoid
most of this...

nsXFormsNodeState can have a method for converting its own constants to NS_EVENTs constants (if ... then ...) to fix the bug. But I don't like a much the approach.

The problem as I can see is nsXFormsNodeState dublicates some nsIEventStateManager constants, nsXFormsUtils events constants. Probably is it a better way to remove dublicate constants?

Reproducible: Always
Summary: nsXFormsNodeState should can work with NS_EVENT constants → nsXFormsNodeState should work with NS_EVENT constants
Status: UNCONFIRMED → NEW
Ever confirmed: true
It looks like eFlag_DISPATCH_CONSTRAINT_CHANGED constant insn't used. There is no explicit references on it. And when eFlag_DISPATCH_CONSTRAINT_CHANGED is setted then eFlag_DISPATCH_VALUE_CHANGED is setted too. Isn't it right?
I have a question. Why INHERITED_RELEVANT and INHERITED_READONLY constants are needed? Thease constants are used only in nsXFormsMDGEngine::AttachInheritance() method. I guess AttachInheritance() method can use only RELEVANT and READONLY constants for inheritance realization. What befenits are with INHERITED_ constants?
(In reply to comment #2)
> I have a question. Why INHERITED_RELEVANT and INHERITED_READONLY constants are
> needed? Thease constants are used only in
> nsXFormsMDGEngine::AttachInheritance() method. I guess AttachInheritance()
> method can use only RELEVANT and READONLY constants for inheritance
> realization. What befenits are with INHERITED_ constants?
> 

Benefirs are there. As I understand It's optimization issue.

It seems like eFlag_SCHEMA_VALID constants isn't used at all. nsXFormsNodeState have unused methods like TestAndSet(). Why?
(In reply to comment #3)
> (In reply to comment #2)
> > I have a question. Why INHERITED_RELEVANT and INHERITED_READONLY constants are
> > needed? Thease constants are used only in
> > nsXFormsMDGEngine::AttachInheritance() method. I guess AttachInheritance()
> > method can use only RELEVANT and READONLY constants for inheritance
> > realization. What befenits are with INHERITED_ constants?
> > 
> 
> Benefirs are there. As I understand It's optimization issue.
> 
> It seems like eFlag_SCHEMA_VALID constants isn't used at all. nsXFormsNodeState
> have unused methods like TestAndSet(). Why?

I haven't looked at that code for a while, but there might be non-optimal stuff and things not used, because it was originally ported (by me) from another XForms processor.
Blocks: 328864
Attached patch PatchSplinter Review
This does not actually use the NS_EVENT things, because I think we cannot both save space and reuse the event constants. Maybe with some bit-fiddling, but then we depend heavily on the actually defines in the nsIEventStateManager.

The patch also kills the two dead code bits that Alexander mentions.
Attachment #213479 - Flags: review?(smaug)
Attachment #213479 - Flags: review?(smaug) → review+
Attachment #213479 - Flags: review?(aaronr)
Assignee: aaronr → allan
Attachment #213479 - Flags: review?(aaronr) → review+
(In reply to comment #5)
> 
> The patch also kills the two dead code bits that Alexander mentions.
> 

Patch looks fine but I guess TestAndClear() isn't used too :).
Checked in on trunk
Status: NEW → ASSIGNED
Whiteboard: xf-to-branch
*** Bug 328864 has been marked as a duplicate of this bug. ***
Blocks: 326556
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Blocks: 332853
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.