[cfe-commits] r49865 - /cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
Ted Kremenek
kremenek at apple.com
Thu Apr 17 12:57:27 PDT 2008
Author: kremenek
Date: Thu Apr 17 14:57:27 2008
New Revision: 49865
URL: http://llvm.org/viewvc/llvm-project?rev=49865&view=rev
Log:
Add support in HTML macro expansion for hovering over a macro and automatically
expanding its definition. This is a pure CSS solution.
Tested on IE7, Firefox 3b4, and Safari 3.1.
Patch by Cedric Venet!
Modified:
cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=49865&r1=49864&r2=49865&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Thu Apr 17 14:57:27 2008
@@ -251,7 +251,9 @@
// 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 @@
" .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;"
More information about the cfe-commits
mailing list