edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] test #0
Date: Sun, 13 Aug 2017 16:38:57 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LRH.2.03.1708131617290.17661@carhart.net> (raw)
In-Reply-To: <20170713191620.eklhad@comcast.net>



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.

  parent reply	other threads:[~2017-08-13 23:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13 11:31 [Edbrowse-dev] jspool Karl Dahlke
2017-08-13 21:29 ` Kevin Carhart
     [not found]   ` <20170713174445.eklhad@comcast.net>
2017-08-13 23:01     ` Kevin Carhart
     [not found]       ` <20170713191620.eklhad@comcast.net>
2017-08-13 23:38         ` Kevin Carhart [this message]
2017-08-14  0:54           ` [Edbrowse-dev] test #0 Karl Dahlke
2017-08-14  0:59             ` Kevin Carhart
     [not found]               ` <20170713220453.eklhad@comcast.net>
2017-08-14  4:54                 ` [Edbrowse-dev] explanation of patch 20170813 Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.03.1708131617290.17661@carhart.net \
    --to=kevin@carhart.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).