Transformiix does not handle embedded stylesheets.

VERIFIED FIXED in Future

Status

()

Core
XSLT
P5
normal
VERIFIED FIXED
18 years ago
16 years ago

People

(Reporter: Sean Chitwood, Assigned: Keith Visco)

Tracking

Trunk
Future
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

18 years ago
Section 2.7 of the Spec talks about embedded stylesheets.

Standalone transformiix says it cannot open the file for the embedded stylesheets.
(Reporter)

Comment 1

18 years ago
Created attachment 26769 [details]
Test Case

Comment 2

18 years ago
confirming and futuring this one.
How would we want to do this? Create a mockup document?

Axel
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Future
(Reporter)

Comment 3

17 years ago
Note: I am not a good C++ programer and I have little experience working with
streams.

I suggest that we read the stylesheet element into a stream and pass that stream
to the function described at

http://lxr.mozilla.org/seamonkey/source/extensions/transformiix/source/xslt/XSLTProcessor.h#157
(Reporter)

Comment 4

17 years ago
I did some investigating on this. This won't be possible without implementing
GetElementByID. That would probably be more work than it's worth for standalone.
However, don't we already have this for the module? 

If so, implementing this should not be that difficult. I was able to get a
possible solution until if found out getElementByID was just a stub, so anybody
should be able to get it working.

Updated

17 years ago
Priority: -- → P5
Created attachment 71137 [details] [diff] [review]
patch v1

patch that implements embedded stylesheet for module and standalone. Note
however that since standalone doesn't support getElementById it still won't
work. However implementing getElementById is IMO a different bug.

The patch also fixes bug 97621 since otherwise we'd go in a neverending
recursion when the embedded stylesheet is embedded in the source doc
Created attachment 71194 [details] [diff] [review]
missed part of the patch

i should start using PatchMaker
Comment on attachment 71194 [details] [diff] [review]
missed part of the patch

>@@ -100,15 +103,33 @@
> NS_IMETHODIMP 
> nsXSLContentSink::DidBuildModel(PRInt32 aQualityLevel)
> {  
>-  nsCOMPtr<nsIDOMNode> styleDoc;
>-  nsresult rv;
>-
>   mDocument->SetRootContent(mDocElement);
>   mDocument->EndLoad();
>-  styleDoc = do_QueryInterface(mDocument, &rv);
>-  if (NS_SUCCEEDED(rv) && mXSLTransformMediator) {
>+
>+  nsCOMPtr<nsIDOMNode> styleNode;
>+  nsCOMPtr<nsIURL> url = do_QueryInterface(mDocumentURL);
>+  if (url) {
>+      nsXPIDLCString ref;
>+      url->GetRef(getter_Copies(ref));
>+      if (!ref.IsEmpty()) {
>+          nsCOMPtr<nsIDOMDocument> styleDoc = do_QueryInterface(mDocument);
>+          NS_ENSURE_TRUE(styleDoc, NS_ERROR_NO_INTERFACE);

Not sure if you should use NS_ERROR_NO_INTERFACE here. I thought that was used
for functions where you pass in an interface and expect something back.

>@@ -2344,7 +2375,18 @@
>         importFrame.addAfter(new ProcessorState::ImportFrame(0));
>         if (!importFrame.next())
>             return NS_ERROR_OUT_OF_MEMORY;
>-        processStylesheet(&sourceDocument, &xslDocument, &importFrame, &ps);
>+        nsCOMPtr<nsIDOMDocument> styleDoc = do_QueryInterface(aStyleDOM);
>+        if (styleDoc) {
>+            processStylesheet(&sourceDocument, &xslDocument, &importFrame,
>+                              &ps);
>+        }
>+        else {
>+            nsCOMPtr<nsIDOMElement> styleElem = do_QueryInterface(aStyleDOM);
>+            NS_ENSURE_TRUE(styleElem, NS_ERROR_FAILURE);
>+            Element* element = xslDocument.createElement(styleElem);
>+            NS_ENSURE_TRUE(styleElem, NS_ERROR_OUT_OF_MEMORY);

You mean element instead of styleElem.

r=peterv.
Attachment #71194 - Flags: review+
Attachment #71137 - Attachment is obsolete: true
Attachment #71137 - Flags: review+
changed styleElem -> element locally. Didn't change the errorcode (peterv was 
ok with that)
Status: NEW → ASSIGNED
Comment on attachment 71194 [details] [diff] [review]
missed part of the patch

sr=jst
Attachment #71194 - Flags: superreview+

Comment 10

17 years ago
Comment on attachment 71194 [details] [diff] [review]
missed part of the patch

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #71194 - Flags: approval+
upps, this was fixed a long time ago
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 12

16 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.