Make XPath evaluation use context size and position

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
14 years ago
2 years ago

People

(Reporter: Allan Beaufour, Assigned: Allan Beaufour)

Tracking

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

1.67 KB, application/xhtml+xml
Details
1.17 KB, application/xhtml+xml
Details
35.19 KB, patch
smaug
: review+
Doron Rosenberg (IBM)
: review+
Details | Diff | Splinter Review
(Assignee)

Description

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

Updated

14 years ago
Blocks: 264329
(Assignee)

Comment 1

13 years ago
I've created a Transformiix bug (bug 292841) for adding context size and
position to the XPath expressions.
Depends on: 292841
(Assignee)

Comment 2

13 years ago
Created attachment 182582 [details]
testcase for bind
(Assignee)

Comment 3

13 years ago
Created attachment 182583 [details]
testcase for repeat
(Assignee)

Comment 4

13 years ago
Created attachment 182588 [details] [diff] [review]
Rough patch

Here's a rough patch for it. Rough == haven't looked it through, but it seems
to work :)
Assignee: aaronr → allan
Status: NEW → ASSIGNED
(Assignee)

Comment 5

13 years ago
Created attachment 184912 [details] [diff] [review]
Polished patch

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 6

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

Comment 7

13 years ago
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)

Updated

13 years ago
Attachment #184912 - Flags: review?(doronr) → review+
(Assignee)

Comment 8

13 years ago
Checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.