contenteditable.css 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. @namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
  6. *|*::-moz-canvas {
  7. cursor: text;
  8. }
  9. *|*:-moz-read-write :-moz-read-only {
  10. -moz-user-select: all;
  11. }
  12. *|*:-moz-read-only > :-moz-read-write {
  13. /* override the above -moz-user-select: all rule. */
  14. -moz-user-select: -moz-text;
  15. }
  16. input:-moz-read-write > .anonymous-div:-moz-read-only,
  17. textarea:-moz-read-write > .anonymous-div:-moz-read-only {
  18. -moz-user-select: text;
  19. }
  20. /* Use default arrow over objects with size that
  21. are selected when clicked on.
  22. Override the browser's pointer cursor over links
  23. */
  24. img:-moz-read-write, img:-moz-read-write[usemap], area:-moz-read-write,
  25. object:-moz-read-write, object:-moz-read-write[usemap],
  26. applet:-moz-read-write, hr:-moz-read-write, button:-moz-read-write,
  27. select:-moz-read-write,
  28. a:-moz-read-write:link img, a:-moz-read-write:visited img,
  29. a:-moz-read-write:active img, a:-moz-read-write:-moz-only-whitespace[name] {
  30. cursor: default;
  31. }
  32. *|*:any-link:-moz-read-write {
  33. cursor: text;
  34. }
  35. /* Prevent clicking on links from going to link */
  36. a:link:-moz-read-write img, a:visited:-moz-read-write img,
  37. a:active:-moz-read-write img {
  38. -moz-user-input: none;
  39. }
  40. /* We suppress user/author's prefs for link underline,
  41. so we must set explicitly. This isn't good!
  42. */
  43. a:link:-moz-read-write {
  44. text-decoration: underline -moz-anchor-decoration;
  45. color: -moz-hyperlinktext;
  46. }
  47. /* Allow double-clicks on these widgets to open properties dialogs
  48. XXX except when the widget has disabled attribute */
  49. *|*:-moz-read-write > input:-moz-read-only,
  50. *|*:-moz-read-write > button:-moz-read-only,
  51. *|*:-moz-read-write > textarea:-moz-read-only {
  52. -moz-user-select: all;
  53. -moz-user-input: auto !important;
  54. -moz-user-focus: none !important;
  55. }
  56. /* XXX Still need a better way of blocking other events to these widgets */
  57. select:-moz-read-write,
  58. *|*:-moz-read-write > input:disabled,
  59. *|*:-moz-read-write > input[type="checkbox"],
  60. *|*:-moz-read-write > input[type="radio"],
  61. *|*:-moz-read-write > input[type="file"],
  62. input[contenteditable="true"]:disabled,
  63. input[contenteditable="true"][type="checkbox"],
  64. input[contenteditable="true"][type="radio"],
  65. input[contenteditable="true"][type="file"] {
  66. -moz-user-select: all;
  67. -moz-user-input: none !important;
  68. -moz-user-focus: none !important;
  69. }
  70. *|*:-moz-read-write > input[type="hidden"],
  71. input[contenteditable="true"][type="hidden"] {
  72. border: 1px solid black !important;
  73. visibility: visible !important;
  74. }
  75. label:-moz-read-write {
  76. -moz-user-select: all;
  77. }
  78. *|*::-moz-display-comboboxcontrol-frame {
  79. -moz-user-select: text;
  80. }
  81. option:-moz-read-write {
  82. -moz-user-select: text;
  83. }
  84. /* the following rules are for Image Resizing */
  85. span[\_moz_anonclass="mozResizer"] {
  86. width: 5px;
  87. height: 5px;
  88. position: absolute;
  89. border: 1px black solid;
  90. background-color: white;
  91. -moz-user-select: none;
  92. z-index: 2147483646; /* max value -1 for this property */
  93. }
  94. /* we can't use :active below */
  95. span[\_moz_anonclass="mozResizer"][\_moz_activated],
  96. span[\_moz_anonclass="mozResizer"]:hover {
  97. background-color: black;
  98. }
  99. span[\_moz_anonclass="mozResizer"].hidden,
  100. span[\_moz_anonclass="mozResizingShadow"].hidden,
  101. img[\_moz_anonclass="mozResizingShadow"].hidden,
  102. span[\_moz_anonclass="mozGrabber"].hidden,
  103. span[\_moz_anonclass="mozResizingInfo"].hidden,
  104. a[\_moz_anonclass="mozTableRemoveRow"].hidden,
  105. a[\_moz_anonclass="mozTableRemoveColumn"].hidden {
  106. display: none !important;
  107. }
  108. span[\_moz_anonclass="mozResizer"][anonlocation="nw"] {
  109. cursor: nw-resize;
  110. }
  111. span[\_moz_anonclass="mozResizer"][anonlocation="n"] {
  112. cursor: n-resize;
  113. }
  114. span[\_moz_anonclass="mozResizer"][anonlocation="ne"] {
  115. cursor: ne-resize;
  116. }
  117. span[\_moz_anonclass="mozResizer"][anonlocation="w"] {
  118. cursor: w-resize;
  119. }
  120. span[\_moz_anonclass="mozResizer"][anonlocation="e"] {
  121. cursor: e-resize;
  122. }
  123. span[\_moz_anonclass="mozResizer"][anonlocation="sw"] {
  124. cursor: sw-resize;
  125. }
  126. span[\_moz_anonclass="mozResizer"][anonlocation="s"] {
  127. cursor: s-resize;
  128. }
  129. span[\_moz_anonclass="mozResizer"][anonlocation="se"] {
  130. cursor: se-resize;
  131. }
  132. span[\_moz_anonclass="mozResizingShadow"],
  133. img[\_moz_anonclass="mozResizingShadow"] {
  134. outline: thin dashed black;
  135. -moz-user-select: none;
  136. opacity: 0.5;
  137. position: absolute;
  138. z-index: 2147483647; /* max value for this property */
  139. }
  140. span[\_moz_anonclass="mozResizingInfo"] {
  141. font-family: sans-serif;
  142. font-size: x-small;
  143. color: black;
  144. background-color: #d0d0d0;
  145. border: ridge 2px #d0d0d0;
  146. padding: 2px;
  147. position: absolute;
  148. z-index: 2147483647; /* max value for this property */
  149. }
  150. img[\_moz_resizing] {
  151. outline: thin solid black;
  152. }
  153. *[\_moz_abspos] {
  154. outline: silver ridge 2px;
  155. z-index: 2147483645 !important; /* max value -2 for this property */
  156. }
  157. *[\_moz_abspos="white"] {
  158. background-color: white !important;
  159. }
  160. *[\_moz_abspos="black"] {
  161. background-color: black !important;
  162. }
  163. span[\_moz_anonclass="mozGrabber"] {
  164. outline: ridge 2px silver;
  165. padding: 2px;
  166. position: absolute;
  167. width: 12px;
  168. height: 12px;
  169. background-image: url("resource://gre/res/grabber.gif");
  170. background-repeat: no-repeat;
  171. background-position: center center;
  172. -moz-user-select: none;
  173. cursor: move;
  174. }
  175. /* INLINE TABLE EDITING */
  176. a[\_moz_anonclass="mozTableAddColumnBefore"] {
  177. position: absolute;
  178. z-index: 2147483647; /* max value for this property */
  179. text-decoration: none !important;
  180. border: none 0px !important;
  181. width: 4px;
  182. height: 8px;
  183. background-image: url("resource://gre/res/table-add-column-before.gif");
  184. background-repeat: no-repeat;
  185. background-position: center center;
  186. -moz-user-select: none;
  187. -moz-user-focus: none !important;
  188. }
  189. a[\_moz_anonclass="mozTableAddColumnBefore"]:hover {
  190. background-image: url("resource://gre/res/table-add-column-before-hover.gif");
  191. }
  192. a[\_moz_anonclass="mozTableAddColumnBefore"]:active {
  193. background-image: url("resource://gre/res/table-add-column-before-active.gif");
  194. }
  195. a[\_moz_anonclass="mozTableAddColumnAfter"] {
  196. position: absolute;
  197. z-index: 2147483647; /* max value for this property */
  198. text-decoration: none !important;
  199. border: none 0px !important;
  200. width: 4px;
  201. height: 8px;
  202. background-image: url("resource://gre/res/table-add-column-after.gif");
  203. background-repeat: no-repeat;
  204. background-position: center center;
  205. -moz-user-select: none;
  206. -moz-user-focus: none !important;
  207. }
  208. a[\_moz_anonclass="mozTableAddColumnAfter"]:hover {
  209. background-image: url("resource://gre/res/table-add-column-after-hover.gif");
  210. }
  211. a[\_moz_anonclass="mozTableAddColumnAfter"]:active {
  212. background-image: url("resource://gre/res/table-add-column-after-active.gif");
  213. }
  214. a[\_moz_anonclass="mozTableRemoveColumn"] {
  215. position: absolute;
  216. z-index: 2147483647; /* max value for this property */
  217. text-decoration: none !important;
  218. border: none 0px !important;
  219. width: 8px;
  220. height: 8px;
  221. background-image: url("resource://gre/res/table-remove-column.gif");
  222. background-repeat: no-repeat;
  223. background-position: center center;
  224. -moz-user-select: none;
  225. -moz-user-focus: none !important;
  226. }
  227. a[\_moz_anonclass="mozTableRemoveColumn"]:hover {
  228. background-image: url("resource://gre/res/table-remove-column-hover.gif");
  229. }
  230. a[\_moz_anonclass="mozTableRemoveColumn"]:active {
  231. background-image: url("resource://gre/res/table-remove-column-active.gif");
  232. }
  233. a[\_moz_anonclass="mozTableAddRowBefore"] {
  234. position: absolute;
  235. z-index: 2147483647; /* max value for this property */
  236. text-decoration: none !important;
  237. border: none 0px !important;
  238. width: 8px;
  239. height: 4px;
  240. background-image: url("resource://gre/res/table-add-row-before.gif");
  241. background-repeat: no-repeat;
  242. background-position: center center;
  243. -moz-user-select: none;
  244. -moz-user-focus: none !important;
  245. }
  246. a[\_moz_anonclass="mozTableAddRowBefore"]:hover {
  247. background-image: url("resource://gre/res/table-add-row-before-hover.gif");
  248. }
  249. a[\_moz_anonclass="mozTableAddRowBefore"]:active {
  250. background-image: url("resource://gre/res/table-add-row-before-active.gif");
  251. }
  252. a[\_moz_anonclass="mozTableAddRowAfter"] {
  253. position: absolute;
  254. z-index: 2147483647; /* max value for this property */
  255. text-decoration: none !important;
  256. border: none 0px !important;
  257. width: 8px;
  258. height: 4px;
  259. background-image: url("resource://gre/res/table-add-row-after.gif");
  260. background-repeat: no-repeat;
  261. background-position: center center;
  262. -moz-user-select: none;
  263. -moz-user-focus: none !important;
  264. }
  265. a[\_moz_anonclass="mozTableAddRowAfter"]:hover {
  266. background-image: url("resource://gre/res/table-add-row-after-hover.gif");
  267. }
  268. a[\_moz_anonclass="mozTableAddRowAfter"]:active {
  269. background-image: url("resource://gre/res/table-add-row-after-active.gif");
  270. }
  271. a[\_moz_anonclass="mozTableRemoveRow"] {
  272. position: absolute;
  273. z-index: 2147483647; /* max value for this property */
  274. text-decoration: none !important;
  275. border: none 0px !important;
  276. width: 8px;
  277. height: 8px;
  278. background-image: url("resource://gre/res/table-remove-row.gif");
  279. background-repeat: no-repeat;
  280. background-position: center center;
  281. -moz-user-select: none;
  282. -moz-user-focus: none !important;
  283. }
  284. a[\_moz_anonclass="mozTableRemoveRow"]:hover {
  285. background-image: url("resource://gre/res/table-remove-row-hover.gif");
  286. }
  287. a[\_moz_anonclass="mozTableRemoveRow"]:active {
  288. background-image: url("resource://gre/res/table-remove-row-active.gif");
  289. }