Last Comment Bug 809290 - document.referrer should be based on the script entry point
: document.referrer should be based on the script entry point
Status: RESOLVED FIXED
: dev-doc-needed
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal with 1 vote (vote)
: mozilla19
Assigned To: Bobby Holley (:bholley) (busy with Stylo)
:
Mentors:
Depends on: 843477 810808
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-06 17:14 PST by Bobby Holley (:bholley) (busy with Stylo)
Modified: 2014-10-07 18:09 PDT (History)
3 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix nsLocation::CheckURL. v1 (3.99 KB, patch)
2012-11-07 10:29 PST, Bobby Holley (:bholley) (busy with Stylo)
bzbarsky: review+
Details | Diff | Splinter Review
Tests. v1 (4.08 KB, patch)
2012-11-07 10:29 PST, Bobby Holley (:bholley) (busy with Stylo)
no flags Details | Diff | Splinter Review
Tests. v2 (4.09 KB, patch)
2012-11-07 10:32 PST, Bobby Holley (:bholley) (busy with Stylo)
bzbarsky: review+
Details | Diff | Splinter Review

Description Bobby Holley (:bholley) (busy with Stylo) 2012-11-06 17:14:46 PST
Currently it's based on the calling document. We decided in a recent spec thread to change this:

http://lists.w3.org/Archives/Public/public-script-coord/2012OctDec/0014.html
Comment 1 Bobby Holley (:bholley) (busy with Stylo) 2012-11-07 09:40:00 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/d6f15467b587
Comment 2 Bobby Holley (:bholley) (busy with Stylo) 2012-11-07 10:29:42 PST
Created attachment 679239 [details] [diff] [review]
Fix nsLocation::CheckURL. v1
Comment 3 Bobby Holley (:bholley) (busy with Stylo) 2012-11-07 10:29:55 PST
Created attachment 679240 [details] [diff] [review]
Tests. v1
Comment 4 Bobby Holley (:bholley) (busy with Stylo) 2012-11-07 10:32:21 PST
Created attachment 679242 [details] [diff] [review]
Tests. v2

I just realized that invoking the callback on window.top from the inner iframe
will break when the mochtest is run within an iframe. Let's use
window.parent.parent instead.
Comment 5 :Ms2ger (⌚ UTC+1/+2) 2012-11-07 10:35:21 PST
Comment on attachment 679239 [details] [diff] [review]
Fix nsLocation::CheckURL. v1

Review of attachment 679239 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsLocation.cpp
@@ +147,5 @@
> +      do_QueryInterface(nsJSUtils::GetDynamicScriptGlobal(cx));
> +    if (entryPoint) {
> +      nsCOMPtr<nsIDOMDocument> domDoc;
> +      entryPoint->GetDocument(getter_AddRefs(domDoc));
> +      doc = do_QueryInterface(domDoc);

QI to nsPIDOMWindow and set doc to entryPoint->GetDoc().
Comment 6 Bobby Holley (:bholley) (busy with Stylo) 2012-11-07 10:43:24 PST
Filed a corresponding spec bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=19893
Comment 7 Boris Zbarsky [:bz] 2012-11-07 23:22:28 PST
Comment on attachment 679239 [details] [diff] [review]
Fix nsLocation::CheckURL. v1

Modulo Ms2ger's nit, r=me
Comment 8 Boris Zbarsky [:bz] 2012-11-07 23:26:06 PST
Comment on attachment 679242 [details] [diff] [review]
Tests. v2

r=me
Comment 9 Bobby Holley (:bholley) (busy with Stylo) 2012-11-08 08:27:09 PST
Per my investigation in bug 797204, the only test in our testsuite that is sensitive to this distinction is bug dom/tests/mochitest/bugs/test_bug593174.html, which I've fixed in this patch.

remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/9ec4fbe7040f
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/5272e198951c

Note You need to log in before you can comment on or make changes to this bug.