Closed Bug 370345 Opened 17 years ago Closed 17 years ago

no XPath in Thunderbird

Categories

(Thunderbird :: Build Config, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird2.0

People

(Reporter: mozilla.org, Assigned: philor)

References

Details

(Keywords: fixed1.8.1.3)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9
Build Identifier: 1.5.0.9 (20061207) and version 2 beta 2 (20070116)

The default extensions list for thunderbird on branch does not include "transformiix", which means no XSLT or XPath in Thunderbird.

Reproducible: Always

Steps to Reproduce:
Run this code from with a thunderbird extension or javascript shell:
  var parser = new DOMParser();
  var xmldoc = parser.parseFromString("<hello/>", "text/xml");
  print("xmldoc.evaluate() is " + typeof(xmldoc.evaluate) + "\n");

See this thread for more test cases and diagnosis:
http://groups.google.com/group/mozilla.dev.tech.xml/browse_thread/thread/28f5499c78517df3
Actual Results:  
The code above prints "undefined" when run from within thunderbird 1.5.x or 2.0 beta.  The document.evaluate() method does not exist.

Expected Results:  
The code above prints "function" when run from within firefox and xulrunner.  Expected thunderbird to do likewise.
Status: UNCONFIRMED → NEW
Ever confirmed: true
In practice, this is likely a duplicate of bug 306324...
Um, no. XPath moved to content/ on the trunk something like 18 months ago, this is just about making extension authors' lives easier in Tb 2 instead of Tb 3, at a cost of 56,914 bytes more in the Windows installer.
Flags: blocking-thunderbird2?
Version: unspecified → 2.0
So to make it clear, this already works on trunk since transformiix is no longer an extension there.
I wish I could claim I'd find some way to get that 55Kb back, but bloatcycle.html doesn't really balance it out.
Assignee: mscott → philringnalda
Status: NEW → ASSIGNED
Attachment #255188 - Flags: review?(mscott)
Attachment #255188 - Flags: approval-thunderbird2?
Comment on attachment 255188 [details] [diff] [review]
Brother, can you spare 55Kb?

I suspect there might be an .xpt file that needs added to packages-static if we decide to take this.
I've misunderstood the build and installer system more than my share of times, but if so that seems rather confusing and fragile: I expected the configure.in change to be the equivalent of a .mozconfig extensions=default,transformiix, which is what got me the 55Kb number from building a Windows installer, and when I install from it and put |var heads=document.evaluate("//h2", document, null, XPathResult.ANY_TYPE, null); heads.resultType;| in the error console, I get back "4" rather than "evaluate is not a function", which I'm taking as a proxy for "XPath is enabled and working."
My best guess is that it winds up in content_xslt.xpt and/or dom_xpath.xpt, both of which mail/ is already handling - http://lxr.mozilla.org/mozilla1.8/source/extensions/transformiix/build/transformiix.pkg seems to be where it would be mentioning !xpt if it was rolling its own. (Though, no, I don't have any explanation for line 7 there.) 
Just to confirm that the test cases noted in the mozilla.dev.tech.xml thread all pass when run on thunderbird built with configure.in patched.
We didn't get to this in time for thunderbird 2. 
Flags: blocking-thunderbird2? → blocking-thunderbird2-
Target Milestone: --- → Thunderbird 3
We already have it for Tb 3, since it's no longer optional on the trunk, so there's nothing left to do here.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Target Milestone: Thunderbird 3 → Thunderbird2.0
Attachment #255188 - Flags: review?(mscott)
Attachment #255188 - Flags: approval-thunderbird2?
I've been getting several pings from extension developers with an interest in seeing this exposed in Thunderbird 2. Given that the release is in good shape, at zarro bugs and we're waiting at least a few more days for release cycles to make the RC, I think we are in a good position to re-consider... 
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Comment on attachment 255188 [details] [diff] [review]
Brother, can you spare 55Kb?

Let's keep our extension developers empowered.

I've verified Phil's patch on the branch and ran his test case in the console:

var heads=document.evaluate("//h2", document,
null, XPathResult.ANY_TYPE, null); heads.resultType;

and verified I got the correct result.

I also looked at the packaging lists and came to the conclusion as Phil , packages-static already lists the xpt files for xpath and xslt.
Attachment #255188 - Flags: superreview?(bienvenu)
Attachment #255188 - Flags: review+
Attachment #255188 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 255188 [details] [diff] [review]
Brother, can you spare 55Kb?

Let's empower our extension developers. Phil, let me know if you'd like me to land this.
Attachment #255188 - Flags: approval-thunderbird2+
If you don't mind landing it, that would be great - middle of the week isn't my best tbox watching time. And thanks for putting it in!
Leni, can you re-run your test cases with tomorrow's branch build? Thanks!
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Keywords: fixed1.8.1.3
Resolution: --- → FIXED
Test cases all pass on the 2007-03-14 nightly build.

The diagnosis, fixing and landing of this is just great - thanks!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: