Best,
Samuel Lebeau
Le 12 mars 08 à 18:02, Diego Perini a écrit :
It would be great if we could find a way to actually test this
stylesheet issue, for instance by using jstest.rb's SlowServlet
serving a stylesheet file with some special rule...
Regards,
Samuel
Le 13 mars 08 à 02:17, Tobie Langel a écrit :
Best,
Samuel
Index: test/unit/event.html
===================================================================
--- test/unit/event.html (revision 9011)
+++ test/unit/event.html (working copy)
@@ -7,6 +7,7 @@
<script src="../../dist/prototype.js" type="text/javascript"></
script>
<script src="../lib/unittest.js" type="text/javascript"></script>
<link rel="stylesheet" href="../test.css" type="text/css" />
+ <link rel="stylesheet" href="/slow/?Content-Type=text
%2Fcss&responseBody=%23styleSheetTest+%7B+position%3A+absolute%3B+
%7D%0A" type="text/css" />
<style type="text/css" media="screen">
/* <![CDATA[ */
#testcss1 { font-size:11px; color: #f00; }
@@ -27,6 +28,7 @@
<p id="inner">One two three <span id="span">four</span></p>
</div>
<div id="container"><div></div></div>
+<p id="styleSheetTest"></p>
<!-- Tests follow -->
<script type="text/javascript" language="javascript" charset="utf-8">
@@ -219,6 +221,13 @@
assert(eventResults.windowLoad.contentLoaded,
"windowLoad.contentLoaded");
}},
+ testDocumentContentLoadedEventWaitsForStylesheetsToBeLoaded:
function() { with(this) {
+ if (document.location.port == 4711)
+ assert(eventResults.contentLoaded.externalStyleSheetLoaded);
+ else
+ info("This test must be used through WEBrick. Please run
'rake test_units'")
+ }},
+
testEventStopped: function() { with(this) {
var span = $("span"), event;
@@ -253,7 +262,8 @@
document.observe("dom:loaded", function(event) {
eventResults.contentLoaded = {
endOfDocument: eventResults.endOfDocument,
- windowLoad: eventResults.windowLoad
+ windowLoad: eventResults.windowLoad,
+ externalStyleSheetLoaded: $
('styleSheetTest').getStyle('position') == 'absolute'
};
});
Le 13 mars 08 à 07:52, Samuel Lebeau a écrit :