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
Copy file name to clipboardExpand all lines: index.bs
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1065,6 +1065,26 @@ Consider adding such features only in cases when the overall user experience is
1065
1065
A canonical example of this is blocking rendering in order to download and process a stylesheet.
1066
1066
The alternative user experience is a flash of unstyled content, which is undesirable.
1067
1067
1068
+
<h3 id="html-idl-must-by-synced">Keep attributes in sync</h3>
1069
+
1070
+
New content attributes
1071
+
should have a corresponding IDL attribute with the same name,
1072
+
and the state between the two should be kept synchronized.
1073
+
Carving out a synchronized IDL attribute with inconsistent naming
1074
+
results in confusion, and should be avoided.
1075
+
1076
+
<div class="note">
1077
+
This does not hold the other way around.
1078
+
A new IDL attribute does not always warrant a content attribute counterpart.
1079
+
</div>
1080
+
1081
+
<div class="example">
1082
+
A counterpattern to this guidance can be found in
1083
+
<{input}>'s <{input/value}>, <{option}>'s <{option/selected}>, and <{input}>'s <{input/checked}>
1084
+
where the HTML attributes were never updated
1085
+
and the IDL attribute was the single source of truth.
1086
+
</div>
1087
+
1068
1088
<h3 id="naming-of-url-attributes">Name URL-containing attributes based on their primary purpose</h3><!-- https://github.com/w3ctag/design-principles/issues/278 -->
1069
1089
1070
1090
If the element enables the user to navigate to the URL contained in the attribute, call the attribute `href`, like the <{a}> element's <{a/href}> attribute.
0 commit comments