WebKit has a number of problems with XSLT stylesheets that are embedded in the source document, as defined in: <http://www.w3.org/TR/xslt#section-Embedding-Stylesheets> Specifically, embedded stylesheets need to inherit namespaces and a URL from the enclosing document, and should be part of the input to transform. Emedding the stylesheet is a convenient way of writing short XSLT tests using only one file. See also the upstream bug report with libxslt: <http://bugzilla.gnome.org/show_bug.cgi?id=558031>
Created attachment 24685 [details] Testcase The attached file results in a green page for Firefox 1 onwards, Opera 9.5 and Internet Explorer 6 (ahem). Safari 3.1 and the current WebKit nightly fail to produce a result, instead giving an error notice with: "error on line 1 at column 1: Extra content at the end of the document".
Is this something that will need to be fixed in libxslt rather than in WebKit?
I believe it would be most appropriate to solve this at the libxslt level, yes, but am not familiar enough with the WebKit codebase or processes to make that judgement. A correct implementation to extract the stylesheet certainly can be written external to the library, however getting it in upstream would be obvious, in which case this bug could depend on "Upgrade to libxslt version ..." or however such things are generally handled.
I am unable to reproduce this bug in Safari 15.6 using attached test case and it shows "Green" page similar to all other browsers (Firefox Nightly 105 and Chrome Canary 106). I think this can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!