Bug 605125 (3/5) - :-moz-ui-valid shouldn't apply if the element hasn't been modified. r=bz a=jst

This commit is contained in:
Mounir Lamouri 2010-11-24 00:55:22 +01:00
Родитель 4b2e8eab30
Коммит d2b0514a10
39 изменённых файлов: 301 добавлений и 45 удалений

Просмотреть файл

@ -1452,7 +1452,8 @@ nsHTMLInputElement::SetValueChanged(PRBool aValueChanged)
nsIDocument* doc = GetCurrentDoc(); nsIDocument* doc = GetCurrentDoc();
if (doc) { if (doc) {
mozAutoDocUpdate upd(doc, UPDATE_CONTENT_STATE, PR_TRUE); mozAutoDocUpdate upd(doc, UPDATE_CONTENT_STATE, PR_TRUE);
doc->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_MOZ_UI_INVALID); doc->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_MOZ_UI_VALID |
NS_EVENT_STATE_MOZ_UI_INVALID);
} }
} }
@ -1502,6 +1503,7 @@ nsHTMLInputElement::SetCheckedChangedInternal(PRBool aCheckedChanged)
if (document) { if (document) {
mozAutoDocUpdate upd(document, UPDATE_CONTENT_STATE, PR_TRUE); mozAutoDocUpdate upd(document, UPDATE_CONTENT_STATE, PR_TRUE);
document->ContentStatesChanged(this, nsnull, document->ContentStatesChanged(this, nsnull,
NS_EVENT_STATE_MOZ_UI_VALID |
NS_EVENT_STATE_MOZ_UI_INVALID); NS_EVENT_STATE_MOZ_UI_INVALID);
} }
} }
@ -3318,7 +3320,17 @@ nsHTMLInputElement::IntrinsicState() const
if (IsCandidateForConstraintValidation()) { if (IsCandidateForConstraintValidation()) {
if (IsValid()) { if (IsValid()) {
state |= NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID; state |= NS_EVENT_STATE_VALID;
// NS_EVENT_STATE_MOZ_UI_VALID applies if the value has been changed.
// This doesn't apply to elements with value mode default.
ValueModeType valueMode = GetValueMode();
if (valueMode == VALUE_MODE_DEFAULT ||
(valueMode == VALUE_MODE_DEFAULT_ON && GetCheckedChanged()) ||
((valueMode == VALUE_MODE_VALUE ||
valueMode == VALUE_MODE_FILENAME) && GetValueChanged())) {
state |= NS_EVENT_STATE_MOZ_UI_VALID;
}
} else { } else {
state |= NS_EVENT_STATE_INVALID; state |= NS_EVENT_STATE_INVALID;

Просмотреть файл

@ -597,7 +597,8 @@ nsHTMLTextAreaElement::SetValueChanged(PRBool aValueChanged)
} }
if (mValueChanged != previousValue) { if (mValueChanged != previousValue) {
nsEventStates states = NS_EVENT_STATE_MOZ_UI_INVALID; nsEventStates states = NS_EVENT_STATE_MOZ_UI_VALID |
NS_EVENT_STATE_MOZ_UI_INVALID;
if (HasAttr(kNameSpaceID_None, nsGkAtoms::placeholder)) { if (HasAttr(kNameSpaceID_None, nsGkAtoms::placeholder)) {
states |= NS_EVENT_STATE_MOZ_PLACEHOLDER; states |= NS_EVENT_STATE_MOZ_PLACEHOLDER;
@ -1057,7 +1058,10 @@ nsHTMLTextAreaElement::IntrinsicState() const
if (IsCandidateForConstraintValidation()) { if (IsCandidateForConstraintValidation()) {
if (IsValid()) { if (IsValid()) {
state |= NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID; state |= NS_EVENT_STATE_VALID;
if (mValueChanged) {
state |= NS_EVENT_STATE_MOZ_UI_VALID;
}
} else { } else {
state |= NS_EVENT_STATE_INVALID; state |= NS_EVENT_STATE_INVALID;
// NS_EVENT_STATE_MOZ_UI_INVALID always apply if the element suffers from // NS_EVENT_STATE_MOZ_UI_INVALID always apply if the element suffers from

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if input is valid and its checkedness has changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').checked = false;
if (!document.getElementById('i').mozMatchesSelector(':-moz-ui-valid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i' type='checkbox'>
</body>
</html>

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if input is valid and its checkedness hasn't changed,
it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="if (document.getElementById('i').mozMatchesSelector(':-moz-ui-valid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i' type='checkbox'>
</body>
</html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if input is not disabled and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').removeAttribute('disabled');
document.getElementById('i').value = '';
document.documentElement.className='';">
<input class='valid' id='i' disabled>
</body>
</html>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: if input is not disabled, it is candidate for constraint validation <!-- Test: if input is not disabled but its value hasn't been changed,
and should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').removeAttribute('disabled'); document.documentElement.className='';"> <body onload="document.getElementById('i').removeAttribute('disabled');
<input class='valid' id='i' disabled> document.documentElement.className='';">
<input class='notvalid' id='i' disabled>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if input is no longer readonly and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').removeAttribute('readonly');
document.getElementById('i').value = '';
document.documentElement.className='';">
<input class='valid' id='i' readonly>
</body>
</html>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: if input is no longer readonly, it is candidate for constraint <!-- Test: if input is no longer readonly and its value hasn't been changed,
validation and should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').removeAttribute('readonly'); document.documentElement.className='';"> <body onload="document.getElementById('i').removeAttribute('readonly');
<input class='valid' id='i' readonly> document.documentElement.className='';">
<input class='notvalid' id='i' readonly>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if input is valid and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').value = 'foo@bar.com';
document.documentElement.className = '';">
<input id='i' class='valid' type='email'>
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if input is valid and not barred from constraint validation, <!-- Test: if input is valid but its value hasn't been changed,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input class='valid' type='email' value='foo@bar.com'> <input class='notvalid' type='email' value='foo@bar.com'>
</body> </body>
</html> </html>

Просмотреть файл

@ -7,7 +7,7 @@
<body> <body>
<fieldset disabled> <fieldset disabled>
<legend> <legend>
<input class='valid'></input> <input class='notvalid'></input>
</legend> </legend>
</fieldset> </fieldset>
</body> </body>

Просмотреть файл

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<input type='file' style="background-color: green;">
</body>
</html>

Просмотреть файл

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if input is valid and its default value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').value='';
document.documentElement.className='';">
<input id='i' class='valid' type='file'>
</body>
</html>

Просмотреть файл

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<!-- Test: if input is valid but its default value hasn't been changed,
it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body>
<input class='notvalid' type='file'>
</body>
</html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if input is valid and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').value = '';
document.documentElement.className = '';">
<input id='i' class='valid' maxlength="2">
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if input is valid and is not barred from constraint validation, <!-- Test: if input is valid but its value hasn't been changed,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input class='valid' maxlength="2"> <input class='notvalid' maxlength="2">
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if input is valid and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').value = 'foo';
document.documentElement.className = '';">
<input id='i' class='valid' pattern='foo'>
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if input is valid and not barred from constraint validation, <!-- Test: if input is valid but its value hasn't been changed,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input class='valid' pattern='foo' value='foo'> <input class='notvalid' pattern='foo' value='foo'>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if input is valid and its checkedness has changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').checked = false;
if (!document.getElementById('i').mozMatchesSelector(':-moz-ui-valid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i' type='radio'>
</body>
</html>

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if input is valid and its checkedness hasn't changed,
it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="if (document.getElementById('i').mozMatchesSelector(':-moz-ui-valid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i' type='radio'>
</body>
</html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if input is valid and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').value = 'foo';
document.documentElement.className = '';">
<input id='i' class='valid' required>
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if input is valid and not barred from constraint validation, <!-- Test: if input is valid and its value hasn't been changed,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input class='valid' value='foo' required> <input class='notvalid' value='foo' required>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if input is valid and its value has been changed,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i').value = 'http://mozilla.org/';
document.documentElement.className = '';">
<input id='i' class='valid' type='url'>
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if input is valid and not barred from constraint validation, <!-- Test: if input is valid and its value hasn't been changed,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input class='valid' type='url' value='http://mozilla.org/'> <input class='notvalid' type='url' value='http://mozilla.org/'>
</body> </body>
</html> </html>

Просмотреть файл

@ -4,6 +4,6 @@
it should be affected by :-moz-ui-valid pseudo-class. --> it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input class='valid'> <input class='notvalid'>
</body> </body>
</html> </html>

Просмотреть файл

@ -3,24 +3,37 @@
== input-disabled.html input-ref.html == input-disabled.html input-ref.html
== input-dyn-disabled.html input-ref.html == input-dyn-disabled.html input-ref.html
== input-dyn-not-disabled.html input-ref.html == input-dyn-not-disabled.html input-ref.html
== input-dyn-not-disabled-changed.html input-ref.html
== input-readonly.html input-ref.html == input-readonly.html input-ref.html
== input-dyn-readonly.html input-ref.html == input-dyn-readonly.html input-ref.html
== input-dyn-not-readonly.html input-ref.html == input-dyn-not-readonly.html input-ref.html
== input-dyn-not-readonly-changed.html input-ref.html
== input-maxlength-valid.html input-ref.html == input-maxlength-valid.html input-ref.html
== input-maxlength-valid-changed.html input-ref.html
== input-maxlength-invalid.html input-withtext-ref.html == input-maxlength-invalid.html input-withtext-ref.html
== input-required-valid.html input-withtext-ref.html == input-required-valid.html input-withtext-ref.html
== input-required-valid-changed.html input-withtext-ref.html
== input-required-invalid.html input-ref.html == input-required-invalid.html input-ref.html
== input-button.html input-button-ref.html == input-button.html input-button-ref.html
== input-reset.html input-button-ref.html == input-reset.html input-button-ref.html
== input-email-invalid.html input-withtext-ref.html == input-email-invalid.html input-withtext-ref.html
== input-email-valid.html input-email-ref.html == input-email-valid.html input-email-ref.html
== input-email-valid-changed.html input-email-ref.html
== input-url-invalid.html input-withtext-ref.html == input-url-invalid.html input-withtext-ref.html
== input-url-valid.html input-url-ref.html == input-url-valid.html input-url-ref.html
== input-url-valid-changed.html input-url-ref.html
== input-pattern-valid.html input-withtext-ref.html == input-pattern-valid.html input-withtext-ref.html
== input-pattern-valid-changed.html input-withtext-ref.html
== input-pattern-invalid.html input-withtext-ref.html == input-pattern-invalid.html input-withtext-ref.html
== input-type-barred.html input-button-ref.html == input-type-barred.html input-button-ref.html
== input-type-invalid.html input-ref.html == input-type-invalid.html input-ref.html
== input-disabled-fieldset-1.html input-fieldset-ref.html == input-disabled-fieldset-1.html input-fieldset-ref.html
== input-disabled-fieldset-2.html input-fieldset-ref.html == input-disabled-fieldset-2.html input-fieldset-ref.html
== input-fieldset-legend.html input-fieldset-legend-ref.html == input-fieldset-legend.html input-fieldset-legend-ref.html
== input-checkbox-valid-changed.html success-ref.html
== input-checkbox-valid-default.html success-ref.html
== input-radio-valid-changed.html success-ref.html
== input-radio-valid-default.html success-ref.html
== input-file-valid-changed.html input-file-ref.html
== input-file-valid-default.html input-file-ref.html
# input type='hidden' shouldn't show # input type='hidden' shouldn't show

Просмотреть файл

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
SUCCESS
</body>
</html>

Просмотреть файл

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if select is not disabled, it is candidate for constraint validation
and should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('s').removeAttribute('disabled'); document.documentElement.className='';">
<select class='valid' id='s' disabled></select>
</body>
</html>

Просмотреть файл

@ -3,12 +3,16 @@
== textarea-disabled.html textarea-ref.html == textarea-disabled.html textarea-ref.html
== textarea-dyn-disabled.html textarea-ref.html == textarea-dyn-disabled.html textarea-ref.html
== textarea-dyn-not-disabled.html textarea-ref.html == textarea-dyn-not-disabled.html textarea-ref.html
== textarea-dyn-not-disabled-changed.html textarea-ref.html
== textarea-readonly.html textarea-ref.html == textarea-readonly.html textarea-ref.html
== textarea-dyn-readonly.html textarea-ref.html == textarea-dyn-readonly.html textarea-ref.html
== textarea-dyn-not-readonly.html textarea-ref.html == textarea-dyn-not-readonly.html textarea-ref.html
== textarea-dyn-not-readonly-changed.html textarea-ref.html
== textarea-maxlength-valid.html textarea-ref.html == textarea-maxlength-valid.html textarea-ref.html
== textarea-maxlength-valid-changed.html textarea-ref.html
== textarea-maxlength-invalid.html textarea-withtext-ref.html == textarea-maxlength-invalid.html textarea-withtext-ref.html
== textarea-required-valid.html textarea-withtext-ref.html == textarea-required-valid.html textarea-withtext-ref.html
== textarea-required-valid-changed.html textarea-withtext-ref.html
== textarea-required-invalid.html textarea-ref.html == textarea-required-invalid.html textarea-ref.html
== textarea-disabled-fieldset-1.html textarea-fieldset-ref.html == textarea-disabled-fieldset-1.html textarea-fieldset-ref.html
== textarea-disabled-fieldset-2.html textarea-fieldset-ref.html == textarea-disabled-fieldset-2.html textarea-fieldset-ref.html

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if textarea is not disabled and its value has been modifie,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('t').removeAttribute('disabled');
document.getElementById('t').value = '';
document.documentElement.className='';">
<textarea class='valid' id='t' disabled></textarea>
</body>
</html>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: if textarea is not disabled, it is candidate for constraint validation <!-- Test: if textarea is not disabled but its value hasn't been modified,
and should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('t').removeAttribute('disabled'); document.documentElement.className='';"> <body onload="document.getElementById('t').removeAttribute('disabled');
<textarea class='valid' id='t' disabled></textarea> document.documentElement.className='';">
<textarea class='notvalid' id='t' disabled></textarea>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: if textarea is no longer readonly and its value has been modified,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('t').removeAttribute('readonly');
document.getElementById('t').value = '';
document.documentElement.className='';">
<textarea class='valid' id='t' readonly></textarea>
</body>
</html>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html class="reftest-wait">
<!-- Test: if textarea is no longer readonly, it is candidate for constraint <!-- Test: if textarea is no longer readonly but its value hasn't been modified,
validation and should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('t').removeAttribute('readonly'); document.documentElement.className='';"> <body onload="document.getElementById('t').removeAttribute('readonly');
<textarea class='valid' id='t' readonly></textarea> document.documentElement.className='';">
<textarea class='notvalid' id='t' readonly></textarea>
</body> </body>
</html> </html>

Просмотреть файл

@ -7,7 +7,7 @@
<body> <body>
<fieldset disabled> <fieldset disabled>
<legend> <legend>
<textarea class='valid'></textarea> <textarea class='notvalid'></textarea>
</legend> </legend>
</fieldset> </fieldset>
</body> </body>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftest-wait'>
<!-- Test: if textarea is valid and its value has been modified,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('t').value = '';
document.documentElement.className = '';">
<textarea id='t' class='valid' maxlength="2"></textarea>
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if textarea is valid and is not barred from constraint validation, <!-- Test: if textarea is valid but its value hasn't been modifie,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<textarea class='valid' maxlength="2"></textarea> <textarea class='notvalid' maxlength="2"></textarea>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html class='reftet-wait'>
<!-- Test: if textarea is valid and its value has been modified,
it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('t').value = 'foo';
document.documentElement.className = '';">
<textarea id='t' class='valid' required></textarea>
</body>
</html>

Просмотреть файл

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<!-- Test: if textarea is valid and not barred from constraint validation, <!-- Test: if textarea is valid but its value hasn't been modified,
it should be affected by :-moz-ui-valid pseudo-class. --> it should not be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<textarea class='valid' required>foo</textarea> <textarea class='notvalid' required>foo</textarea>
</body> </body>
</html> </html>

Просмотреть файл

@ -4,6 +4,6 @@
it should be affected by :-moz-ui-valid pseudo-class. --> it should be affected by :-moz-ui-valid pseudo-class. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<textarea class='valid'></textarea> <textarea class='notvalid'></textarea>
</body> </body>
</html> </html>