-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][dataflow] Show triangle in <details>
element.
#67431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang][dataflow] Show triangle in <details>
element.
#67431
Conversation
Also, change the mouse cursor into a pointer instead of a text cursor. This makes it more discoverable that the element can be opened and closed.
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-analysis ChangesAlso, change the mouse cursor into a pointer instead of a text cursor. This makes it more discoverable that the element can be opened and closed. Full diff: https://github.com/llvm/llvm-project/pull/67431.diff 2 Files Affected:
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
index c8212df1f94b81a..73f639eac6836ec 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
@@ -122,10 +122,22 @@ code.line:has(.bb-select):before {
font-size: x-small;
flex-grow: 1;
}
-.value summary {
+.value > summary {
background-color: #ace;
display: flex;
justify-content: space-between;
+ cursor: pointer;
+}
+.value > summary::before {
+ content: '►';
+ margin-right: 0.5em;
+ font-size: 0.9em;
+}
+.value[open] > summary::before {
+ content: '▼';
+}
+.value > summary > .location {
+ margin-left: auto;
}
.value .address {
font-size: xx-small;
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
index 87695623cb318b2..6d866d57e144866 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
@@ -18,7 +18,7 @@
<template data-if="v.value_id"><span class="address">#{{v.value_id}}</span></template>
</span>
<template data-if="v.location">
- <span>{{v.type}} <span class="address">@{{v.location}}</span></span>
+ <span class="location">{{v.type}} <span class="address">@{{v.location}}</span></span>
</template>
</summary>
<template
|
.value > summary::before { | ||
content: '►'; | ||
margin-right: 0.5em; | ||
font-size: 0.9em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, the triangle seemed a bit too big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no accounting for taste I suppose :-)
@@ -122,10 +122,22 @@ code.line:has(.bb-select):before { | |||
font-size: x-small; | |||
flex-grow: 1; | |||
} | |||
.value summary { | |||
.value > summary { | |||
background-color: #ace; | |||
display: flex; | |||
justify-content: space-between; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if space-between stays, don't you get a big chunk of space between the arrow and the identity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.value > summary::before { | ||
content: '►'; | ||
margin-right: 0.5em; | ||
font-size: 0.9em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no accounting for taste I suppose :-)
.value[open] > summary::before { | ||
content: '▼'; | ||
} | ||
.value > summary > .location { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second >
here is a little confusing to me, it doesn't seem to solve a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it doesn't solve a problem ("space" would work just as well), but as the .location
is always a direct child of the <summary>
, it seemed more specific to do it this way.
Is "descendant", rather than "child", considered to be the default in CSS? The former is syntactically shorter, but "child" is arguably the simpler concept. Or is "child" problematic because it makes the CSS more brittle (i.e. less resilient in the fact of changes to the HTML)?
…)" This reverts commit fb933fc. The commit broke buildbots due to non-ASCII characters in HTMLLogger.css.
Also, change the mouse cursor into a pointer instead of a text cursor. This makes it more discoverable that the element can be opened and closed.
Also, change the mouse cursor into a pointer instead of a text cursor. This makes it more discoverable that the element can be opened and closed.
Also, change the mouse cursor into a pointer instead of a text cursor.
This makes it more discoverable that the element can be opened and closed.