import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTMLOptionElement Test: disabled</title>
<meta name="flags" content="interact">
<link rel="author" title="Intel" href="http://www.intel.com/">
<div>
<select>
<option id="testOption1" text="Option1" >Option1</option>
<option id="testOption2" disabled >Option2</option>
<option id="testOption3" >Option3</option>
</select>
</div>
<h2>Description</h2>
<p>
This test validates that an option element is disabled if its disabled attribute is present.
</p>
<h2>Test steps:</h2>
<ol>
<li>
Click the select flag to select 'Option2'
</li>
</ol>
<h2>Result:</h2>
<p>Test passes if not able to select 'Option2'</p>

View file

@ -0,0 +1,32 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.form</title>
<link rel=author title="Sergey Alexandrov" href="mailto:splavgm@gmail.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-form">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<form id="form">
<select id="select">
<optgroup id="optgroup"></optgroup>
</select>
</form>
<div id=log></div>
<script>
test(function () {
var form = document.getElementById("form");
var select = document.getElementById("select");
var optgroup = document.getElementById("optgroup");
var o1 = document.createElement("option");
assert_equals(o1.form, null);
select.appendChild(o1);
assert_equals(o1.form, select.form);
var o2 = document.createElement("option");
select.appendChild(o2);
assert_equals(o2.form, select.form);
}, "form");
</script>

View file

@ -0,0 +1,82 @@
function test_option(member) {
test(function() {
var option = document.createElement("option");
assert_equals(option[member], "");
}, "No children, no " + member);
test(function() {
var option = document.createElement("option");
option.setAttribute(member, "")
assert_equals(option[member], "");
}, "No children, empty " + member);
test(function() {
var option = document.createElement("option");
option.setAttribute(member, member)
assert_equals(option[member], member);
}, "No children, " + member);
test(function() {
var option = document.createElement("option");
option.setAttributeNS("http://www.example.com/", member, member)
assert_equals(option[member], "");
}, "No children, namespaced " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
assert_equals(option[member], "child");
}, "Single child, no " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.setAttribute(member, "")
assert_equals(option[member], "");
}, "Single child, empty " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.setAttribute(member, member)
assert_equals(option[member], member);
}, "Single child, " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.setAttributeNS("http://www.example.com/", member, member)
assert_equals(option[member], "child");
}, "Single child, namespaced " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.appendChild(document.createTextNode(" node "));
assert_equals(option[member], "child node");
}, "Two children, no " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.appendChild(document.createTextNode(" node "));
option.setAttribute(member, "")
assert_equals(option[member], "");
}, "Two children, empty " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.appendChild(document.createTextNode(" node "));
option.setAttribute(member, member)
assert_equals(option[member], member);
}, "Two children, " + member);
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" child "));
option.appendChild(document.createTextNode(" node "));
option.setAttributeNS("http://www.example.com/", member, member)
assert_equals(option[member], "child node");
}, "Two children, namespaced " + member);
}

View file

@ -0,0 +1,12 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.label</title>
<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-label">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=option-label-value.js></script>
<div id=log></div>
<script>
test_option("label")
</script>

View file

@ -0,0 +1,61 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.selected</title>
<link rel=author title="Corey Farwell" href="mailto:coreyf@rwell.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-selected">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function () {
var elem = document.createElement("option");
assert_equals(elem.selected, false);
elem.setAttribute("selected", "");
assert_equals(elem.selected, true);
elem.removeAttribute("selected");
assert_equals(elem.selected, false);
elem.defaultSelected = true
assert_equals(elem.selected, true);
elem.defaultSelected = false;
assert_equals(elem.selected, false);
}, "not dirty");
test(function () {
testDirty(true);
}, "dirty, selected");
test(function () {
testDirty(false);
}, "dirty, not selected");
function testDirty(isSelected) {
var elem = document.createElement("option");
elem.selected = isSelected; // After this assignment, dirtiness=true
assertDirty(elem, isSelected);
elem.selected = !isSelected; // Change the value, still dirty
assertDirty(elem, !isSelected);
};
function assertDirty(elem, expect) {
assert_equals(elem.selected, expect);
elem.setAttribute("selected", "");
assert_equals(elem.selected, expect);
elem.removeAttribute("selected");
assert_equals(elem.selected, expect);
elem.defaultSelected = true;
assert_equals(elem.selected, expect);
elem.defaultSelected = false;
assert_equals(elem.selected, expect);
}
</script>

View file

@ -0,0 +1,15 @@
<!doctype html>
<meta charset=EUC-JP>
<title>Test for the backslash sign in option.text</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<select id=test><option>\</option></select>
<script>
test(function() {
var select = document.getElementById("test");
var option = select.firstChild;
assert_equals(option.text, "\\");
assert_equals(option.textContent, "\\");
});
</script>

View file

@ -0,0 +1,23 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.text</title>
<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-text">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function() {
var option = document.createElement("option");
option.setAttribute("label", "label");
option.textContent = "text";
assert_equals(option.text, "text");
}, "Option with non-empty label.");
test(function() {
var option = document.createElement("option");
option.setAttribute("label", "");
option.textContent = "text";
assert_equals(option.text, "text");
}, "Option with empty label.");
</script>

View file

@ -0,0 +1,92 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.text</title>
<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-text">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function() {
var option = document.createElement("option");
option.appendChild(document.createElement("font"))
.appendChild(document.createTextNode(" font "));
assert_equals(option.text, "font");
}, "option.text should recurse");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" before "));
option.appendChild(document.createElement("script"))
.appendChild(document.createTextNode(" script "));
option.appendChild(document.createTextNode(" after "));
assert_equals(option.text, "before after");
}, "option.text should not recurse into HTML script elements");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" before "));
option.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "script"))
.appendChild(document.createTextNode(" script "));
option.appendChild(document.createTextNode(" after "));
assert_equals(option.text, "before after");
}, "option.text should not recurse into SVG script elements");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" before "));
option.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "script"))
.appendChild(document.createTextNode(" script "));
option.appendChild(document.createTextNode(" after "));
assert_equals(option.text, "before script after");
}, "option.text should recurse into MathML script elements");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode(" before "));
option.appendChild(document.createElementNS(null, "script"))
.appendChild(document.createTextNode(" script "));
option.appendChild(document.createTextNode(" after "));
assert_equals(option.text, "before script after");
}, "option.text should recurse into null script elements");
test(function() {
var option = document.createElement("option");
var span = option.appendChild(document.createElement("span"));
span.appendChild(document.createTextNode(" Some "));
span.appendChild(document.createElement("script"))
.appendChild(document.createTextNode(" script "));
option.appendChild(document.createTextNode(" Text "));
assert_equals(option.text, "Some Text");
}, "option.text should work if a child of the option ends with a script");
test(function() {
var script = document.createElement("script");
var option = script.appendChild(document.createElement("option"));
option.appendChild(document.createTextNode("text"));
assert_equals(option.text, "text");
}, "option.text should work if the option is in an HTML script element");
test(function() {
var script = document.createElementNS("http://www.w3.org/2000/svg", "script");
var option = script.appendChild(document.createElement("option"));
option.appendChild(document.createTextNode("text"));
assert_equals(option.text, "text");
}, "option.text should work if the option is in an SVG script element");
test(function() {
var script = document.createElementNS("http://www.w3.org/1998/Math/MathML", "script");
var option = script.appendChild(document.createElement("option"));
option.appendChild(document.createTextNode("text"));
assert_equals(option.text, "text");
}, "option.text should work if the option is in a MathML script element");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode("te"));
option.appendChild(document.createComment("comment"));
option.appendChild(document.createTextNode("xt"));
assert_equals(option.text, "text");
}, "option.text should ignore comment children");
test(function() {
var option = document.createElement("option");
option.appendChild(document.createTextNode("te"));
option.appendChild(document.createProcessingInstruction("target", "data"));
option.appendChild(document.createTextNode("xt"));
assert_equals(option.text, "text");
}, "option.text should ignore PI children");
</script>

View file

@ -0,0 +1,75 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.text</title>
<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-text">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function() {
var spaces = ["\u0020", "\u0009", "\u000A", "\u000C", "\u000D"];
spaces.forEach(function(space) {
test(function() {
var option = document.createElement("option");
option.textContent = space + "text";
assert_equals(option.text, "text");
}, "option.text should strip leading space characters (" +
format_value(space) + ")");
});
spaces.forEach(function(space) {
test(function() {
var option = document.createElement("option");
option.textContent = "text" + space;
assert_equals(option.text, "text");
}, "option.text should strip trailing space characters (" +
format_value(space) + ")");
});
spaces.forEach(function(space) {
test(function() {
var option = document.createElement("option");
option.textContent = space + "text" + space;
assert_equals(option.text, "text");
}, "option.text should strip leading and trailing space characters (" +
format_value(space) + ")");
});
spaces.forEach(function(space) {
test(function() {
var option = document.createElement("option");
option.textContent = "before" + space + "after";
assert_equals(option.text, "before after");
}, "option.text should replace single internal space characters (" +
format_value(space) + ")");
});
spaces.forEach(function(space1) {
spaces.forEach(function(space2) {
test(function() {
var option = document.createElement("option");
option.textContent = "before" + space1 + space2 + "after";
assert_equals(option.text, "before after");
}, "option.text should replace multiple internal space characters (" +
format_value(space1) + ", " + format_value(space2) + ")");
});
});
test(function() {
var option = document.createElement("option");
option.textContent = "\u00a0text";
assert_equals(option.text, "\u00a0text");
}, "option.text should leave leading NBSP alone.");
test(function() {
var option = document.createElement("option");
option.textContent = "text\u00a0";
assert_equals(option.text, "text\u00a0");
}, "option.text should leave trailing NBSP alone.");
test(function() {
var option = document.createElement("option");
option.textContent = "before\u00a0after";
assert_equals(option.text, "before\u00a0after");
}, "option.text should leave a single internal NBSP alone.");
test(function() {
var option = document.createElement("option");
option.textContent = "before\u00a0\u00a0after";
assert_equals(option.text, "before\u00a0\u00a0after");
}, "option.text should leave two internal NBSPs alone.");
});
</script>

View file

@ -0,0 +1,12 @@
<!doctype html>
<meta charset=utf-8>
<title>HTMLOptionElement.value</title>
<link rel=author title=Ms2ger href="mailto:Ms2ger@gmail.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-label">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=option-label-value.js></script>
<div id=log></div>
<script>
test_option("value")
</script>