Open Bug 856295 Opened 11 years ago Updated 3 years ago

Document.readyState should be an enum

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: Ms2ger, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Assignee: nobody → Ms2ger
Hmm, it looks like we could return "uninitialized" in some cases. Henri, do you know if script can hit this?
Flags: needinfo?(hsivonen)
We are not supposed to return uninitialized in any script-detectable case, IIRC. What case do you have in mind?

Internally, we should keep a "not yet loading" state to detect bugs. Also, a "not yet loading into a document" state will be useful when moving readystate off nsDocument into a navigation life cycle object that the document points to as part of fixing bug 779959.

What's the benefit and motivation of the spec change?
Flags: needinfo?(hsivonen)
The benefit for us is that you can return an enum value and don't need to deal with strings in nsDocument.
Here's a one-liner that gives a script readyState of "uninitialized":
document.body.innerHTML = '<iframe src="/foo">'; document.querySelector("iframe").contentDocument.readyState

I think that bug 1171919 has hitting this case (readyState === "uninitialized") in a real document load setting (just a guess, don't know for sure).
Reminder to ask Henri if he wants a bug for that when he's back.
Assignee: Ms2ger → nobody
Severity: normal → trivial
Flags: qe-verify-
Flags: needinfo?(Ms2ger)
Flags: needinfo?(Ms2ger) → needinfo?(hsivonen)
Thanks. Filed as bug 1191683.
Flags: needinfo?(hsivonen)

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: trivial → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.