Meet - ACID3

    Yesterday, a well-known web developer, the author of the JQuery library, John Rezig, in his personal blog announced that a new third version of the Acid test was being prepared for release . He posted a link to the preliminary version on the network for public inspection. The author of the test reports that its development is almost complete.



    Traditionally, the test checked the parsing of HTML and CSS. In the 3rd version, developers focus on testing the DOM and JavaScript . Let's see what exactly is being tested, especially in relation to JavaScript:
    • Elysia of arrays - things like [,,] should have zero length, and for the array [0,, 1] it should be 3.
    • Array methods - checks the ability to add multiple elements to the array (.unshift (0, 1, 2)) and combine it with undefined (.join (undefined).)
    • Number conversions - the operation of methods such as .toFixed (), .toExponential () and .toPrecision () is checked, first of all, with fractional and negative numbers.
    • String operations - the substr () method should be able to work with negative arguments (.substr (-7, 3)), access to the characters of the string should be done by their position ("my string" [0]). (this is part of the ECMAScript4 specification)
    • Working with dates - make sure that some methods return NaN (for example, d.setMiliseconds () with no arguments), and also that a mandatory offset of +1900 years occurs.
    • Unicode characters in variable names - their use should cause an error. For instance,
      eval ("test.i \\ u002b = 1;");

    • Regular expressions - / [] / should correspond to an empty array, and / [])] / cause an error. Backreference to non-existent images and negative lookaheds should be supported - /(?!test)(test).exec( probtest test ").
    • Enumeration - you need to make sure that the properties of the object are correctly enumerated, that properties with specific names are available (toString, hasOwnProperty, etc)
    • Constructors - the user should be able to define their own constructs in the .constructor property, the .constructor property should not be in the enumeration, and the .prototype.constructor property should be removable.
    • Functions - the ability to call a function by name from itself, a direct change to its name should be prohibited (only using arrays of functions). (function test () {...}) (); - “test” should not be visible in the parent area.
    • Errors - variables in the catch () {} block should work first with the catch () arguments, and then with the parent ones. for instance
      var e = "my name";
      try
      {
        ... // some code
      }
      catch (e)
      {
          alert (e);
      }

      should not display "my name".
    • Assignment operations - s = a.length = "123"; - a.length should return 123, not 3
    • Encodings - encodeURI () and encodeURIComponent () should work correctly with null bytes.

    In general, it was a broad, but rather superficial overview of the harsh but binding requirements of the ECMAScript specification. By opening your favorite browser, you are simply doomed to find at least one of these requirements unfulfilled.

    Details the author of the test promises to present in the coming days.

    And finally, preliminary results of testing UNFINISHED Acid 3 over UNFINISHED versions of the most popular browsers that the author provided. We checked, it all fits together! =)

    Here is the standard that the browser should show. Firefox 2.x Firefox 3.0b2 Safari 3 WebKit Nightly Opera 9.5b1 Internet Explorer 7 Related links:

    ACID3 Reference



    ACID3 Firefox 2.x



    ACID3 Firefox 3.0b2



    ACID3 Safari 3



    ACID3 WebKit Nightly



    ACID3 Opera 9.5b1


    ACID3 Internet Explorer 7

    1. Preliminary mirror test.
    2. Posted by John Rezig on a personal blog.

    Crosspost from webdev.lovata.com

    Also popular now: