Closed Bug 436866 Opened 16 years ago Closed 15 years ago

[1.1] Implement XPath function Choose()

Categories

(Core Graveyard :: XForms, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: msterlin, Assigned: msterlin)

References

()

Details

(Keywords: dev-doc-complete)

Attachments

(4 files, 4 obsolete files)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008050115 Minefield/3.0pre

We need to implement the XPath function Choose() per section 7.11.1 of the XForms spec: http://www.w3.org/TR/xforms11/#fn-choose


Reproducible: Always
Attached file testcase: 7.11.1.a
Depends on: 436864
Attached patch txAny patch (obsolete) — Splinter Review
The txAny patch implements the txIAny interface to allow us to pass any XPath data type as a parameter. This approach or something similar is required in order to support a generic 'object' parameter. See bug436864
Attached patch Choose patch (obsolete) — Splinter Review
Requires the txAny patch.
Attached patch patch (obsolete) — Splinter Review
Updated patch to match the patch for bug436864 on which this patch depends.
Attachment #323373 - Attachment is obsolete: true
Attachment #323374 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
Updated patch that works with the latest patch in bug436866.
Attachment #332642 - Attachment is obsolete: true
Attachment #345763 - Flags: review?(aaronr)
Comment on attachment 345763 [details] [diff] [review]
patch


>+NS_IMETHODIMP
>+nsXFormsXPathFunctions::Choose(PRBool aValue,
>+                               txIXPathObject *aIfObject,
>+                               txIXPathObject *aElseObject,
>+                               txIXPathObject **aResult)
>+{

nit: I'd add a NS_ENSURE_ARG_POINTER(aResult) here

>+  if (aValue) {
>+    *aResult = aIfObject;
>+  } else {
>+    *aResult = aElseObject;
>+  }
>+
>+  return NS_OK;
>+}

with that, r=me
Attachment #345763 - Flags: review?(aaronr) → review+
Attached patch patchSplinter Review
Adding NS_ENSURE_ARG_POINTER per review comments.
Attachment #345763 - Attachment is obsolete: true
Attachment #345775 - Flags: review?(Olli.Pettay)
Attachment #345775 - Flags: review?(Olli.Pettay) → review+
What do we do with this patch now?  I asked in bug 436864 whether it could be put into the 1.9 branch and it is looking doubtful.  And we have no place to check in patches for 1.9.1.  Guess it is time to start discussing what we are going to do for FF 3.1.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #10)
> >And we have no place to
> check in patches for 1.9.1.  Guess it is time to start discussing what we are
> going to do for FF 3.1.
I guess we could create our own hg repository, similar to DOMi
(In reply to comment #11)
> (In reply to comment #10)
> > >And we have no place to
> > check in patches for 1.9.1.  Guess it is time to start discussing what we are
> > going to do for FF 3.1.
> I guess we could create our own hg repository, similar to DOMi

I filed bug 462981, they will create hg repository for us but we should fill it, to save cvs history we should follow the advise in the bug 439428 comment#2.
Keywords: checkin-needed
Whiteboard: [c-n: waiting for comment 12, new Hg repo is still empty]
Assignee: nobody → msterlin
Whiteboard: [c-n: waiting for comment 12, new Hg repo is still empty] → [c-n: waiting for comment 12, http://hg.mozilla.org/xforms/ is still empty]
Please, don't readd checkin-needed until the patch can actually be checked in :-|
Keywords: checkin-needed
Whiteboard: [c-n: waiting for comment 12, http://hg.mozilla.org/xforms/ is still empty] → [checkin-needed: waiting for comment 12, http://hg.mozilla.org/xforms/ is still empty][needs landing]
the first testcase (7.11.1.a) does not pass (any more?). The other two testcases are ok.
(In reply to comment #15)
> the first testcase (7.11.1.a) does not pass (any more?). The other two
> testcases are ok.

Looks like perhaps the first testcase has an error in it.  Try removing the quotes from around cats/cat and see if it works then.
Oh yes, I missed that. Without the quotes it works.
xforms repository is ready now
Whiteboard: [checkin-needed: waiting for comment 12, http://hg.mozilla.org/xforms/ is still empty][needs landing] → checkin-needed
checked in http://hg.mozilla.org/xforms/rev/1ab7ac145839
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: checkin-needed
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: