Closed Bug 353364 Opened 19 years ago Closed 17 years ago

Same-document references in xml-stylesheet PI processed incorrectly

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: bjoern, Assigned: gzlist)

Details

(Keywords: fixed1.9.1)

Attachments

(5 files, 1 obsolete file)

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9a1) Gecko/20060616 Minefield/3.0a1 <?xml-stylesheet href='' type='text/xsl'?> should be equivalent to <?xml-stylesheet href='...url of document...' type='text/xsl'?> and hence the attached test case render as "This test did pass." Reproducible: Always
Attached file test case
Summary: Same-document references in xsl-stylesheet PI processed incorrectly → Same-document references in xml-stylesheet PI processed incorrectly
Attached patch Possible fix (obsolete) — Splinter Review
The href.isEmpty() check and early return looks wrong to me, but not totally clear from tracing through the code if removing it would expose a problem lower down.
Attachment #345633 - Flags: review?(peterv)
Assignee: xslt → gzlist
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Windows Server 2003 → All
Hardware: PC → All
Comment on attachment 345633 [details] [diff] [review] Possible fix >=== modified file 'content/xml/content/src/nsXMLStylesheetPI.cpp' > nsAutoString href; > GetAttrValue(nsGkAtoms::href, href); >- if (href.IsEmpty()) { >- return; >- } Actually, you want nsAutoString href; if (!GetAttrValue(nsGkAtoms::href, href)) { return; } The attribute is still required.
Attachment #345633 - Flags: review?(peterv) → review-
Attached patch Actual fixSplinter Review
Good catch, had not considered that case. With hope of an eyeball-only fix gone, I actually built and tried this one... What's the prefered method of doing automated testing on XSLT things?
Attachment #345633 - Attachment is obsolete: true
Attachment #345821 - Flags: review?(peterv)
Attachment #345821 - Flags: superreview+
Attachment #345821 - Flags: review?(peterv)
Attachment #345821 - Flags: review+
Comment on attachment 345821 [details] [diff] [review] Actual fix >=== modified file 'content/xml/document/src/nsXMLContentSink.cpp' > nsXMLContentSink::ParsePIData(const nsString &aData, nsString &aHref, > aIsAlternate = alternate.EqualsLiteral("yes"); >+ return PR_TRUE; Add a newline before the return.
I omitted some tests which depend on features is not implemented in mozilla - notably bug 109553 and bug 275196 - and some where I couldn't find the behaviour actually specified. Of particular relevance to this bug, lreas_selflink_empty_href.svg and xslt_selflink_empty_href.xslt pass with the patch applied, and error_no_href.svg catches mistakes of the class pointed out in the first review. Now the tree is open again I'd like to get this landed. It's a low-risk fix of a minor bug, with no api/performance/etc repercussions. I can provide a bundle with the nit above addressed and tests included.
Attachment #350408 - Flags: approval1.9.1?
Attachment #350408 - Flags: approval1.9.1?
Attachment #345821 - Flags: approval1.9.1?
Attachment #345821 - Flags: approval1.9.1? → approval1.9.1+
Comment on attachment 345821 [details] [diff] [review] Actual fix a191=beltzner, please do include the bundle as described
Attached file Bundle for merging
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
I had to mark a test added by this bug as failing on linux: http://hg.mozilla.org/mozilla-central/rev/120131b3a086
Bah. I had the nuke the test completely from the manifest file - it was still timing out, so apparently marking it as failing on one platform doesn't catch timeouts: http://hg.mozilla.org/mozilla-central/rev/58bae41ad72d
My best guess is it's a mime-types registry issue. If the .xslt extension isn't mapped to an xml type but instead defaults to application/octet-stream, it might prompt for download, blocking completion. I've got the file renamed to end .xml and a couple more tests along the same lines in my tree, will try to find someone to try it out.
Keywords: fixed1.9.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: