Bug 862084 - Mark HTMLSelectElement.{item,namedItem} as potentially returning null to fix a crash; r=bz

This commit is contained in:
Ms2ger 2013-04-21 08:41:54 +02:00
parent e9e1fa61d5
commit 52a59671a2
3 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,9 @@
<!doctype html>
<select></select>
<script>
var select = document.getElementsByTagName("select");
select.item(0);
select[0];
select.namedItem("x")
select["x"]
</script>

View File

@ -50,4 +50,4 @@ load 828180.html
load 832011.html
load 837033.html
pref(dom.experimental_forms_range,true) load 838256-1.html
load 862084.html

View File

@ -30,9 +30,9 @@ interface HTMLSelectElement : HTMLElement {
readonly attribute HTMLOptionsCollection options;
[SetterThrows, Pure]
attribute unsigned long length;
getter Element item(unsigned long index);
getter Element? item(unsigned long index);
[Throws]
object namedItem(DOMString name);
object? namedItem(DOMString name);
[Throws]
void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
void remove(long index);