Closed Bug 77830 Opened 24 years ago Closed 24 years ago

we search for <xsl:param> in far too many places

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: sicking, Assigned: sicking)

References

Details

Attachments

(5 files)

On many places in XSLTProcessor we call the function XSLTProcessor::processTemplate to process all children of an element. For example in the code for <xsl:if> we call processTemplate on the <xsl:if> element. However the ::processTemplate function steps though all children of the supplied element looking for <xsl:param> elements to enable parameters for templates, this is ofcourse only needed when processing an actuall template. I've added a new function XSLTProcessor::processChildren that does the same thing that ::processTemplate does except that it dosn't search for <xsl:param>s, and made all calls to ::processTemplate go to ::processChildren. I've also made LREs and variables call ::processChildren instead of steping through children by it self to give correct scoping to <xsl:variable>s
Status: NEW → ASSIGNED
Keywords: review
Hi Sicking, nice one again. But: Node* child = xslElement->getFirstChild(); misses a null check. And looking at the source, YAC, PLEASE do replace the other occurences of NodeList* nl = xslTemplate->getChildNodes(); for (UInt32 i = 0; i < nl->getLength(); i++) with iterating over the siblings, too. At least the standalone version iterates over a List internally. This is awful. Therefor I'll add a dependency on the "faster" bug. Could you tweak the null check in processTemplate to an early return? Axel
Blocks: 40672
I'm pretty much gonna rewrite ::processTemplate anyway soon so I'd rather leave it for now if it's ok? I don't want to do the nullcheck since it should be unneccecary. In all cases now we are sure that null is not sent and we should be able to keep in that way. In the description of the function it says that xslElement must be != NULL, but I guess I could make emphesize it some more
spawned 77889 for the general stuff. If you wanna do something better for processTemplate, too, I have two ears. Axel
No longer blocks: 40672
Changes in the second patch: * Implemented NS_ASSERTION for standalone * Added an assertion in the beginning of ::processChildren to check that xslElement is != NULL * Added functiondescription for ::processChildren in XSLTProcessor.h aswell Most of the changes now consists of forwarding XSL_DEBUG in all windows makefiles so that we can use assertions in standalone
Pike pointed out that I #ifdef'ed on the wrong variable. Now I test for DEBUG instead of MOZ_DEBUG. This makes the makefile changes unneccesary, so now the patch is nice and small again
r=me, this is a nice code cleanup, small patch, low risk. Trying 0.9.2 Axel
Target Milestone: --- → mozilla0.9.2
r=peterv.
sr=jst
a= asa@mozilla.org for checkin to the trunk. (on behalf of drivers)
Blocks: 83989
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified, cleaning up keywords
Status: RESOLVED → VERIFIED
Keywords: review
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: