From 6d147a5bd3c4729e3f59a2b854d80aba7a8d888b Mon Sep 17 00:00:00 2001 From: Andy Paicu Date: Wed, 5 Dec 2018 14:56:57 +0100 Subject: [PATCH 1/5] Added a duplicate attribute present member to element create call --- source | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/source b/source index 4f422ad497a..160bd633828 100644 --- a/source +++ b/source @@ -103059,12 +103059,14 @@ dictionary StorageEventInit : EventInit { DOCTYPE, start tag, end tag, comment, character, end-of-file. DOCTYPE tokens have a name, a public identifier, a system identifier, and a force-quirks flag. When a DOCTYPE token is created, its name, public identifier, and system identifier must be marked as missing (which is - a distinct state from the empty string), and the force-quirks flag must be set to - off (its other state is on). Start and end tag tokens have a tag name, a self-closing flag, and a list of attributes, each of which has a - name and a value. When a start or end tag token is created, its self-closing flag must be unset (its other state is that it be set), and its attributes - list must be empty. Comment and character tokens have data.

+ a distinct state from the empty string), and the force-quirks flag + must be set to off (its other state is on). Start and end tag tokens have a tag name, + a self-closing flag, a + duplicate attribute flag and a list of attributes, + each of which has a name and a value. When a start or end tag token is created, its + self-closing flag must be unset (its other state is that it be set), + its duplicate attribute flag must be unset (its other state + is that it be set), and its attributes list must be empty. Comment and character tokens have data.

