Bug 556145 - Use opacity instead of GrayText for ::-moz-placeholder UA's style. r=bz,davidb

This commit is contained in:
Mounir Lamouri 2012-11-09 10:30:54 +00:00
parent f7ee629089
commit 8644ce2020
39 changed files with 44 additions and 42 deletions

View File

@ -110,11 +110,6 @@ select option, select optgroup {
pointer-events: none; pointer-events: none;
} }
input::-moz-placeholder,
textarea::-moz-placeholder {
color: GrayText;
}
select:not([size]):not([multiple]), select:not([size]):not([multiple]),
select[size="0"], select[size="0"],
select[size="1"], select[size="1"],

View File

@ -148,6 +148,7 @@
.devtools-searchinput > .textbox-input-box > .textbox-input::-moz-placeholder { .devtools-searchinput > .textbox-input-box > .textbox-input::-moz-placeholder {
color: hsl(208,10%,66%); color: hsl(208,10%,66%);
opacity: 1.0;
} }
/* Close button */ /* Close button */

View File

@ -428,6 +428,7 @@ input.name:focus {
} }
input.name::-moz-placeholder { input.name::-moz-placeholder {
opacity: 1.0;
font-style: italic !important; font-style: italic !important;
color: transparent; color: transparent;
background-image: url(chrome://browser/skin/tabview/edit-light.png); background-image: url(chrome://browser/skin/tabview/edit-light.png);

View File

@ -1954,6 +1954,7 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s
} }
#editBMPanel_tagsField > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::-moz-placeholder { #editBMPanel_tagsField > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::-moz-placeholder {
opacity: 1.0;
color: #bbb; color: #bbb;
} }

View File

@ -153,6 +153,7 @@
} }
.devtools-searchinput > .textbox-input-box > .textbox-input::-moz-placeholder { .devtools-searchinput > .textbox-input-box > .textbox-input::-moz-placeholder {
opacity: 1.0;
color: hsl(208,10%,66%); color: hsl(208,10%,66%);
} }

View File

@ -420,6 +420,7 @@ input.name:focus {
} }
input.name::-moz-placeholder { input.name::-moz-placeholder {
opacity: 1.0;
font-style: italic !important; font-style: italic !important;
color: transparent; color: transparent;
background-image: url(chrome://browser/skin/tabview/edit-light.png); background-image: url(chrome://browser/skin/tabview/edit-light.png);

View File

@ -294,6 +294,7 @@
#navigator-toolbox[tabsontop=false] html|*.urlbar-input:not(:-moz-lwtheme)::-moz-placeholder, #navigator-toolbox[tabsontop=false] html|*.urlbar-input:not(:-moz-lwtheme)::-moz-placeholder,
#navigator-toolbox[tabsontop=false] .searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input:not(:-moz-lwtheme)::-moz-placeholder { #navigator-toolbox[tabsontop=false] .searchbar-textbox > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input:not(:-moz-lwtheme)::-moz-placeholder {
opacity: 1.0;
color: #777; color: #777;
} }

View File

@ -1245,6 +1245,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
html|*.urlbar-input:-moz-lwtheme::-moz-placeholder, html|*.urlbar-input:-moz-lwtheme::-moz-placeholder,
.searchbar-textbox:-moz-lwtheme > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::-moz-placeholder { .searchbar-textbox:-moz-lwtheme > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::-moz-placeholder {
opacity: 1.0;
color: #777; color: #777;
} }

View File

@ -159,6 +159,7 @@
} }
.devtools-searchinput > .textbox-input-box > .textbox-input::-moz-placeholder { .devtools-searchinput > .textbox-input-box > .textbox-input::-moz-placeholder {
opacity: 1.0;
color: hsl(208,10%,66%); color: hsl(208,10%,66%);
} }

View File

