Closed
Bug 88623
Opened 24 years ago
Closed 23 years ago
Cleanup Transformiix code
Categories
(Core :: XSLT, defect, P4)
Core
XSLT
Tracking
()
VERIFIED
FIXED
mozilla1.1beta
People
(Reporter: peterv, Assigned: peterv)
References
Details
Attachments
(2 files, 21 obsolete files)
68.39 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
66.98 KB,
patch
|
Details | Diff | Splinter Review |
First up, some warning fixes. See also bug 88612 for XPath code clean-up.
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P4
Target Milestone: --- → mozilla1.0
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
nice! r=sicking
Comment 4•24 years ago
|
||
sr=jst
Assignee | ||
Comment 5•24 years ago
|
||
First patch checked in.
Assignee | ||
Comment 6•24 years ago
|
||
Comment 7•24 years ago
|
||
Comments like
* $Id: AdditiveExpr.cpp,v 1.1 2000/04/06 07:44:37 kvisco%ziplink.net Exp $
* @author <A HREF="mailto:kvisco@ziplink.net">Keith Visco</A>
* @version $Revision: 1.1 $ $Date: 2000/04/06 07:44:37 $
ought to go, giving a rs to peterv for removing those
Axel
Comment 8•24 years ago
|
||
de-rubberfying. r=me on attachement 40874
Axel
Comment 9•24 years ago
|
||
rs=jst
Assignee | ||
Comment 10•24 years ago
|
||
Attachment 40874 [details] [diff] was checked in.
Assignee | ||
Comment 11•24 years ago
|
||
r=sicking on attachment 52145 [details] [diff] [review]
However, I just noticed a pretty serious thing in
txResultStringComparator::compareValues which would be nice if you could fix
while you're at it. If createRawSortKey fails when creating
mCaseKey/mCaseLength the StringValue ends up in a pretty bad state; mCaseKey
gets set to null making us leak the String* key and mCaseLength is set to >0
indicating that mCaseKey points to the mCollation-key.
Would be great if you could do something about that
Assignee | ||
Comment 13•24 years ago
|
||
Good catch. How about restoring the string pointer in mCaseKey and setting
mCaseLength to 0?
I'm attaching another patch. It's not cleanup in the strict sense of the word,
it adds String::isEmpty(). I've tried replacing all the length==0, >0, !=0 in
the tree where it made sense. I've avoided doing cleanup or restructuring,
except in some extreme cases. Looking for an r on that one too.
Assignee | ||
Comment 14•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Attachment #40783 -
Attachment is obsolete: true
Assignee | ||
Updated•24 years ago
|
Attachment #40787 -
Attachment is obsolete: true
Assignee | ||
Updated•24 years ago
|
Attachment #40874 -
Attachment is obsolete: true
yes, restoring mCaseKey and mCaseLength seems like the safest thing (though not
neccesarily the fastest when it comes to what happens if we fail, but i don't
see any reason to optimize that anyway)
on attachment 52208 [details] [diff] [review]:
+MBool String::isEmpty() const
+{
+ return (!strBuffer || (strBuffer[0] == 0x0000));
+}
won't work (our strings arn't always nullterminated, see implementation
of ::clear), just do |return strLength == 0|
urgl, horrible indentation in
+ case 0x000D: // CR
+ break;
+ default:
+ toStrip = MB_FALSE;
+ break;
please add another level for the actual codelines
I don't like the changes to StringFunctionCall.cpp, why add an optimization
(which indents the code one extra level) for a case that is very unlikly to
happen?
in ProcessorState::getResultNameSpaceURI:
- if (prefix.length() == 0) {
+ if (!prefix.isEmpty()) {
is wrong
appart from that and assuming the changes in ProcessorState::initialize are
whitespace only, r=sicking
above patch removes NamedMap::equals which gives Nisheeth 14(!) warnings. The
function isn't implemented and isn't used anywere. There is no risk for
fallbacks to TxObject::equals since NamedMap::equals has a different signature
Comment 19•24 years ago
|
||
Attachment #53310 -
Flags: review+
Assignee | ||
Updated•24 years ago
|
Attachment #52145 -
Attachment is obsolete: true
Assignee | ||
Updated•24 years ago
|
Attachment #52208 -
Attachment is obsolete: true
Assignee | ||
Updated•24 years ago
|
Attachment #53310 -
Attachment is obsolete: true
Assignee | ||
Comment 20•24 years ago
|
||
Comment on attachment 53670 [details] [diff] [review]
Combining previous patches
r=sicking
Attachment #53670 -
Flags: review+
Comment 22•24 years ago
|
||
Comment on attachment 53670 [details] [diff] [review]
Combining previous patches
oh, another r=me.
no landing order requests, that patch
merges with nsdoom, so I'm all fine
Comment 23•24 years ago
|
||
Comment on attachment 53670 [details] [diff] [review]
Combining previous patches
sr=jst
Attachment #53670 -
Flags: superreview+
Assignee | ||
Comment 24•24 years ago
|
||
Comment on attachment 53670 [details] [diff] [review]
Combining previous patches
Checked in.
Attachment #53670 -
Attachment is obsolete: true
Assignee | ||
Comment 25•24 years ago
|
||
Comment 26•24 years ago
|
||
Comment on attachment 53736 [details] [diff] [review]
And more
nice. less warnings is always a good thing.
Attachment #53736 -
Flags: review+
Assignee | ||
Comment 27•24 years ago
|
||
Comment on attachment 53736 [details] [diff] [review]
And more
another one bites the dust.
Attachment #53736 -
Attachment is obsolete: true
Comment 28•24 years ago
|
||
*** Bug 59853 has been marked as a duplicate of this bug. ***
The attached patch cleans up some uses of txListIterator. Most of the fixes are
changing |ListIterator iter = foo.iterator()| to |txListIterator iter(&foo)|.
Since I touched almost all instantiations of ListIterators I took the
opportunity to remove the "ListIterator" typedef (actually i'd like to name it
txList::iterator instead of txListIterator, thoughts?).
To do the same for stackiterators I had to create an explicit txStackIterator
class (since Stack can't be cast to txList since Stack inherits txList
privately). There are other solutions to this, but I like this one best since
it makes it impossible to make an iterator that adds/deletes elements elements
down in the stack.
Comment 31•24 years ago
|
||
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1
(you can query for this string to delete spam or retrieve the list of bugs I've
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Assignee | ||
Comment 32•23 years ago
|
||
I've removed ArrayList, only Node on standalone uses it and I've made a small,
simple replacement class. Also removed TxObjectWrapper, I know Axel does this
on his branch but doing it separately shouldn't give merge problems, right?
I've also moved URIUtils to base, we don't need a separate source directory for
two files.
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla1.0.1 → mozilla1.1alpha
Assignee | ||
Comment 33•23 years ago
|
||
New patches coming up.
Target Milestone: mozilla1.1alpha → mozilla1.1beta
Assignee | ||
Comment 34•23 years ago
|
||
Attachment #85109 -
Attachment is obsolete: true
Assignee | ||
Comment 35•23 years ago
|
||
Assignee | ||
Comment 36•23 years ago
|
||
Comment on attachment 87054 [details] [diff] [review]
remove ArrayList/TxObjectWrapper, move URIUtils to base
I don't understand how the new string-list works. Where are the actual strings
allocated? I can only find allocation of stringpointers. Couldn't you use a
txList instead? The only dissadvantage of that is that you'll have to manually
deallocate the strings, but that is IMHO not a big problem.
Assignee | ||
Comment 38•23 years ago
|
||
baseUrls.add(new String(((Document*)node)->getBaseURI()));
and
+String* txBaseURLArray::getCurrent()
+{
+ if (mCurrentURL) {
+ mCurrentURL = new String;
+ }
Assignee | ||
Comment 39•23 years ago
|
||
Oh, and make that if (!mCurrentURL).
on attachment 87057 [details] [diff] [review]:
+ // xsl:param
+ else if (localName == txXSLTAtoms::param) {
String name;
element->getAttr(txXSLTAtoms::name, kNameSpaceID_None,
name);
if (name.isEmpty()) {
String err("missing required name attribute for...
aPs->receiveError(err, NS_ERROR_FAILURE);
- break;
}
-
- ExprResult* exprResult
- = processVariable(aSource, element, aPs);
+ else {
+ ExprResult* exprResult = processVariable(aSource, element...
I don't really like putting the non-error code inside an |else|, mind changing
the |break| to a |return| instead?
ugh, it's such a pity that we don't have nsCOMPtrs in standalone :(.. I wonder
if it would be possible to hack one that only handled atoms. (in a separate bug
of course)
It might be a good idea to have a
|XSLTProcessor::isXSLTElementOfType(Node* aNode, txAtom* aType)| function for
when/choose/sort/with-param/etc. Your call.
- String err("error processing xsl:");
- err.append(PROC_INST);
+ String err("error processing xsl:processing-instruction");
err.append(", '");
merge the ", '" into the live above
@@ -2317,7 +2276,7 @@
XSLTProcessor::TransformDocument(nsIDOMNode* aSourceDOM,
nsIDOMNode* aStyleDOM,
nsIDOMDocument* aOutputDoc,
- nsIObserver* aObserver)
+ nsITransformObserver* aObserver)
{
// We need source and result documents but no stylesheet.
NS_ENSURE_ARG(aSourceDOM);
@@ -2495,14 +2454,6 @@
mScriptLoader = nsnull;
}
- nsresult rv;
- nsCOMPtr<nsIObserverService> anObserverService = do_GetService
("@mozilla.org/observer-service;1", &rv);
- if (NS_SUCCEEDED(rv)) {
- nsCOMPtr<nsIContent> rootContent;
- mOutputHandler->getRootContent(getter_AddRefs(rootContent));
- anObserverService->AddObserver(mObserver, "xslt-done", PR_TRUE);
- anObserverService->NotifyObservers(rootContent, "xslt-done", nsnull);
- }
is this supposed to be part of this patch?
other then that, r=sicking
Assignee | ||
Comment 41•23 years ago
|
||
Adressed comments.
Attachment #87056 -
Attachment is obsolete: true
Assignee | ||
Comment 42•23 years ago
|
||
Attachment #87057 -
Attachment is obsolete: true
Comment 43•23 years ago
|
||
Comment on attachment 87456 [details] [diff] [review]
remove XSLType (diff -w for reviewers)
sr=jst
Attachment #87456 -
Flags: superreview+
Assignee | ||
Comment 44•23 years ago
|
||
Comment on attachment 87454 [details] [diff] [review]
remove XSLType
Checked in.
Attachment #87454 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #87456 -
Attachment is obsolete: true
Assignee | ||
Comment 45•23 years ago
|
||
I didn't use StringList because I think it's overkill for this simple use.
Attachment #87054 -
Attachment is obsolete: true
+ ~txBaseURLArray()
+ {
+ delete [] mURLs;
+ }
Wasn't the whole point of this class to delete the strings in the dtor so that
you wouldn't have to do that manually?
+ String* get(PRUint32 aCount)
+ {
+ if (!mURLs) {
+ return 0;
+ }
+ return mURLs[aCount];
+ }
IMHO the |if (!mURLs) {| isn't really needed. mCount will always be 0 if mURLs
is null, so all indexes to |get| will be illegal anyway.
+ memcpy(temp, mURLs, mCount * sizeof(String*));
+ delete mURLs;
+ mURLs = temp;
+ mMax = newMax;
should be |delete [] mURLs| i think
+ if (!current) {
+ current = new String;
+ }
|current| is always null here, right? Couldn't current just be a local variable
in the |case Node::ELEMENT_NODE|?
+ case Node::DOCUMENT_NODE:
+ {
baseUrls.add(new String(((Document*)node)->getBaseURI()));
break;
you added an out-of-memory check for the |new| for elements, it'd be great if
you did the same for documents.
+ PRUint32 i;
+ for (i = baseUrls.mCount - 2; i >= 0; --i) {
|i| being unsigned is a bad thing :-)
Now that we don't use ProcessorStates for standalone XPath we no longer need
the "empty" ctor for ProcessorState
brought this one back to life again
Attachment #55414 -
Attachment is obsolete: true
it's always a good idea to let cvs finish before attaching...
Alias: cleanup_transformiix
Comment 50•23 years ago
|
||
txBaseURLArray::get should check for aCount<mMax, at least in a assertion.
Then you can drop the check for mUrls, too.
Assignee | ||
Comment 51•23 years ago
|
||
> Wasn't the whole point of this class to delete the strings in the dtor so that
> you wouldn't have to do that manually?
Nope. The point to doing it this way is to loop once.
> |current| is always null here, right? Couldn't current just be a local
> variable in the |case Node::ELEMENT_NODE|?
Nope. Only in the first iteration or if the element from the previous iteration
has a base attribute.
> txBaseURLArray::get should check for aCount<mMax, at least in a assertion.
Only in an assertion. This class isn't meant to be used elsewhere, so we're sure
the indexes will be correct. I meant to remove the check for mURLs but I forgot.
Assignee | ||
Comment 52•23 years ago
|
||
Comment on attachment 87870 [details] [diff] [review]
remove default ctor in ProcessorState
r=peterv.
Should we assert about the documents?
Attachment #87870 -
Flags: review+
Assignee | ||
Updated•23 years ago
|
Attachment #87873 -
Attachment is obsolete: true
same as before and asserts that all documents are supplied
Attachment #87870 -
Attachment is obsolete: true
Comment on attachment 87958 [details] [diff] [review]
remove default ctor in ProcessorState and assert documents
carry forward r=
Attachment #87958 -
Flags: review+
Comment 55•23 years ago
|
||
Comment on attachment 87958 [details] [diff] [review]
remove default ctor in ProcessorState and assert documents
sr=jst
Attachment #87958 -
Flags: superreview+
Comment 56•23 years ago
|
||
Comment on attachment 87958 [details] [diff] [review]
remove default ctor in ProcessorState and assert documents
this didn't land yet, right?
Comment on attachment 87958 [details] [diff] [review]
remove default ctor in ProcessorState and assert documents
Now it has :-)
Attachment #87958 -
Attachment is obsolete: true
Assignee | ||
Comment 58•23 years ago
|
||
Attachment #87859 -
Attachment is obsolete: true
Assignee | ||
Comment 59•23 years ago
|
||
Comment on attachment 87876 [details] [diff] [review]
remove txList::iterator() (sync with tip)
r=peterv
Attachment #87876 -
Flags: review+
Comment 60•23 years ago
|
||
Comment on attachment 88799 [details] [diff] [review]
remove ArrayList/TxObjectWrapper, move URIUtils to base
if we'd resolve baseURI from child to parent, the txBaseURIArray could be
dropped.
Logic should be pretty simple, resolve as usual and stop on first absolute URI.
The rest looks good to me. (It's a toughy after all ;-))
Assignee | ||
Comment 61•23 years ago
|
||
Something like this. Maybe I should try it out ;-). Let's sleep first.
Attachment #88799 -
Attachment is obsolete: true
Assignee | ||
Comment 62•23 years ago
|
||
Note: I probably inversed the base and the relative URI.
resolving from child and up won't work for module at least (not sure what
standalones url-resolver can handle). When the uri-resolver in mozilla always
operates by resolving a relative uri against an absolute one, so you always need
to start out with a absolute one.
Comment on attachment 88799 [details] [diff] [review]
remove ArrayList/TxObjectWrapper, move URIUtils to base
>+void txBaseURLArray::add(String* aURL)
>+{
>+ if (mCount == mMax) {
>+ PRUint32 newMax = mCount + 16;
>+ String** temp = new String*[newMax];
>+ if (!temp) {
>+ return;
>+ }
>+ memcpy(temp, mURLs, mCount * sizeof(String*));
>+ delete mURLs;
delete [] mURLs
other then that, r=sicking
Attachment #88799 -
Attachment is obsolete: false
Attachment #88799 -
Flags: review+
Attachment #89014 -
Attachment is obsolete: true
in last sentence in comment 63 s/When the/The/
Comment 66•23 years ago
|
||
Comment on attachment 87876 [details] [diff] [review]
remove txList::iterator() (sync with tip)
sr=jst
Attachment #87876 -
Flags: superreview+
Comment 67•23 years ago
|
||
Comment on attachment 89014 [details] [diff] [review]
remove ArrayList/TxObjectWrapper, move URIUtils to base
Re #63, we don't do the resolving at all for module, we use
nsIDOM3Node::GetBaseURI.
And for standalone, the document doesn't have a absolute URL, too.
Unobsoleting again, but I still have to take a real look at the patch.
Attachment #89014 -
Attachment is obsolete: false
Assignee | ||
Comment 68•23 years ago
|
||
Ok, this is getting too complicated for my small mind. Let's land the piece we
all agree on.
Comment 69•23 years ago
|
||
Comment on attachment 89065 [details] [diff] [review]
remove TxObjectWrapper, move URIUtils to base
Didn't try to build it, and can´t really do that right now.
Assuming that you checked this on the tier 1s,
r=axel@pike.org
Attachment #89065 -
Flags: review+
Comment 70•23 years ago
|
||
spawned bug 154172 for baseURI (and ArrayList, too?), as that thing is just
broken for standalone.
Comment 71•23 years ago
|
||
Comment on attachment 89065 [details] [diff] [review]
remove TxObjectWrapper, move URIUtils to base
sr=jst
Attachment #89065 -
Flags: superreview+
Assignee | ||
Comment 72•23 years ago
|
||
Comment on attachment 89065 [details] [diff] [review]
remove TxObjectWrapper, move URIUtils to base
Checked in
Attachment #89065 -
Attachment is obsolete: true
Comment on attachment 87876 [details] [diff] [review]
remove txList::iterator() (sync with tip)
checked in
Attachment #87876 -
Attachment is obsolete: true
ok, this one has become pretty long so let's close it off and open a new one if
needed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Alias: cleanup_transformiix → cleanup_tx_old
Alias: cleanup_tx_old
Comment 75•23 years ago
|
||
we didn't verify for a long time.
I really checked, so VERIFIED.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•