Bug 49694

Summary: Add some comments about XSLStyleSheet owner node
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: XMLAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
proposed patch
none
updated patch andersca: review+

Alexey Proskuryakov
Reported 2010-11-17 15:45:25 PST
XSLStyleSheets come in two varieties - one is created by <?xml-stylesheet?> processing instruction, and another by XSLTProcessor. These are extremely different in how they handle stylesheet and owner node lifetime. - ProcessingInstruction ones are exposed to JavaScript, so stylesheet lifetime is unpredictable. - ProcessingInstruction clears out backpointer in its destructor. - XSLTProcessor exposes nothing to JavaScript, and carefully manages lifetime issues without a need for arbitrary nodes' destructors to clear out references to those nodes. This is difficult to figure out by looking at existing code.
Attachments
proposed patch (6.09 KB, patch)
2010-11-17 15:49 PST, Alexey Proskuryakov
no flags
updated patch (5.58 KB, patch)
2010-11-17 23:11 PST, Alexey Proskuryakov
andersca: review+
Alexey Proskuryakov
Comment 1 2010-11-17 15:49:25 PST
Created attachment 74169 [details] proposed patch Also, renamed a function that creates embedded stylesheets from createInline() to createEmbedded(). An example of such stylesheet is <?xml-stylesheet type="text/xml" href="#style1"?> <!DOCTYPE doc SYSTEM "doc.dtd"> <doc> <head> <xsl:stylesheet id="style1" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <...>
Darin Adler
Comment 2 2010-11-17 22:28:38 PST
Comment on attachment 74169 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=74169&action=review > WebCore/xml/XSLStyleSheet.h:54 > + static PassRefPtr<XSLStyleSheet> createEmbedded(Node* parentNode, const KURL& finalURL) The only call site for this function renamed in this patch is passing a ProcessingInstruction*; that must be the only one or those others would need to use the new name. Given that, I don’t understand why this function takes a Node* and its only the other create function that takes a ProcessingInstruction*. > WebCore/xml/XSLStyleSheetLibxslt.cpp:79 > + // It can also be some otehr node, Typo: "otehr".
Alexey Proskuryakov
Comment 3 2010-11-17 23:11:46 PST
Created attachment 74206 [details] updated patch
Alexey Proskuryakov
Comment 4 2010-11-18 11:13:25 PST
Note You need to log in before you can comment on or make changes to this bug.