[clang] [clang][dataflow] Show triangle in `<details>` element. (#67431) (PR #67655)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 28 02:36:22 PDT 2023


https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/67655

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 4a426e1e88cfa5cb41632e381d4905853928b6b1 Mon Sep 17 00:00:00 2001
From: martinboehme <mboehme at google.com>
Date: Thu, 28 Sep 2023 10:55:02 +0200
Subject: [PATCH] [clang][dataflow] Show triangle in `<details>` element.
 (#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.
---
 clang/lib/Analysis/FlowSensitive/HTMLLogger.css  | 15 +++++++++++++--
 clang/lib/Analysis/FlowSensitive/HTMLLogger.html |  2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
index 0ac1902ea4651ec..60c9ee251a425e8 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
@@ -123,10 +123,21 @@ 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: '\25ba';
+  margin-right: 0.5em;
+  font-size: 0.9em;
+}
+.value[open] > summary::before {
+  content: '\25bc';
+}
+.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