📜 ⬆️ ⬇️

HTML 5.2 in brief

Dear colleagues, good afternoon.

Due to the fact that on December 12 , 2017, the W3C blog announced the release of a new version of HTML 5 , offering you a brief description of the main innovations.

Innovations


  1. Modular javascript support


    In my opinion, the most interesting and expected innovation is related to the support of the modular syntax of the latest ECMA Script standard.

    Usage will be as follows:
    ')
    <script type="module"> import { app } from './app'; app.run(); </script> 

    In order to ensure that each imported script is loaded no more than once per document or web worker, a module map has been implemented, which will contain reference records with one of the following values:

    - directly modular script (module script);
    - null used to indicate failed downloads;
    - fetching - temporary placeholder.

    The path to the file will first be passed through the Parser link (URL parser) , the correct values ​​will be used to resolve the path. Duplicate paths will be ignored.

    It should be noted that if the path does not begin with the characters "/", "./" or "../", an error will be returned. This is due to the planned introduction of “bare” imports in the future.

    Separately, it should be noted that the incorrect MIME type, unlike ordinary scripts, will be an error with respect to a modular script.
  2. <Dialog> element


    The <dialog> tag defines a window or container for creating pop-up and modal windows. In addition to the standard html attributes, this tag will have one open attribute from the bullet indicating whether the element is active and available to the user for interaction. As a JavaScript object, <dialog>, besides the standard properties and methods, got the properties:

    - open - getter / setter - whether the element is active;
    - returnValue - getter / setter - the value returned by the element,
    as well as methods:
    - close () - closes the element;
    -open () - shows the element;
    -showModal () displays the element and makes it modal to the top-level elements.
  3. Nonce attribute for <link>


    The <link> element received a nonce attribute, which is a cryptographic nonce (“specifically for this case”), which can be used to determine whether an external resource specified in <link> will be loaded and applied to the document.
  4. <Iframe> element


    The <iframe> element received two changes at once, a new attribute allowpaymentrequest for integration with the Payment Request API and a new value for the attribute sandbox for integration with the Presentation API.

Removed from standard


  1. elements <keygen>, <menu> and <menuitem>;
  2. inputmode attribute for text <input>, and dropzone attributes;
  3. showModalDialog method .

Valid from the point of view of the standard was



No longer conforms to standard



You can read more about the changes in the Changes section of the W3C recommendations .

Source: https://habr.com/ru/post/345388/


All Articles