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)
Core
XSLT
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: sicking, Assigned: sicking)
References
Details
Attachments
(5 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
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
Assignee | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
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
Assignee | ||
Comment 3•24 years ago
|
||
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
Comment 4•24 years ago
|
||
spawned 77889 for the general stuff.
If you wanna do something better for processTemplate, too, I have two ears.
Axel
No longer blocks: 40672
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
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
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
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
Assignee | ||
Comment 9•24 years ago
|
||
Assignee | ||
Comment 10•24 years ago
|
||
Comment 11•24 years ago
|
||
r=me, this is a nice code cleanup, small patch, low risk. Trying 0.9.2
Axel
Target Milestone: --- → mozilla0.9.2
Comment 12•24 years ago
|
||
r=peterv.
Comment 13•24 years ago
|
||
sr=jst
Comment 14•24 years ago
|
||
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
Assignee | ||
Comment 15•24 years ago
|
||
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•