Closed
Bug 943418
Opened 11 years ago
Closed 11 years ago
current-inner checking for history is broken
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
5.79 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
This is blocking me fixing bug 936056.
In particular, that patch changes us to actually pass the inner as thisval to DOM getters, so it's actually very easy to get a history object with a non-current inner. Like so:
<script>
window.onload = function() {
document.open();
history.length; // throws
}
</script>
The key part is that the spec talks about _documents_ but we implemented in terms of _windows_ and in this case the document is active but the window is not.
Assignee | ||
Comment 1•11 years ago
|
||
I considered adding a separate nsIDocument::IsActiveDocument, but then I never ended up needing it, hence just the comments on how IsActive() is not it
Attachment #8338577 -
Flags: review?(bobbyholley+bmo)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Updated•11 years ago
|
Whiteboard: [need review]
Comment 2•11 years ago
|
||
Comment on attachment 8338577 [details] [diff] [review]
Check for active documents, not current inners, in History APIs.
Review of attachment 8338577 [details] [diff] [review]:
-----------------------------------------------------------------
So, we're sure that this is the behavior that we want here? I'd kind of prefer that we didn't have to do this, but presumably this is enough of a problem for web-compat?
For the document.open case, the spec still associates the old Window with the document, right?
Please make sure this testcase ends up in the tree, either with this bug or the other one.
::: dom/base/nsPIDOMWindow.h
@@ +335,5 @@
> "It doesn't make sense to call this on outer windows.");
> return mOuterWindow && mOuterWindow->GetCurrentInnerWindow() == this;
> }
>
> + bool HasActiveDocument()
Please add a comment here explaining the case that this covers.
Attachment #8338577 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 3•11 years ago
|
||
> For the document.open case, the spec still associates the old Window with the document,
> right?
Yes.
In fact, the document.open case is the only case in which this check differs from the old one.
> Please make sure this testcase ends up in the tree
It already is, effectively; that's why the patch in bug 936056 is orange on try.
Assignee | ||
Comment 4•11 years ago
|
||
That said, I can add it explicitly, I guess.
Assignee | ||
Comment 5•11 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla28
Comment 6•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•