зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
4b2e8eab30
Коммит
d2b0514a10
|
@ -1452,7 +1452,8 @@ nsHTMLInputElement::SetValueChanged(PRBool aValueChanged)
|
|||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (doc) {
|
||||
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) {
|
||||
mozAutoDocUpdate upd(document, UPDATE_CONTENT_STATE, PR_TRUE);
|
||||
document->ContentStatesChanged(this, nsnull,
|
||||
NS_EVENT_STATE_MOZ_UI_VALID |
|
||||
NS_EVENT_STATE_MOZ_UI_INVALID);
|
||||
}
|
||||
}
|
||||
|
@ -3318,7 +3320,17 @@ nsHTMLInputElement::IntrinsicState() const
|
|||
|
||||
if (IsCandidateForConstraintValidation()) {
|
||||
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 {
|
||||
state |= NS_EVENT_STATE_INVALID;
|
||||
|
||||
|
|
|
@ -597,7 +597,8 @@ nsHTMLTextAreaElement::SetValueChanged(PRBool aValueChanged)
|
|||
}
|
||||
|
||||
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)) {
|
||||
states |= NS_EVENT_STATE_MOZ_PLACEHOLDER;
|
||||
|
@ -1057,7 +1058,10 @@ nsHTMLTextAreaElement::IntrinsicState() const
|
|||
|
||||
if (IsCandidateForConstraintValidation()) {
|
||||
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 {
|
||||
state |= NS_EVENT_STATE_INVALID;
|
||||
// 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>
|
||||
<html class="reftest-wait">
|
||||
<!-- Test: if input is not disabled, it is candidate for constraint validation
|
||||
and should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is not disabled but its 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 onload="document.getElementById('i').removeAttribute('disabled'); document.documentElement.className='';">
|
||||
<input class='valid' id='i' disabled>
|
||||
<body onload="document.getElementById('i').removeAttribute('disabled');
|
||||
document.documentElement.className='';">
|
||||
<input class='notvalid' id='i' disabled>
|
||||
</body>
|
||||
</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>
|
||||
<html class="reftest-wait">
|
||||
<!-- Test: if input is no longer readonly, it is candidate for constraint
|
||||
validation and should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is no longer readonly and its 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 onload="document.getElementById('i').removeAttribute('readonly'); document.documentElement.className='';">
|
||||
<input class='valid' id='i' readonly>
|
||||
<body onload="document.getElementById('i').removeAttribute('readonly');
|
||||
document.documentElement.className='';">
|
||||
<input class='notvalid' id='i' readonly>
|
||||
</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@bar.com';
|
||||
document.documentElement.className = '';">
|
||||
<input id='i' class='valid' type='email'>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- Test: if input is valid and not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is valid but its 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='valid' type='email' value='foo@bar.com'>
|
||||
<input class='notvalid' type='email' value='foo@bar.com'>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<body>
|
||||
<fieldset disabled>
|
||||
<legend>
|
||||
<input class='valid'></input>
|
||||
<input class='notvalid'></input>
|
||||
</legend>
|
||||
</fieldset>
|
||||
</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>
|
||||
<html>
|
||||
<!-- Test: if input is valid and is not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is valid but its 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='valid' maxlength="2">
|
||||
<input class='notvalid' maxlength="2">
|
||||
</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' pattern='foo'>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- Test: if input is valid and not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is valid but its 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='valid' pattern='foo' value='foo'>
|
||||
<input class='notvalid' pattern='foo' value='foo'>
|
||||
</body>
|
||||
</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>
|
||||
<html>
|
||||
<!-- Test: if input is valid and not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is valid and its 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='valid' value='foo' required>
|
||||
<input class='notvalid' value='foo' required>
|
||||
</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 = 'http://mozilla.org/';
|
||||
document.documentElement.className = '';">
|
||||
<input id='i' class='valid' type='url'>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- Test: if input is valid and not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if input is valid and its 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='valid' type='url' value='http://mozilla.org/'>
|
||||
<input class='notvalid' type='url' value='http://mozilla.org/'>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<body>
|
||||
<input class='valid'>
|
||||
<input class='notvalid'>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,24 +3,37 @@
|
|||
== input-disabled.html input-ref.html
|
||||
== input-dyn-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-dyn-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-changed.html input-ref.html
|
||||
== input-maxlength-invalid.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-button.html input-button-ref.html
|
||||
== input-reset.html input-button-ref.html
|
||||
== input-email-invalid.html input-withtext-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-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-changed.html input-withtext-ref.html
|
||||
== input-pattern-invalid.html input-withtext-ref.html
|
||||
== input-type-barred.html input-button-ref.html
|
||||
== input-type-invalid.html input-ref.html
|
||||
== input-disabled-fieldset-1.html input-fieldset-ref.html
|
||||
== input-disabled-fieldset-2.html input-fieldset-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
|
||||
|
|
|
@ -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-dyn-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-dyn-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-changed.html textarea-ref.html
|
||||
== textarea-maxlength-invalid.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-disabled-fieldset-1.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>
|
||||
<html class="reftest-wait">
|
||||
<!-- Test: if textarea is not disabled, it is candidate for constraint validation
|
||||
and should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if textarea is not disabled but its value hasn't been modified,
|
||||
it should not 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.documentElement.className='';">
|
||||
<textarea class='valid' id='t' disabled></textarea>
|
||||
<body onload="document.getElementById('t').removeAttribute('disabled');
|
||||
document.documentElement.className='';">
|
||||
<textarea class='notvalid' id='t' disabled></textarea>
|
||||
</body>
|
||||
</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>
|
||||
<html class="reftest-wait">
|
||||
<!-- Test: if textarea is no longer readonly, it is candidate for constraint
|
||||
validation and should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if textarea is no longer readonly but its value hasn't been modified,
|
||||
it should not 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.documentElement.className='';">
|
||||
<textarea class='valid' id='t' readonly></textarea>
|
||||
<body onload="document.getElementById('t').removeAttribute('readonly');
|
||||
document.documentElement.className='';">
|
||||
<textarea class='notvalid' id='t' readonly></textarea>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<body>
|
||||
<fieldset disabled>
|
||||
<legend>
|
||||
<textarea class='valid'></textarea>
|
||||
<textarea class='notvalid'></textarea>
|
||||
</legend>
|
||||
</fieldset>
|
||||
</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>
|
||||
<html>
|
||||
<!-- Test: if textarea is valid and is not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if textarea is valid but its value hasn't been modifie,
|
||||
it should not be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<body>
|
||||
<textarea class='valid' maxlength="2"></textarea>
|
||||
<textarea class='notvalid' maxlength="2"></textarea>
|
||||
</body>
|
||||
</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>
|
||||
<html>
|
||||
<!-- Test: if textarea is valid and not barred from constraint validation,
|
||||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<!-- Test: if textarea is valid but its value hasn't been modified,
|
||||
it should not be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<body>
|
||||
<textarea class='valid' required>foo</textarea>
|
||||
<textarea class='notvalid' required>foo</textarea>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
it should be affected by :-moz-ui-valid pseudo-class. -->
|
||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||
<body>
|
||||
<textarea class='valid'></textarea>
|
||||
<textarea class='notvalid'></textarea>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче