From 5269fd9721040cd63ee593a70e75fac9db26c5fb Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Mon, 27 Mar 2017 22:06:48 +0200 Subject: [PATCH] Specify the tokenizer for window.open's features argument This was specified in CSSOM View but the "noopener" feature did not use the same tokenizer as the legacy features. Fixes #2474. Also specify the aliases screenx, screeny, innerwidth, innerheight for left, top, width, and height, respectively. Part of #2464. Closes https://github.com/w3c/csswg-drafts/pull/1128. --- source | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 6 deletions(-) diff --git a/source b/source index 6851e5848ae..fb349ef5fe4 100644 --- a/source +++ b/source @@ -78669,8 +78669,11 @@ callback FrameRequestCallback = void (DOMHighResTimeStamptop-level browsing context, then let new be true. Otherwise, let it be false.

-
  • Interpret features as defined in the CSSOM - View specification.

  • +
  • Let tokenizedFeatures be the result of tokenizing features.

  • + +
  • Interpret tokenizedFeatures as defined in the + CSSOM View specification.

  • @@ -78725,10 +78728,9 @@ callback FrameRequestCallback = void (DOMHighResTimeStamp -
  • If the result of splitting features - on commas contains the token "noopener", then disown target browsing context's opener and - return null.

  • +
  • If tokenizedFeatures contains an entry with + the key "noopener", then disown + target browsing context's opener and return null.

  • Otherwise, return the WindowProxy object of target browsing context.

  • @@ -78739,6 +78741,66 @@ callback FrameRequestCallback = void (DOMHighResTimeStamp +

    To tokenize the features + argument:

    + +
      +
    1. Let tokens be the result of splitting + features on commas.

    2. + +
    3. Let map be a new ordered map.

    4. + +
    5. +

      For each token of tokens:

      +
        +
      1. Let input be token. + +

      2. Let position point at the first character of input.

      3. + +
      4. Skip ASCII whitespace. + +

      5. Collect a sequence of code points that are not ASCII + whitespace nor U+003D (=). Let name be the collected characters, + converted to ASCII lowercase.

      6. + +
      7. Set name to the result of normalizing the feature name + name.

      8. + +
      9. If tokenizedFeatures[name] exists, then continue.

      10. + +
      11. Skip ASCII whitespace.

      12. + +
      13. If the character at position is U+003D (=), then advance position + by 1.

      14. + +
      15. Let value be the empty string.

      16. + +
      17. If position is not past the end of input, then collect a + sequence of code points that are any characters. Set value to the collected + characters.

      18. + +
      19. Set tokenizedFeatures[name] to value.

      20. +
      +
    6. +
    + +

    For legacy reasons, there are some aliases of some feature names. To normalize a feature name name, switch on name:

    + +
    +
    "screenx" +
    Return "left". +
    "screeny" +
    Return "top". +
    "innerwidth" +
    Return "width". +
    "innerheight" +
    Return "height". +
    Anything else +
    Return name. +
    +

    The name attribute of the Window object