@ -443,6 +443,7 @@ input.name:focus {
} }
input.name::-moz-placeholder { input.name::-moz-placeholder {
opacity: 1.0;
font-style: italic !important; font-style: italic !important;
color: transparent; color: transparent;
background-image: url(chrome://browser/skin/tabview/edit-light.png); background-image: url(chrome://browser/skin/tabview/edit-light.png);

View File

@ -1,5 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?> <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="placeholder-reset.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"

View File

@ -0,0 +1,8 @@
@namespace url('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul');
@namespace html url('http://www.w3.org/1999/xhtml');
/* We need to have a non-transparent placeholder so we can test it. */
html|input::-moz-placeholder {
opacity: 1.0;
color: graytext;
}

View File

@ -16,6 +16,7 @@
} }
:-moz-any(input, textarea)::-moz-placeholder { :-moz-any(input, textarea)::-moz-placeholder {
opacity: 1.0;
font: -moz-list; font: -moz-list;
font-family: mono; font-family: mono;
font-style: italic; font-style: italic;

View File

@ -1,4 +1,5 @@
input::-moz-placeholder, input::-moz-placeholder,
input.ref { input.ref {
color: green; color: green;
opacity: 1.0;
} }

View File

@ -1,4 +1,5 @@
textarea::-moz-placeholder, textarea::-moz-placeholder,
textarea.ref { textarea.ref {
color: green; color: green;
opacity: 1.0;
} }

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: placeholder should be used by input password elements --> <!-- Test: placeholder should be used by input password elements -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<input type="password" value="" placeholder="my placeholder"> <input type="password" value="" placeholder="my placeholder">
</body> </body>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: placeholder should be used by input text elements --> <!-- Test: placeholder should be used by input text elements -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<input type="text" value="" placeholder="my placeholder"> <input type="text" value="" placeholder="my placeholder">
</body> </body>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: placeholder should be used by textarea elements --> <!-- Test: placeholder should be used by textarea elements -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<textarea placeholder="my placeholder"></textarea> <textarea placeholder="my placeholder"></textarea>
</body> </body>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: when unfocused, if value='', newest placeholder should be shown --> <!-- Test: when unfocused, if value='', newest placeholder should be shown -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript"> <script type="text/javascript">
function focusPlaceholder() function focusPlaceholder()
{ {

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: placeholder shouldn't show new lines (&#10; version) --> <!-- Test: placeholder shouldn't show new lines (&#10; version) -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<input type="text" value="" placeholder="my&#10; placeholder"> <input type="text" value="" placeholder="my&#10; placeholder">
</body> </body>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: placeholder shouldn't show new lines (&#13; version) --> <!-- Test: placeholder shouldn't show new lines (&#13; version) -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<input type="text" value="" placeholder="my&#13; placeholder"> <input type="text" value="" placeholder="my&#13; placeholder">
</body> </body>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: placeholder shouldn't show new lines (\r version) --> <!-- Test: placeholder shouldn't show new lines (\r version) -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript"> <script type="text/javascript">
function setPlaceholder() function setPlaceholder()
{ {

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: placeholder shouldn't show new lines (\n version) --> <!-- Test: placeholder shouldn't show new lines (\n version) -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript"> <script type="text/javascript">
function setPlaceholder() function setPlaceholder()
{ {

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: placeholder has to be used if set via javascript --> <!-- Test: placeholder has to be used if set via javascript -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript"> <script type="text/javascript">
function setPlaceholder() function setPlaceholder()
{ {

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: placeholder has to be used if set via javascript --> <!-- Test: placeholder has to be used if set via javascript -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript"> <script type="text/javascript">
function setPlaceholder() function setPlaceholder()
{ {

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: placeholder has to be shown if value is reseted via javascript --> <!-- Test: placeholder has to be shown if value is reseted via javascript -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<script type="text/javascript"> <script type="text/javascript">
function setValue() function setValue()
{ {

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test placeholder behavior when textarea is too small --> <!-- Test placeholder behavior when textarea is too small -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<textarea cols="5" rows="3" placeholder="my placeholder"></textarea> <textarea cols="5" rows="3" placeholder="my placeholder"></textarea>
</body> </body>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test placeholder behavior when input is too small --> <!-- Test placeholder behavior when input is too small -->
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<input type="text" size="5" value="" placeholder="my placeholder"> <input type="text" size="5" value="" placeholder="my placeholder">
</body> </body>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html dir='rtl'> <html dir='rtl'>
<link rel='stylesheet' type='text/css' href='placeholder-style.css'>
<body> <body>
<input placeholder='foo'> <input placeholder='foo'>
<textarea placeholder='foo'></textarea> <textarea placeholder='foo'></textarea>

View File

@ -1,4 +1,10 @@
textarea.placeholder, textarea.placeholder,
input.placeholder { input.placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder {
/* Unfortunately, we can't style the <input> or <textarea> text so we can't
set it to opacity: 0.54; which means we have to revert the style to
something that doesn't include an opacity. */
color: GrayText; color: GrayText;
opacity: 1.0;
} }

View File

@ -169,7 +169,7 @@ textarea::-moz-placeholder {
*/ */
pointer-events: none !important; pointer-events: none !important;
color: GrayText; opacity: 0.54;
} }
textarea::-moz-placeholder { textarea::-moz-placeholder {

View File

@ -141,11 +141,6 @@ select option, select optgroup {
pointer-events: none; pointer-events: none;
} }
input::-moz-placeholder,
textarea::-moz-placeholder {
color: GrayText;
}
select:not([size]):not([multiple]), select:not([size]):not([multiple]),
select[size="0"], select[size="0"],
select[size="1"], select[size="1"],

View File

@ -133,11 +133,6 @@ select option, select optgroup {
pointer-events: none; pointer-events: none;
} }
input::-moz-placeholder,
textarea::-moz-placeholder {
color: GrayText;
}
select:not([size]):not([multiple]), select:not([size]):not([multiple]),
select[size="0"], select[size="0"],
select[size="1"], select[size="1"],

View File

@ -133,11 +133,6 @@ textarea,
background: white -moz-linear-gradient(top, rgba(115,115,115,0.5) 0, rgba(215,215,215,0.5) 3px, rgba(255,255,255,0.2) 16px); background: white -moz-linear-gradient(top, rgba(115,115,115,0.5) 0, rgba(215,215,215,0.5) 3px, rgba(255,255,255,0.2) 16px);
} }
input::-moz-placeholder,
textarea::-moz-placeholder {
color: GrayText;
}
select:not([size]):not([multiple]), select:not([size]):not([multiple]),
select[size="0"], select[size="0"],
select[size="1"], select[size="1"],

View File

@ -31,11 +31,6 @@ html|*.textbox-textarea {
font: inherit; font: inherit;
} }
html|*.textbox-input::-moz-placeholder,
html|*.textbox-textarea::-moz-placeholder {
color: GrayText;
}
.textbox-contextmenu { .textbox-contextmenu {
cursor: default; cursor: default;
} }

View File

@ -36,11 +36,6 @@ html|*.textbox-textarea {
font: inherit; font: inherit;
} }
html|*.textbox-input::-moz-placeholder,
html|*.textbox-textarea::-moz-placeholder {
color: GrayText;
}
.textbox-contextmenu { .textbox-contextmenu {
cursor: default; cursor: default;
} }

View File

@ -32,11 +32,6 @@ html|*.textbox-textarea {
font: inherit; font: inherit;
} }
html|*.textbox-input::-moz-placeholder,
html|*.textbox-textarea::-moz-placeholder {
color: GrayText;
}
.textbox-contextmenu { .textbox-contextmenu {
cursor: default; cursor: default;
} }

View File

@ -329,6 +329,7 @@
#header-search > .textbox-input-box > html|*.textbox-input::-moz-placeholder { #header-search > .textbox-input-box > html|*.textbox-input::-moz-placeholder {
color: #5C6470; color: #5C6470;
opacity: 1.0;
} }
.view-header { .view-header {

View File

@ -36,11 +36,6 @@ html|*.textbox-textarea {
font: inherit; font: inherit;
} }
html|*.textbox-input::-moz-placeholder,
html|*.textbox-textarea::-moz-placeholder {
color: GrayText;
}
.textbox-contextmenu { .textbox-contextmenu {
cursor: default; cursor: default;
} }