[clang] [clang][dataflow] Show triangle in `<details>` element. (PR #67431)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 26 07:08:00 PDT 2023
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/67431
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.
>From fe52a064d08bb9e328eafe70ddd7edf21931408e Mon Sep 17 00:00:00 2001
From: Martin Braenne <mboehme at google.com>
Date: Tue, 26 Sep 2023 14:07:14 +0000
Subject: [PATCH] [clang][dataflow] Show triangle in `<details>` element.
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.
---
clang/lib/Analysis/FlowSensitive/HTMLLogger.css | 14 +++++++++++++-
clang/lib/Analysis/FlowSensitive/HTMLLogger.html | 2 +-
2 files changed, 14 insertions(+), 2 deletions(-)
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
More information about the cfe-commits
mailing list