]> granicus.if.org Git - clang/commitdiff
Add support in HTML macro expansion for hovering over a macro and automatically
authorTed Kremenek <kremenek@apple.com>
Thu, 17 Apr 2008 19:57:27 +0000 (19:57 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 17 Apr 2008 19:57:27 +0000 (19:57 +0000)
expanding its definition.  This is a pure CSS solution.

Tested on IE7, Firefox 3b4, and Safari 3.1.

Patch by Cedric Venet!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49865 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/HTMLRewrite.cpp

index 43f13d2ab67b3600a248ed86de76f1b0b8cd7ab0..1041d612dd6ab08be22ef14ca7de8fef4076083f 100644 (file)
@@ -251,7 +251,9 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID) {
 
   // Generate header
   R.InsertCStrBefore(StartLoc,
-      "<html>\n<head>\n"
+      "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" "
+      "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
+      "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n"
       "<style type=\"text/css\">\n"
       " body { color:#000000; background-color:#ffffff }\n"
       " body { font-family:Helvetica, sans-serif; font-size:10pt }\n"
@@ -263,8 +265,9 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID) {
       " .keyword { color: #FF00FF }\n"
       " .directive { color: #00A000 }\n"
       // Macro expansions.
-      " .expansion { display: block; border: 2px solid #FF0000; padding: 2px;"
-          "background-color:#FFF0F0;"
+      " .expansion { display: none; }\n"
+      " .macro:hover .expansion { display: block; border: 2px solid #FF0000; "
+          "padding: 2px; background-color:#FFF0F0;"
           "  -webkit-border-radius:5px;  -webkit-box-shadow:1px 1px 7px #000; "
           "position: absolute; top: -1em; left:10em } \n"
       " .macro { color: #FF0000; background-color:#FFC0C0;"