Closed Bug 354405 Opened 14 years ago Closed 14 years ago

Change mContent+mDocument to mNode in XPath treewalker

Categories

(Core :: XSLT, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: sicking, Assigned: sicking)

Details

Attachments

(1 file, 1 obsolete file)

We should change the

union {
  nsIDocument* mDocument;
  nsIContent* mContent;
};

to simply

nsINode* mNode;

in the treewalker. That way we don't have to check isDocument() whenever we're using methods that live on nsINode. And we can cast for the cases where we really need nsIContent/nsIDocument. Patch comming up that fixes that.

The patch also includes a fix to use nsIContent::GetID rather than nsIContent::GetIDAttributeName for some cycle saving goodness.
Attached patch Patch to fix (obsolete) — Splinter Review
Attachment #240250 - Flags: superreview?
Attachment #240250 - Flags: review?(peterv)
Attachment #240250 - Flags: superreview? → superreview?(peterv)
Attached patch Patch to fixSplinter Review
Opps, the previous attachment was an old version. This's the done one.
Attachment #240250 - Attachment is obsolete: true
Attachment #240252 - Flags: superreview?(peterv)
Attachment #240252 - Flags: review?(peterv)
Attachment #240250 - Flags: superreview?(peterv)
Attachment #240250 - Flags: review?(peterv)
Comment on attachment 240252 [details] [diff] [review]
Patch to fix

Sweet!
Attachment #240252 - Flags: superreview?(peterv)
Attachment #240252 - Flags: superreview+
Attachment #240252 - Flags: review?(peterv)
Attachment #240252 - Flags: review+
Checked in
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.