When a token is emitted, it must immediately be handled by the tree construction stage. The tree construction stage can affect the state of the tokenization stage, and can insert @@ -104054,8 +104056,9 @@ dictionary StorageEventInit : EventInit {

When the user agent leaves the attribute name state (and before emitting the tag token, if appropriate), the complete attribute's name must be compared to the other attributes on the same token; if there is already an attribute on the token with the exact same name, then this is a - duplicate-attribute parse error - and the new attribute must be removed from the token.

+ duplicate-attribute parse error, + the new attribute must be removed from the token and the token's + duplicate attribute flag must be set

If an attribute is so removed from a token, it, and the value that gets associated with it, if any, are never subsequently used by the parser, and are therefore effectively @@ -105737,8 +105740,10 @@ dictionary StorageEventInit : EventInit {

  • Let element be the result of creating an element given document, localName, given - namespace, null, and is. If will execute script is true, set the - synchronous custom elements flag; otherwise, leave it unset.

    + namespace, null, is, and the + duplicate attribute flag of the token. + If will execute script is true, set the + synchronous custom elements flag; otherwise, leave it unset.

    This will cause custom element constructors to run, if will execute script is true. However, since we From 654efb4d3c0cf476948b62bbcd5cd65b9469ac3b Mon Sep 17 00:00:00 2001 From: Andy Paicu Date: Wed, 12 Dec 2018 15:06:11 +0100 Subject: [PATCH 2/5] Setting flag directly after constructing element --- source | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source b/source index 160bd633828..30b255d06ce 100644 --- a/source +++ b/source @@ -103061,12 +103061,12 @@ dictionary StorageEventInit : EventInit { is created, its name, public identifier, and system identifier must be marked as missing (which is a distinct state from the empty string), and the force-quirks flag must be set to off (its other state is on). Start and end tag tokens have a tag name, - a self-closing flag, a - duplicate attribute flag and a list of attributes, - each of which has a name and a value. When a start or end tag token is created, its - self-closing flag must be unset (its other state is that it be set), - its duplicate attribute flag must be unset (its other state - is that it be set), and its attributes list must be empty. Comment and character tokens have data.

    + a self-closing flag, a + duplicate attribute flag, and a list of attributes, each of which has a name and a value. + When a start or end tag token is created, its self-closing flag + must be unset (its other state is that it be set), its + duplicate attribute flag must be unset (its other state is that it be set), and its attributes + list must be empty. Comment and character tokens have data.

    When a token is emitted, it must immediately be handled by the tree construction stage. The tree construction stage can affect the state of the tokenization stage, and can insert @@ -104057,8 +104057,8 @@ dictionary StorageEventInit : EventInit { appropriate), the complete attribute's name must be compared to the other attributes on the same token; if there is already an attribute on the token with the exact same name, then this is a duplicate-attribute parse error, - the new attribute must be removed from the token and the token's - duplicate attribute flag must be set

    + the new attribute must be removed from the token and the token's duplicate attribute flag must be set

    .

    If an attribute is so removed from a token, it, and the value that gets associated with it, if any, are never subsequently used by the parser, and are therefore effectively @@ -105740,10 +105740,8 @@ dictionary StorageEventInit : EventInit {

  • Let element be the result of creating an element given document, localName, given - namespace, null, is, and the - duplicate attribute flag of the token. - If will execute script is true, set the - synchronous custom elements flag; otherwise, leave it unset. + namespace, null, is. If will execute script is true, + set the synchronous custom elements flag; otherwise, leave it unset.

    This will cause custom element constructors to run, if will execute script is true. However, since we @@ -105752,6 +105750,12 @@ dictionary StorageEventInit : EventInit { data-x="dom-document-open">the document to be blown away.

  • +
  • + If the duplicate attribute flag of the token + is set, set element's + duplicate attribute present to true. +
  • +
  • Append each attribute in the given token to element.

    From 76b7975630c8dd70fd8474367f619cd9adcef035 Mon Sep 17 00:00:00 2001 From: Andy Paicu Date: Thu, 13 Dec 2018 15:34:16 +0100 Subject: [PATCH 3/5] Added a flag on the script element --- source | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source b/source index 30b255d06ce..1ecc1c1134c 100644 --- a/source +++ b/source @@ -57856,6 +57856,12 @@ o............A....e prepared, based on the src attribute of the element at that time.

    +

    The seventh is a flag indicating whether or not the script has a duplicate attribute. This flag is intially + unset and can be set after the tokenizer creates + the element. This flag is used for security checks in the Content Security Policy spec. +

    +

    Finally, a script element has the script's script, which is a script resulting from preparing the element. This is set @@ -104057,8 +104063,8 @@ dictionary StorageEventInit : EventInit { appropriate), the complete attribute's name must be compared to the other attributes on the same token; if there is already an attribute on the token with the exact same name, then this is a duplicate-attribute parse error, - the new attribute must be removed from the token and the token's duplicate attribute flag must be set

    . + the new attribute must be removed from the token, and the token's duplicate attribute flag must be set.

    If an attribute is so removed from a token, it, and the value that gets associated with it, if any, are never subsequently used by the parser, and are therefore effectively @@ -105740,8 +105746,8 @@ dictionary StorageEventInit : EventInit {

  • Let element be the result of creating an element given document, localName, given - namespace, null, is. If will execute script is true, - set the synchronous custom elements flag; otherwise, leave it unset. + namespace, null, and is. If will execute script is true, set the + synchronous custom elements flag; otherwise, leave it unset.

    This will cause custom element constructors to run, if will execute script is true. However, since we @@ -105751,9 +105757,9 @@ dictionary StorageEventInit : EventInit {

  • - If the duplicate attribute flag of the token - is set, set element's - duplicate attribute present to true. + If element is a script element and the duplicate attribute flag of the token is set, set element's duplicate attribute flag.
  • From ed2aefa53287368ec9186eea0f75ef323676dba3 Mon Sep 17 00:00:00 2001 From: Andy Paicu Date: Thu, 13 Dec 2018 16:27:51 +0100 Subject: [PATCH 4/5] Addressed feedback nits --- source | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source b/source index 1ecc1c1134c..ec74daa69a6 100644 --- a/source +++ b/source @@ -57859,8 +57859,8 @@ o............A....e

    The seventh is a flag indicating whether or not the script has a duplicate attribute. This flag is intially unset and can be set after the tokenizer creates - the element. This flag is used for security checks in the Content Security Policy spec. -

    + the element. This flag is used for security checks in Content Security Policy + .

    Finally, a script element has the script's script, which is a script @@ -103067,12 +103067,12 @@ dictionary StorageEventInit : EventInit { is created, its name, public identifier, and system identifier must be marked as missing (which is a distinct state from the empty string), and the force-quirks flag must be set to off (its other state is on). Start and end tag tokens have a tag name, - a self-closing flag, a - duplicate attribute flag, and a list of attributes, each of which has a name and a value. - When a start or end tag token is created, its self-closing flag - must be unset (its other state is that it be set), its - duplicate attribute flag must be unset (its other state is that it be set), and its attributes - list must be empty. Comment and character tokens have data.

    + a self-closing flag, a duplicate attribute flag, and a list of attributes, each of which has a name and a + value. When a start or end tag token is created, its self-closing + flag must be unset (its other state is that it be set), its duplicate attribute flag must be unset (its other state is that it be set), and its + attributes list must be empty. Comment and character tokens have data.

    When a token is emitted, it must immediately be handled by the tree construction stage. The tree construction stage can affect the state of the tokenization stage, and can insert @@ -105757,9 +105757,10 @@ dictionary StorageEventInit : EventInit {

  • - If element is a script element and the duplicate attribute flag of the token is set, set element's duplicate attribute flag. +

    If element is a script element and the duplicate attribute flag of the token is set, then set + element's duplicate attribute + flag.

  • From 9dbf649790339c4a7ba5b3adbf10812399e1c663 Mon Sep 17 00:00:00 2001 From: Andy Paicu Date: Thu, 13 Dec 2018 16:38:13 +0100 Subject: [PATCH 5/5] Proper spacing around --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index ec74daa69a6..fcb55a4b74c 100644 --- a/source +++ b/source @@ -57859,8 +57859,8 @@ o............A....e

    The seventh is a flag indicating whether or not the script has a duplicate attribute. This flag is intially unset and can be set after the tokenizer creates - the element. This flag is used for security checks in Content Security Policy - .

    + the element. This flag is used for security checks in Content Security + Policy.

    Finally, a script element has the script's script, which is a script