Closed
Bug 722853
Opened 13 years ago
Closed 13 years ago
Determine Private Browsing state from nearest docshell
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: jdm, Assigned: jdm)
References
(Depends on 1 open bug)
Details
Attachments
(1 file, 4 obsolete files)
The PB service is going away. We need to get this information from the closest docshell instead when determining whether to use information such as link visited state.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee | ||
Comment 2•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #593347 -
Attachment is obsolete: true
Assignee | ||
Comment 3•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #593578 -
Attachment is obsolete: true
Assignee | ||
Comment 4•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #593595 -
Attachment is obsolete: true
Comment 5•13 years ago
|
||
Is this ready for review Josh?
Assignee | ||
Comment 6•13 years ago
|
||
Comment on attachment 593596 [details] [diff] [review]
Derive private browsing status from docshell when assigning element states.
Feel free to turn this into a review request, or pass it off to someone else. I'm looking for feedback as to the kinds of tests I should run, as I have not run any yet. I'm also flailing around in the code, so confirmation that this is the right way to do this would be good.
Attachment #593596 -
Flags: feedback?(dbaron)
Updated•13 years ago
|
Attachment #593596 -
Flags: review?(roc)
Comment on attachment 593596 [details] [diff] [review]
Derive private browsing status from docshell when assigning element states.
Review of attachment 593596 [details] [diff] [review]:
-----------------------------------------------------------------
I assume the PB-status of a docshell can't change during its lifetime.
dbaron needs to review this.
::: layout/style/nsRuleProcessorData.h
@@ +147,5 @@
> {
> + nsCOMPtr<nsISupports> container = mDocument->GetContainer();
> + nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(container);
> + if (loadContext) {
> + loadContext->GetUsePrivateBrowsing(&mUsingPrivateBrowsing);
Could there be a deCOM version of this method?
@@ +150,5 @@
> + if (loadContext) {
> + loadContext->GetUsePrivateBrowsing(&mUsingPrivateBrowsing);
> + } else {
> + //XXXjdm What's the right thing to do here?
> + NS_WARNING("Couldn't get loadContext from container; assuming no private browsing.");
Wouldn't it be better to default to private?
Attachment #593596 -
Flags: review?(roc)
Attachment #593596 -
Flags: review?(dbaron)
Attachment #593596 -
Flags: feedback?(dbaron)
Comment 8•13 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #7)
> Comment on attachment 593596 [details] [diff] [review]
> Derive private browsing status from docshell when assigning element states.
>
> Review of attachment 593596 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I assume the PB-status of a docshell can't change during its lifetime.
It can.
> @@ +150,5 @@
> > + if (loadContext) {
> > + loadContext->GetUsePrivateBrowsing(&mUsingPrivateBrowsing);
> > + } else {
> > + //XXXjdm What's the right thing to do here?
> > + NS_WARNING("Couldn't get loadContext from container; assuming no private browsing.");
>
> Wouldn't it be better to default to private?
I don't think so. That's definitely not the current behavior.
Is there any case where loadContext can be null there?
Comment 9•13 years ago
|
||
Comment on attachment 593596 [details] [diff] [review]
Derive private browsing status from docshell when assigning element states.
Oops, I probably should have tossed this review to bz when it came in, since he's been in this code more lately (and has some patches-in-progress affecting it, I think). That said, it looks fine.
Could you name the params that are of type TreeMatchContext aTreeMatchContext rather than aMatchContext -- since some functions could end up with a NodeMatchContext at some point in the future too?
>+ //XXXjdm What's the right thing to do here?
>+ NS_WARNING("Couldn't get loadContext from container; assuming no private browsing.");
Seems like this ought to be at least an NS_ASSERTION.
r=dbaron with that
Attachment #593596 -
Flags: review?(dbaron) → review+
Comment 10•13 years ago
|
||
Hmm. Can we end up there with a data document of some sort? Or do those have containers?
Comment 11•13 years ago
|
||
Try run for ad8586ccbe14 is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=ad8586ccbe14
Results (out of 55 total builds):
success: 43
warnings: 12
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/josh@joshmatthews.net-ad8586ccbe14
Assignee | ||
Comment 12•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #593596 -
Attachment is obsolete: true
Comment 13•13 years ago
|
||
Try run for 9e829ab62cd0 is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=9e829ab62cd0
Results (out of 62 total builds):
success: 54
warnings: 8
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/josh@joshmatthews.net-9e829ab62cd0
Assignee | ||
Updated•13 years ago
|
Whiteboard: [passes tests, needs landing]
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → josh
Comment 14•13 years ago
|
||
Target Milestone: --- → mozilla14
Comment 15•13 years ago
|
||
Whiteboard: [passes tests, needs landing] → [doesn't pass tests]
Target Milestone: mozilla14 → ---
Assignee | ||
Comment 16•13 years ago
|
||
Now passes with bug 723353 landed.
Depends on: 723353
Whiteboard: [doesn't pass tests]
Assignee | ||
Comment 17•13 years ago
|
||
Comment 18•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in
before you can comment on or make changes to this bug.
Description
•