@@ -1867,7 +1867,7 @@ Ian's proposal:
1867
1867
attr() = attr( <<attr-name>> <<attr-type>> ? , <<declaration-value>> ?)
1868
1868
1869
1869
<dfn><attr-name></dfn> = [ <<ident-token>> ? '|' ]? <<ident-token>>
1870
- <dfn><attr-type></dfn> = <dfn function lt="type()" for="attr()">type( <<syntax>> )</dfn> | raw-string | <<attr-unit>>
1870
+ <dfn><attr-type></dfn> = <dfn function lt="type()" for="attr()">type( <<syntax>> )</dfn> | raw-string | number | <<attr-unit>>
1871
1871
</pre>
1872
1872
1873
1873
The ''attr()'' function's [=argument grammar=] is:
@@ -1929,12 +1929,19 @@ Ian's proposal:
1929
1929
Values that fail to parse according to the syntax
1930
1930
trigger fallback.
1931
1931
1932
+ If given as the <css> number</css> keyword,
1933
+ it causes the attribute's literal value,
1934
+ after [=strip leading and trailing ASCII whitespace|stripping leading and trailing whitespace=] ,
1935
+ to be [=CSS/parsed=] as a <<number-token>> .
1936
+ Values that fail to parse trigger fallback.
1937
+
1932
1938
If given as an <<attr-unit>> value,
1933
- the value is first parsed as if <css> type(< number>) </css> was specified,
1939
+ the value is first parsed as if '' number'' keyword was specified,
1934
1940
then the resulting numeric value
1935
1941
is turned into a dimension with the corresponding unit,
1936
1942
or a percentage if <css> %</css> was given.
1937
- Values that fail to parse as a <css> <number></css>
1943
+ Same as for ''number'' <<attr-type>> ,
1944
+ values that do not correspond to the <<number-token>> production
1938
1945
trigger fallback.
1939
1946
1940
1947
If given as the <css> raw-string</css> keyword,
@@ -2040,20 +2047,27 @@ Substitution</h4>
2040
2047
let |attr value| be its value;
2041
2048
otherwise jump to the last step (labeled FAILURE).
2042
2049
2043
- 4. If |syntax| is null
2050
+ 4. If |syntax| is the keyword ''number'' or an <<attr-unit>> value,
2051
+ parse |attr value| against <<attr-type>> .
2052
+ If that succeeds, return the result;
2053
+ otherwise, jump to the last step (labeled FAILURE).
2054
+
2055
+ Note: No parsing or modification of any kind is performed on the value.
2056
+
2057
+ 5. If |syntax| is null
2044
2058
or the keyword ''raw-string'' ,
2045
2059
return a CSS <<string>>
2046
2060
whose value is |attr value|.
2047
2061
2048
2062
Note: No parsing or modification of any kind is performed on the value.
2049
2063
2050
- 5 . [=Substitute arbitrary substitution functions=] in |attr value|,
2064
+ 6 . [=Substitute arbitrary substitution functions=] in |attr value|,
2051
2065
with &bs<<;"attribute", |attr name|&bs>> ; as the [=substitution context=] ,
2052
2066
then [=parse with a <syntax>=] |attr value|, with |syntax| and |el|.
2053
2067
If that succeeds, return the result;
2054
2068
otherwise, jump to the last step (labeled FAILURE).
2055
2069
2056
- 6 . <b> FAILURE:</b>
2070
+ 7 . <b> FAILURE:</b>
2057
2071
2058
2072
1. If |second arg| is null,
2059
2073
and |syntax| was omitted,
0 commit comments