[1.1] Implement XPath function Choose()

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
10 years ago
2 years ago

People

(Reporter: Merle Sterling, Assigned: Merle Sterling)

Tracking

({dev-doc-complete})

Trunk
x86
Windows XP
dev-doc-complete

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(4 attachments, 4 obsolete attachments)

(Assignee)

Description

10 years ago
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
(Assignee)

Comment 1

10 years ago
Created attachment 323365 [details]
testcase: 7.11.1.a
(Assignee)

Updated

10 years ago
Depends on: 436864
(Assignee)

Comment 2

10 years ago
Created attachment 323368 [details]
testcase: number return type
(Assignee)

Comment 3

10 years ago
Created attachment 323369 [details]
testcase: mixed number and string return type
(Assignee)

Comment 4

10 years ago
Created attachment 323373 [details] [diff] [review]
txAny patch

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
(Assignee)

Comment 5

10 years ago
Created attachment 323374 [details] [diff] [review]
Choose patch

Requires the txAny patch.
(Assignee)

Comment 6

10 years ago
Created attachment 332642 [details] [diff] [review]
patch

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
(Assignee)

Comment 7

10 years ago
Created attachment 345763 [details] [diff] [review]
patch

Updated patch that works with the latest patch in bug436866.
Attachment #332642 - Attachment is obsolete: true
Attachment #345763 - Flags: review?(aaronr)

Comment 8

10 years ago
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+
(Assignee)

Comment 9

10 years ago
Created attachment 345775 [details] [diff] [review]
patch

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+

Comment 10

10 years ago
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.

Updated

10 years ago
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

Comment 12

10 years ago
(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.
(Assignee)

Updated

10 years ago
Keywords: checkin-needed

Updated

10 years ago
Duplicate of this bug: 466632
Whiteboard: [c-n: waiting for comment 12, new Hg repo is still empty]

Updated

10 years ago
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.

Comment 16

9 years ago
(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.

Comment 18

9 years ago
xforms repository is ready now
Whiteboard: [checkin-needed: waiting for comment 12, http://hg.mozilla.org/xforms/ is still empty][needs landing] → checkin-needed

Comment 19

9 years ago
checked in http://hg.mozilla.org/xforms/rev/1ab7ac145839
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Whiteboard: checkin-needed
Keywords: dev-doc-needed
This is now documented here:

https://developer.mozilla.org/en/XPath/Functions/choose
Keywords: dev-doc-needed → dev-doc-complete
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.