You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix two bugs related to parsing the "webauthn" autocomplete token:
* Prepend the second token to the IDL-exposed value when a "webauthn" token is found.
* Reset the category after the "webauthn" token is found, otherwise parsing of "Contact" tokens is broken with a "webauthn" token.
To do this, the steps that set a category and maximum number of tokens from a field are extracted into their own algorithm and called when starting parsing and after we find a "webauthn" tag.
Fixes#8231.
<li><p>Let <var>tokens</var> be the result of <span data-x="split a string on ASCII
55685
55685
whitespace">splitting the attribute's value on ASCII whitespace</span>.</p></li>
55686
55686
55687
-
<li><p>If <var>tokens</var> is empty, then jump to the step labeled
55688
-
<i>default</i>.</p></li>
55687
+
<li><p>If <var>tokens</var> is empty, then jump to the step labeled <i>default</i>.</p></li>
55689
55688
55690
55689
<li><p>Let <var>index</var> be the index of the last token in <var>tokens</var>.</p></li>
55691
55690
55691
+
<li><p>Let <var>field</var> be the <var>index</var>th token in <var>tokens</var>.</p></li>
55692
+
55693
+
<li><p>Set the <var>category</var>, <var>maximum tokens</var> pair to the result of <span
55694
+
data-x="determine a field's category">determining a field's category</span> given
55695
+
<var>field</var>.</p></li>
55696
+
55697
+
<li><p>If <var>category</var> is null, then jump to the step labeled <i>default</i>.</p></li>
55698
+
55699
+
<li><p>If the number of tokens in <var>tokens</var> is greater than <var>maximum tokens</var>,
55700
+
then jump to the step labeled <i>default</i>.</p></li>
55701
+
55702
+
<li><p>If <var>category</var> is Off or Automatic but the element's <code
55703
+
data-x="attr-fe-autocomplete">autocomplete</code> attribute is wearing the <span>autofill anchor
55704
+
mantle</span>, then jump to the step labeled <i>default</i>.</p></li>
55705
+
55706
+
<li><p>If <var>category</var> is Off, let the element's <span>autofill field name</span>
55707
+
be the string "<code data-x="">off</code>", let its <span>autofill hint set</span> be empty, and
55708
+
let its <span>IDL-exposed autofill value</span> be the string "<code data-x="">off</code>". Then,
55709
+
return.</p>
55710
+
55711
+
<li><p>If <var>category</var> is Automatic, let the element's <span>autofill field
55712
+
name</span> be the string "<code data-x="">on</code>", let its <span>autofill hint set</span> be
55713
+
empty, and let its <span>IDL-exposed autofill value</span> be the string "<code
55714
+
data-x="">on</code>". Then, return.</p>
55715
+
55716
+
<li><p>Let <var>scope tokens</var> be an empty list.</p></li>
55717
+
55718
+
<li><p>Let <var>hint tokens</var> be an empty set.</p></li>
55719
+
55720
+
<li><p>Let <var>credential type</var> be null.</p></li>
55721
+
55722
+
<li><p>Let <var>IDL value</var> have the same value as <var>field</var>.</p></li>
55723
+
55724
+
<li>
55725
+
<p>If <var>category</var> is Credential and the <var>index</var>th token in <var>tokens</var> is
55726
+
an <span>ASCII case-insensitive</span> match for "<code
55727
+
data-x="attr-fe-autocomplete-webauthn">webauthn</code>", then run the substeps that follow:</p>
55728
+
<ol>
55729
+
<li><p>Set <var>credential type</var> to "<code data-x="">webauthn</code>".</p></li>
55730
+
55731
+
<li><p>If the <var>index</var>th token in <var>tokens</var> is the first entry,
55732
+
then skip to the step labeled <i>done</i>.</p></li>
55733
+
55734
+
<li><p>Decrement <var>index</var> by one.</p></li>
55735
+
55736
+
<li><p>Set the <var>category</var>, <var>maximum tokens</var> pair to the result of <span
55737
+
data-x="determine a field's category">determining a field's category</span> given
55738
+
the <var>index</var>th token in <var>tokens</var>.</p></li>
55739
+
55740
+
<li><p>If <var>category</var> is not Normal and <var>category</var> is not Contact, then jump to
55741
+
the step labeled <i>default</i>.</p></li>
55742
+
55743
+
<li><p>If <var>index</var> is greater than <var>maximum tokens</var> minus one (i.e. if the
55744
+
number of remaining tokens is greater than <var>maximum tokens</var>), then jump to the step
55745
+
labeled <i>default</i>.</p></li>
55746
+
55747
+
<li><p>Set <var>IDL value</var> to the concatenation of the <var>index</var>th token in
55748
+
<var>tokens</var>, a U+0020 SPACE character, and the previous value of <var>IDL
55749
+
value</var>.</p></li>
55750
+
</ol>
55751
+
</li>
55752
+
55753
+
<li><p>If the <var>index</var>th token in <var>tokens</var> is the first entry,
55754
+
then skip to the step labeled <i>done</i>.</p></li>
55755
+
55756
+
<li><p>Decrement <var>index</var> by one.</p></li>
55757
+
55758
+
<li>
55759
+
<p>If <var>category</var> is Contact and the <var>index</var>th token in <var>tokens</var> is an <span>ASCII case-insensitive</span> match for one of the strings in
55760
+
the following list, then run the substeps that follow:</p>
<li><p>Let <var>mode</var> be the matching string from the list above.</p></li>
55804
+
55805
+
<li><p>Insert <var>mode</var> at the start of <var>scope
55806
+
tokens</var>.</p></li>
55807
+
55808
+
<li><p>Add <var>mode</var> to <var>hint tokens</var>.</p></li>
55809
+
55810
+
<li><p>Let <var>IDL value</var> be the concatenation of <var>mode</var>, a
55811
+
U+0020 SPACE character, and the previous value of <var>IDL value</var>.</p></li>
55812
+
55813
+
<li><p>If the <var>index</var>th entry in <var>tokens</var> is the first
55814
+
entry, then skip to the step labeled <i>done</i>.</p></li>
55815
+
55816
+
<li><p>Decrement <var>index</var> by one.</p></li>
55817
+
</ol>
55818
+
</li>
55819
+
55820
+
<li><p>If the <var>index</var>th entry in <var>tokens</var> is not the first entry, then jump to
55821
+
the step labeled <i>default</i>.</p></li>
55822
+
55823
+
<li><p>If the first eight characters of the <var>index</var>th token in <var>tokens</var> are not
55824
+
an <span>ASCII case-insensitive</span> match for the string "<code
55825
+
data-x="attr-fe-autocomplete-section">section-</code>", then jump to the step labeled
55826
+
<i>default</i>.</p></li>
55827
+
55828
+
<li><p>Let <var>section</var> be the <var>index</var>th token in <var>tokens</var>,
55829
+
<span>converted to ASCII lowercase</span>.</p></li>
55830
+
55831
+
<li><p>Insert <var>section</var> at the start of <var>scope tokens</var>.</p></li>
55832
+
55833
+
<li><p>Let <var>IDL value</var> be the concatenation of <var>section</var>, a U+0020 SPACE
55834
+
character, and the previous value of <var>IDL value</var>.</p></li>
55835
+
55836
+
<li><p><i>Done</i>: Let the element's <span>autofill hint set</span> be <var>hint
55837
+
tokens</var>.</p>
55838
+
55839
+
<li><p>Let the element's <span>non-autofill credential type</span> be <var>credential
55840
+
type</var>.</p></li>
55841
+
55842
+
<li><p>Let the element's <span>autofill scope</span> be <var>scope tokens</var>.</p>
55843
+
55844
+
<li><p>Let the element's <span>autofill field name</span> be <var>field</var>.</p>
55845
+
55846
+
<li><p>Let the element's <span>IDL-exposed autofill value</span> be <var>IDL value</var>.</p>
55847
+
55848
+
<li><p>Return.</p></li>
55849
+
55850
+
<li><p><i>Default</i>: Let the element's <span>IDL-exposed autofill value</span> be the empty
55851
+
string, and its <span>autofill hint set</span> and <span>autofill scope</span> be empty.</p></li>
55852
+
55853
+
<li><p>If the element's <code data-x="attr-fe-autocomplete">autocomplete</code> attribute is
55854
+
wearing the <span>autofill anchor mantle</span>, then let the element's <span>autofill field
55855
+
name</span> be the empty string and return.</p></li>
55856
+
55857
+
<li><p>Let <var>form</var> be the element's <span>form owner</span>, if any, or null
55858
+
otherwise.</p></li>
55859
+
55692
55860
<li>
55693
-
<p>If the <var>index</var>th token in <var>tokens</var> is not an <span>ASCII
55694
-
case-insensitive</span> match for one of the tokens given in the first column of the following
55695
-
table, or if the number of tokens in <var>tokens</var> is greater than the maximum
55696
-
number given in the cell in the second column of that token's row, then jump to the step labeled
55697
-
<i>default</i>. Otherwise, let <var>field</var> be the string given in the cell of the
55698
-
first column of the matching row, and let <var>category</var> be the value of the cell
55699
-
in the third column of that same row.</p>
55861
+
<p>If <var>form</var> is not null and <var>form</var>'s <code
55862
+
data-x="attr-form-autocomplete">autocomplete</code> attribute is in the <span
55863
+
data-x="attr-form-autocomplete-off-state">off</span> state, then let the element's
55864
+
<span>autofill field name</span> be "<code data-x="attr-fe-autocomplete-off">off</code>".</p>
55865
+
55866
+
<p>Otherwise, let the element's <span>autofill field name</span> be "<code
55867
+
data-x="attr-fe-autocomplete-on">on</code>".</p>
55868
+
</li>
55869
+
</ol>
55870
+
55871
+
<p>To <dfn>determine a field's category</dfn>, given <var>field</var>:</p>
55872
+
55873
+
<ol>
55874
+
<li>
55875
+
<p>If the <var>field</var> is not an <span>ASCII case-insensitive</span> match for one of the
55876
+
tokens given in the first column of the following table, return the pair (null, null).</p>
55700
55877
55701
55878
<table>
55702
55879
<thead>
@@ -55939,158 +56116,10 @@ MIT Room 32-G524
55939
56116
</table>
55940
56117
</li>
55941
56118
55942
-
<li><p>If <var>category</var> is Off or Automatic but the element's <code
55943
-
data-x="attr-fe-autocomplete">autocomplete</code> attribute is wearing the <span>autofill anchor
55944
-
mantle</span>, then jump to the step labeled <i>default</i>.</p></li>
55945
-
55946
-
<li><p>If <var>category</var> is Off, let the element's <span>autofill field name</span>
55947
-
be the string "<code data-x="">off</code>", let its <span>autofill hint set</span> be empty, and
55948
-
let its <span>IDL-exposed autofill value</span> be the string "<code data-x="">off</code>". Then,
55949
-
return.</p>
55950
-
55951
-
<li><p>If <var>category</var> is Automatic, let the element's <span>autofill field
55952
-
name</span> be the string "<code data-x="">on</code>", let its <span>autofill hint set</span> be
55953
-
empty, and let its <span>IDL-exposed autofill value</span> be the string "<code
55954
-
data-x="">on</code>". Then, return.</p>
55955
-
55956
-
<li><p>Let <var>scope tokens</var> be an empty list.</p></li>
55957
-
55958
-
<li><p>Let <var>hint tokens</var> be an empty set.</p></li>
55959
-
55960
-
<li><p>Let <var>credential type</var> be null.</p></li>
55961
-
55962
-
<li><p>Let <var>IDL value</var> have the same value as <var>field</var>.</p></li>
55963
-
55964
-
<li>
55965
-
<p>If <var>category</var> is Credential and the <var>index</var>th token in <var>tokens</var> is
55966
-
an <span>ASCII case-insensitive</span> match for "<code
55967
-
data-x="attr-fe-autocomplete-webauthn">webauthn</code>", then run the substeps that follow:</p>
55968
-
<ol>
55969
-
<li><p>Set <var>credential type</var> to "<code data-x="">webauthn</code>".</p></li>
55970
-
<li><p>If the <var>index</var>th token in <var>tokens</var> is the first entry,
55971
-
then skip to the step labeled <i>done</i>.</p></li>
55972
-
<li><p>Decrement <var>index</var> by one.</p></li>
55973
-
</ol>
55974
-
</li>
55975
-
55976
-
<li><p>If the <var>index</var>th token in <var>tokens</var> is the first entry,
55977
-
then skip to the step labeled <i>done</i>.</p></li>
55978
-
55979
-
<li><p>Decrement <var>index</var> by one.</p></li>
55980
-
55981
-
<li>
55982
-
<p>If <var>category</var> is Contact and the <var>index</var>th token in <var>tokens</var> is an <span>ASCII case-insensitive</span> match for one of the strings in
55983
-
the following list, then run the substeps that follow:</p>
0 commit comments