Closed Bug 265460 Opened 20 years ago Closed 20 years ago

Make XPath evaluation use context size and position

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: allan, Assigned: allan)

References

Details

Attachments

(3 files, 1 obsolete file)

Right now, XPath expressions are evaluated with context size and position == 1. We need to fix that so the right values are used. Transformiix has support for it.
Blocks: 264329
I've created a Transformiix bug (bug 292841) for adding context size and position to the XPath expressions.
Depends on: 292841
Attached file testcase for bind
Attached file testcase for repeat
Attached patch Rough patch (obsolete) — Splinter Review
Here's a rough patch for it. Rough == haven't looked it through, but it seems to work :)
Assignee: aaronr → allan
Status: NEW → ASSIGNED
Attached patch Polished patchSplinter Review
Bug 292841 is ready for check in, so here's a patch for xforms that uses the new evaluate function.
Attachment #182588 - Attachment is obsolete: true
Attachment #184912 - Flags: review?(smaug)
Comment on attachment 184912 [details] [diff] [review] Polished patch > > /// @todo Use aNode->contextPosition and aNode->contextSize (XXX) > /// @see https://bugzilla.mozilla.org/show_bug.cgi?id=265460 Shouldn't you remove this comment now? > nsISupports* retval; > nsresult rv; > >- rv = aNode->mExpression->Evaluate(aNode->mContextNode, >- nsIDOMXPathResult::BOOLEAN_TYPE, >- nsnull, >- &retval); >+ rv = aNode->mExpression->EvaluateWithContext(aNode->mContextNode, >+ aNode->mContextPosition, >+ aNode->mContextSize, >+ nsIDOMXPathResult::BOOLEAN_TYPE, >+ nsnull, >+ &retval); > NS_ENSURE_SUCCESS(rv, rv);
Attachment #184912 - Flags: review?(smaug) → review+
Comment on attachment 184912 [details] [diff] [review] Polished patch (In reply to comment #6) > (From update of attachment 184912 [details] [diff] [review] [edit]) > > > > /// @todo Use aNode->contextPosition and aNode->contextSize (XXX) > > /// @see https://bugzilla.mozilla.org/show_bug.cgi?id=265460 > > Shouldn't you remove this comment now? Indeed. Doron, will you do second r?
Attachment #184912 - Flags: review?(doronr)
Attachment #184912 - Flags: review?(doronr) → review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
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: