Skip to content

Commit d451ed0

Browse files
cynthiaLeaVerouhober
authored
Initial commit for #279. (#381)
* Initial commit for #279. * Update index.bs Co-authored-by: Lea Verou <[email protected]> * Update index.bs Co-authored-by: Theresa O'Connor <[email protected]> * Update index.bs Co-authored-by: Theresa O'Connor <[email protected]> * Update index.bs Co-authored-by: Theresa O'Connor <[email protected]> * Added counterpattern examples. * Update index.bs Co-authored-by: Lea Verou <[email protected]> Co-authored-by: Lea Verou <[email protected]> Co-authored-by: Theresa O'Connor <[email protected]>
1 parent d8d60c9 commit d451ed0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

index.bs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,26 @@ Consider adding such features only in cases when the overall user experience is
10651065
A canonical example of this is blocking rendering in order to download and process a stylesheet.
10661066
The alternative user experience is a flash of unstyled content, which is undesirable.
10671067

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+
10681088
<h3 id="naming-of-url-attributes">Name URL-containing attributes based on their primary purpose</h3><!-- https://github.com/w3ctag/design-principles/issues/278 -->
10691089

10701090
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

Comments
 (0)