A component with an @api attribute named capture (also others from this list) can't be set to true (or false) on the template; it throws a compile error:
LWC1037: To set a boolean attributes, try <c-child capture> instead of <c-child capture="true">. If the attribute is present, its value must either be the empty string or a value that is an ASCII case -insensitive match for the attribute's canonical name with no leading or trailing whitespace.
https://developer.salesforce.com/docs/component-library/tools/playground/3nIYhsgem/1/edit
No error, capture is a boolean attribute of input type=file only.
Compile Error: LWC1037: To set a boolean attributes, try <c-child capture> instead of <c-child capture="true">. If the attribute is present, its value must either be the empty string or a value that is an ASCII case -insensitive match for the attribute's canonical name with no leading or trailing whitespace.
All
This issue has been linked to a new work item: W-7758490
Just to add a little more context: We currently only consider the attribute name when determining whether it is boolean or not. Since all boolean attributes are not global attributes, we should also be considering the element.
Most helpful comment
Just to add a little more context: We currently only consider the attribute name when determining whether it is boolean or not. Since all boolean attributes are not global attributes, we should also be considering the element.