[ iOS Simulator ] REGRESSION (r237702) Layout Test http/tests/security/xss-DENIED...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 19:56:02 +0000 (19:56 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 19:56:02 +0000 (19:56 +0000)
commitb2987d2209a70a8a3eac3e01d417cfae0425aba0
treed4f83afb65097250d0163eb2f1a3fe750abca1ff
parent22bc94aa3a24dc6d04983ed9479ebdb5d21dd3db
[ iOS Simulator ] REGRESSION (r237702) Layout Test http/tests/security/xss-DENIED-script-inject-into-inactive-window.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=195385
<rdar://problem/48657425>

Reviewed by Alex Christensen.

Before r237702, the test used to detect that _openedWindowDocument had become frameless (i.e. lost its browsing context)
by checking if _openedWindowDocument.location.href is the empty String. However, r237702 updating Location to return
"about:blank" instead of "" when frameless, to match the latest specification. As a result, I had updated the test to
expect _openedWindowDocument.location.href to be "about:blank". However, I had not noticed that the document's initial
URL (while it had a browsing context) was also "about:blank". Therefore, checking that location.href is "about:blank"
would actually not guarantee that the document has no browsing context.

To address the issue, check that _openedWindowDocument.defaultView is null instead since this is guaranteed to be null
for Documents that do not have a browsing context as per:
- https://html.spec.whatwg.org/multipage/window-object.html#dom-document-defaultview

* http/tests/security/xss-DENIED-script-inject-into-inactive-window.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/xss-DENIED-script-inject-into-inactive-window.html