Re: Regarding DOM 3 Tests Format

On Thu, Aug 28, 2008 at 11:12 AM, Carmelo Montanez <carmelo@nist.gov> wrote:
> Hi Folks:
>
> I am getting ready to submit a number of tests and wanted to get your
> feedback on format.  We already agreed
> on a template a few weeks back.  This follows on that format.  Just wanted
> to get your view before I go forward.
> See attached files.
>

You obviously did not try running this in any browser.

I see in your source code of NIST_wheel_001_format2.html:


On Thu, Aug 28, 2008 at 11:12 AM, Carmelo Montanez <carmelo@nist.gov> wrote:
> Hi Folks:
>
> I am getting ready to submit a number of tests and wanted to get your
> feedback on format.  We already agreed
> on a template a few weeks back.  This follows on that format.  Just wanted
> to get your view before I go forward.

Go forward with what?

Where are you submitting your tests to?

> See attached files.
>

Did you try running this in any browser?

I see in your source code of NIST_wheel_001_format2.html:

function w3c_beginTest() {
// (GS) false.
        if ("NIST_beginTest" in window) {
          NIST_beginTest();
        }
// (GS) false.
        if ("NIST_wheel_001" in window) {
          NIST_wheel_001("tb1");alert('here')
        }
        w3c_addEventListener();
      }

(please use spaces, not tabs).
The first to conditions are false. Then we get to w3c_addEventListener()

      // Function to add a listener to the element.
      function w3c_addEventListener() {
        var e1 = document.getElementById("tb1");
        try {
          if (document.addEventListener) {
            e1.addEventListener("wheel", w3c_reactToWheel(), false);
          } else {
            e1.attachEvent("on"+"Wheel", w3c_reactToWheel());
          }
        }
        catch (err)
        {
        }
      }


Adding |undefined| as a callback to e1 will result in an error. That
is probably the thinking behind the try catch but you left your catch
empty. You should not leave the catch block empty. That way others can
more easily debug your mistakes.

You have a "wheel" event type. That is wrong. It should be
"mousewheel"[1]. You've got a branch for attachEvent.  What is that
for? Are you testing an EventTarget? Then use addEventListener.
(attachEvent code with "onWheel" will err).

w3c_reactToWheel() function body has code for dispatching an event to
the same target. What is this? It almost looks like an attempt at DOS
test to see if the browser will freeze.  What was the thinking behind
that?

But none of this code gets called ever. It will always fail silently
because of the empty catch block.

It would be require care to use YUI Test because there are adapters
for feature support. For example, the YUI UserAction can be used to
dispatch an event, depending on the Event model in the target
environment. A test that tests the Event model should not use an Event
Model Adapter adapter for dispatching an Event. If YUI Test is used,
it must be used judiciously and intelligently. If YUI Test were used
this way, it would be a good thing.

YUI Test would augment the tester's ability, I think. If the tester is
not skilled, the tests will be horrible, if the tester is good, the
tests will be great.

Garrett

[1]http://www.w3.org/TR/DOM-Level-3-Events/events.html#event-mousewheel

> NIST_Functions_format2.js
>
> Thanks,
> Carmelo Montanez

Received on Wednesday, 17 September 2008 01:57:10 UTC