layout/style/contenteditable.css

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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/. */
     6 @namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
     8 *|*::-moz-canvas {
     9   cursor: text;
    10 }
    12 *|*:focus:-moz-read-write :-moz-read-only {
    13   -moz-user-select: all !important;
    14 }
    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 !important;
    19 }
    21 /* Use default arrow over objects with size that 
    22    are selected when clicked on.
    23    Override the browser's pointer cursor over links
    24 */
    26 img:-moz-read-write, img:-moz-read-write[usemap], area:-moz-read-write,
    27 object:-moz-read-write, object:-moz-read-write[usemap], 
    28 applet:-moz-read-write, hr:-moz-read-write, button:-moz-read-write,
    29 select:-moz-read-write,
    30 a:-moz-read-write:link img, a:-moz-read-write:visited img,
    31 a:-moz-read-write:active img, a:-moz-read-write:-moz-only-whitespace[name] {
    32   cursor: default;
    33 }
    35 *|*:-moz-any-link:-moz-read-write {
    36   cursor: text;
    37 }
    39 /* Prevent clicking on links from going to link */
    40 a:link:-moz-read-write img, a:visited:-moz-read-write img,
    41 a:active:-moz-read-write img {
    42   -moz-user-input: none;
    43 }
    45 /* We suppress user/author's prefs for link underline, 
    46    so we must set explicitly. This isn't good!
    47 */
    48 a:link:-moz-read-write {
    49   text-decoration: underline -moz-anchor-decoration;
    50   color: -moz-hyperlinktext;
    51 }
    53 /* Allow double-clicks on these widgets to open properties dialogs
    54    XXX except when the widget has disabled attribute */
    55 *|*:-moz-read-write > input:-moz-read-only,
    56 *|*:-moz-read-write > button:-moz-read-only,
    57 *|*:-moz-read-write > textarea:-moz-read-only {
    58   -moz-user-select: all !important;
    59   -moz-user-input: auto !important;
    60   -moz-user-focus: none !important;
    61 }
    63 /* XXX Still need a better way of blocking other events to these widgets */
    64 select:-moz-read-write,
    65 *|*:-moz-read-write > input:disabled,
    66 *|*:-moz-read-write > input[type="checkbox"],
    67 *|*:-moz-read-write > input[type="radio"],
    68 *|*:-moz-read-write > input[type="file"],
    69 input[contenteditable="true"]:disabled,
    70 input[contenteditable="true"][type="checkbox"],
    71 input[contenteditable="true"][type="radio"],
    72 input[contenteditable="true"][type="file"] {
    73   -moz-user-select: all !important;
    74   -moz-user-input: none !important;
    75   -moz-user-focus: none !important;
    76 }
    78 /* emulation of non-standard HTML <marquee> tag */
    79 marquee:-moz-read-write {
    80   -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal-editable');
    81 }
    83 marquee[direction="up"]:-moz-read-write, marquee[direction="down"]:-moz-read-write {
    84   -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-vertical-editable');
    85 }
    87 *|*:-moz-read-write > input[type="hidden"],
    88 input[contenteditable="true"][type="hidden"] {
    89   border: 1px solid black !important;
    90   visibility: visible !important;
    91 }
    93 label:-moz-read-write {
    94     -moz-user-select: all !important;
    95 }
    97 *|*::-moz-display-comboboxcontrol-frame {
    98   -moz-user-select: text !important;
    99 }
   101 option:-moz-read-write {
   102   -moz-user-select: text !important;
   103 }
   105 /* the following rules are for Image Resizing */
   107 span[\_moz_anonclass="mozResizer"] {
   108   width: 5px;
   109   height: 5px;
   110   position: absolute;
   111   border: 1px black solid;
   112   background-color: white;
   113   -moz-user-select: none;
   114   z-index: 2147483646; /* max value -1 for this property */
   115 }
   117 /* we can't use :active below */
   118 span[\_moz_anonclass="mozResizer"][\_moz_activated],
   119 span[\_moz_anonclass="mozResizer"]:hover {
   120   background-color: black;
   121 }
   123 span[\_moz_anonclass="mozResizer"].hidden,
   124 span[\_moz_anonclass="mozResizingShadow"].hidden,
   125 img[\_moz_anonclass="mozResizingShadow"].hidden,
   126 span[\_moz_anonclass="mozGrabber"].hidden,
   127 span[\_moz_anonclass="mozResizingInfo"].hidden,
   128 a[\_moz_anonclass="mozTableRemoveRow"].hidden,
   129 a[\_moz_anonclass="mozTableRemoveColumn"].hidden {
   130   display: none !important;
   131 }
   133 span[\_moz_anonclass="mozResizer"][anonlocation="nw"] {
   134   cursor: nw-resize;
   135 }
   136 span[\_moz_anonclass="mozResizer"][anonlocation="n"] {
   137   cursor: n-resize;
   138 }
   139 span[\_moz_anonclass="mozResizer"][anonlocation="ne"] {
   140   cursor: ne-resize;
   141 }
   142 span[\_moz_anonclass="mozResizer"][anonlocation="w"] {
   143   cursor: w-resize;
   144 }
   145 span[\_moz_anonclass="mozResizer"][anonlocation="e"] {
   146   cursor: e-resize;
   147 }
   148 span[\_moz_anonclass="mozResizer"][anonlocation="sw"] {
   149   cursor: sw-resize;
   150 }
   151 span[\_moz_anonclass="mozResizer"][anonlocation="s"] {
   152   cursor: s-resize;
   153 }
   154 span[\_moz_anonclass="mozResizer"][anonlocation="se"] {
   155   cursor: se-resize;
   156 }
   158 span[\_moz_anonclass="mozResizingShadow"],
   159 img[\_moz_anonclass="mozResizingShadow"] {
   160   outline: thin dashed black;
   161   -moz-user-select: none;
   162   opacity: 0.5;
   163   position: absolute;
   164   z-index: 2147483647; /* max value for this property */
   165 }
   167 span[\_moz_anonclass="mozResizingInfo"] {
   168   font-family: sans-serif;
   169   font-size: x-small;
   170   color: black;
   171   background-color: #d0d0d0;
   172   border: ridge 2px #d0d0d0;
   173   padding: 2px;
   174   position: absolute;
   175   z-index: 2147483647; /* max value for this property */
   176 }
   178 img[\_moz_resizing] {
   179   outline: thin solid black;
   180 }
   182 *[\_moz_abspos] {
   183   outline: silver ridge 2px;
   184   z-index: 2147483645 !important; /* max value -2 for this property */
   185 }
   186 *[\_moz_abspos="white"] {
   187   background-color: white !important;
   188 }
   189 *[\_moz_abspos="black"] {
   190   background-color: black !important;
   191 }
   193 span[\_moz_anonclass="mozGrabber"] {
   194   outline: ridge 2px silver;
   195   padding: 2px;
   196   position: absolute;
   197   width: 12px;
   198   height: 12px;
   199   background-image: url("resource://gre/res/grabber.gif");
   200   background-repeat: no-repeat;
   201   background-position: center center;
   202   -moz-user-select: none;
   203   cursor: move;
   204 }
   206 /* INLINE TABLE EDITING */
   208 a[\_moz_anonclass="mozTableAddColumnBefore"] {
   209   position: absolute;
   210   z-index: 2147483647; /* max value for this property */
   211   text-decoration: none !important;
   212   border: none 0px !important;
   213   width: 4px;
   214   height: 8px;
   215   background-image: url("resource://gre/res/table-add-column-before.gif");
   216   background-repeat: no-repeat;
   217   background-position: center center;
   218   -moz-user-select: none !important;
   219   -moz-user-focus: none !important;
   220 }
   222 a[\_moz_anonclass="mozTableAddColumnBefore"]:hover {
   223   background-image: url("resource://gre/res/table-add-column-before-hover.gif");
   224 }
   226 a[\_moz_anonclass="mozTableAddColumnBefore"]:active {
   227   background-image: url("resource://gre/res/table-add-column-before-active.gif");
   228 }
   230 a[\_moz_anonclass="mozTableAddColumnAfter"] {
   231   position: absolute;
   232   z-index: 2147483647; /* max value for this property */
   233   text-decoration: none !important;
   234   border: none 0px !important;
   235   width: 4px;
   236   height: 8px;
   237   background-image: url("resource://gre/res/table-add-column-after.gif");
   238   background-repeat: no-repeat;
   239   background-position: center center;
   240   -moz-user-select: none !important;
   241   -moz-user-focus: none !important;
   242 }
   244 a[\_moz_anonclass="mozTableAddColumnAfter"]:hover {
   245   background-image: url("resource://gre/res/table-add-column-after-hover.gif");
   246 }
   248 a[\_moz_anonclass="mozTableAddColumnAfter"]:active {
   249   background-image: url("resource://gre/res/table-add-column-after-active.gif");
   250 }
   252 a[\_moz_anonclass="mozTableRemoveColumn"] {
   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: 8px;
   259   background-image: url("resource://gre/res/table-remove-column.gif");
   260   background-repeat: no-repeat;
   261   background-position: center center;
   262   -moz-user-select: none !important;
   263   -moz-user-focus: none !important;
   264 }
   266 a[\_moz_anonclass="mozTableRemoveColumn"]:hover {
   267   background-image: url("resource://gre/res/table-remove-column-hover.gif");
   268 }
   270 a[\_moz_anonclass="mozTableRemoveColumn"]:active {
   271   background-image: url("resource://gre/res/table-remove-column-active.gif");
   272 }
   274 a[\_moz_anonclass="mozTableAddRowBefore"] {
   275   position: absolute;
   276   z-index: 2147483647; /* max value for this property */
   277   text-decoration: none !important;
   278   border: none 0px !important;
   279   width: 8px;
   280   height: 4px;
   281   background-image: url("resource://gre/res/table-add-row-before.gif");
   282   background-repeat: no-repeat;
   283   background-position: center center;
   284   -moz-user-select: none !important;
   285   -moz-user-focus: none !important;
   286 }
   288 a[\_moz_anonclass="mozTableAddRowBefore"]:hover {
   289   background-image: url("resource://gre/res/table-add-row-before-hover.gif");
   290 }
   292 a[\_moz_anonclass="mozTableAddRowBefore"]:active {
   293   background-image: url("resource://gre/res/table-add-row-before-active.gif");
   294 }
   296 a[\_moz_anonclass="mozTableAddRowAfter"] {
   297   position: absolute;
   298   z-index: 2147483647; /* max value for this property */
   299   text-decoration: none !important;
   300   border: none 0px !important;
   301   width: 8px;
   302   height: 4px;
   303   background-image: url("resource://gre/res/table-add-row-after.gif");
   304   background-repeat: no-repeat;
   305   background-position: center center;
   306   -moz-user-select: none !important;
   307   -moz-user-focus: none !important;
   308 }
   310 a[\_moz_anonclass="mozTableAddRowAfter"]:hover {
   311   background-image: url("resource://gre/res/table-add-row-after-hover.gif");
   312 }
   314 a[\_moz_anonclass="mozTableAddRowAfter"]:active {
   315   background-image: url("resource://gre/res/table-add-row-after-active.gif");
   316 }
   318 a[\_moz_anonclass="mozTableRemoveRow"] {
   319   position: absolute;
   320   z-index: 2147483647; /* max value for this property */
   321   text-decoration: none !important;
   322   border: none 0px !important;
   323   width: 8px;
   324   height: 8px;
   325   background-image: url("resource://gre/res/table-remove-row.gif");
   326   background-repeat: no-repeat;
   327   background-position: center center;
   328   -moz-user-select: none !important;
   329   -moz-user-focus: none !important;
   330 }
   332 a[\_moz_anonclass="mozTableRemoveRow"]:hover {
   333   background-image: url("resource://gre/res/table-remove-row-hover.gif");
   334 }
   336 a[\_moz_anonclass="mozTableRemoveRow"]:active {
   337   background-image: url("resource://gre/res/table-remove-row-active.gif");
   338 }

mercurial