Make `visibility` documentation more verbose and explicit about the interaction with `default_visibility`.
RELNOTES: None
PiperOrigin-RevId: 271646862
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html
index 64f68ff..384c5cd 100644
--- a/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html
+++ b/src/main/java/com/google/devtools/build/docgen/templates/attributes/common/visibility.html
@@ -46,12 +46,15 @@
can not be combined with any other visibility specifications.
A visibility specification may contain a combination of package labels
(i.e. <code>//foo:__pkg__</code>) and <code>package_group</code>s.</p>
-<p>If a rule does not specify the visibility attribute,
-the <code><a href="${link package.default_visibility}">default_visibility</a></code>
+<p>If a rule does specify the visibility attribute, that specification
+overrides any
+<code><a href="${link package.default_visibility}">default_visibility</a></code>
attribute of the <code><a href="${link package}">package</a></code>
-statement in the BUILD file containing the rule is used
-(except <a href="${link exports_files}">exports_files</a>).</p>
-<p>If the default visibility for the package is not specified,
+statement in the BUILD file containing the rule.</p>
+<p>Otherwise, if a rule does not specify the visibility attribute, the default_visibility
+of the package is used (except for
+<a href="${link exports_files}">exports_files</a>).</p>
+<p>Otherwise, if the default_visibility for the package is not specified,
<code>//visibility:private</code> is used.</p>
<p><b>Example</b>:</p>
<p>