Thanks Karl. I'm putting it on list because I hope everyone will have some remarks. Adam, you brough up the acidtests in the first place but I haven't talked to you about it much lately.

This is going to be lovely and hospitable JS in some ways, in the same vein as observing that the author called a variable kungfuDeathGrip - goofy, capricious, but at least we know that this is javascript written by human beings, intended to be read, with comments, linefeeds, and carved up into small pieces!

So here's the code for test zero.

Note: the assertEquals function is referenced but I didn't copy it in also. So that could be a problem for understanding the test, but you can probably tell from context what assertEquals does. It's a utility called at the end of a test, to assert that two things should be equal and pass or fail based on whether they are.


function () {
// test 0: whether removing an element that is the last child correctly recomputes styles for the new last child // also tests support for getComputedStyle, :last-child, pre-wrap, removing a <script> element
      // removing script:
      var scripts = document.getElementsByTagName('script');
      document.body.removeChild(scripts[scripts.length-1]);
      // removing last child:
      var last = document.getElementById('remove-last-child-test');
var penultimate = last.previousSibling; // this should be the whitespace node penultimate = penultimate.previousSibling; // this should now be the actual penultimate element
      last.parentNode.removeChild(last);
assertEquals(document.defaultView.getComputedStyle(penultimate, '').whiteSpace, 'pre-wrap', "found unexpected computed style");
      return 7;
    },



But really you can go in any order you like as long as we're making progress.
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to