I have one crazy idea. Currently the overlay is an <iframe> containing the admin pages on top of the parent (context) page.

What about the reverse? The parent (context) page as an <iframe> positioned on the background (full width/height) of the admin (overlay) page? It'll look totally the same. The overlay could use the same process as the toolbar toggling (cookie). The overlay module probably won't even need any (or very little) Javascript.

Pros:
* Accessibility, the parent page is in an iframe and can be hidden (left out of the accessibility tree) for screen readers and other ATs by just adding tabindex="-1" #716612: Overlay is not accessible to screen reader users
* Overlay URLs will be the same as regular URLs (only ?overlay-context={parent_url} will be added) and thus won't break when overlay is disabled. #870546: Overlay URLs do not gracefully fail
* Parent page updates if for example the theme is changed #697918: Update theme when default theme changes
* Hardly any Javascript will be needed as the overlay will be just a normal page with some extra CSS/markup and an iframe containing the parent (context) page.
* Overlay specific things like #655388: Many ways to lose data on form input in the overlay won't be needed.

Cons:
* Parent page is reloaded every time another overlay page is visited
* Which means overlay actually loads two pages every time one overlay page is visited (But we might cache (or allow browser cache (private; current user only) of the last parent page per user and update it every time the context changes and on form submissions))
* Opening the overlay/switching pages inside the overlay might look a bit different as the whole page is rebuild (need to test though).

Sorry I came up with this so late as it will change overlay much again, but it might be thé solution to the last outstanding issues.

Comments

Everett Zufelt’s picture

@Casey

This is an interesting idea. I am however not convinced that the parent page will be left out of the accessibility tree for screen-reader users.

In Safari with VoiceOver this will be an inprovement, as VO will see all of the overlay content and the user will have to interact with the frame to find the parent content.

With JAWS (I am not sure about other screen-readers), all of the parent frame will likely still be placed in the buffer. I don't imagine that setting the tabindex to -1 will hide the iFrame contents from JAWS. But, I can test if you want to make a test page containing an iFrame with some content and its tab index set to -1

casey’s picture

Status: Active » Needs review
StatusFileSize
new70.83 KB

I mean something like this...

Status: Needs review » Needs work

The last submitted patch, overlay-reversed2.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
David_Rothstein’s picture

StatusFileSize
new71.33 KB

Wow. This is intriguing.

I remember we discussed at one point that we'd simplify the code a lot if we just reloaded the page every time a form was submitted rather than trying to detect changes, but this takes that idea to a whole new level and then some. Impressive job :) The concern then was the same as casey mentions above, that these full page rebuilds might look too weird to the user on certain browsers. And with the current overlay I think that is the case, but because this patch removes all the JavaScript (!) from the overlay that doesn't seem to be an issue anymore. I tested it on a few different browsers and the reloads all looked pretty smooth to me.

Like Everett I'm not totally sure I understand how this solves the accessibility issues (at least not with the tabindex change alone) but by sandboxing all the "unwanted" content inside a single iframe it seems like it can only help. So one of the toughest problems before was that there are so many ways screen readers can jump to different text on the page - e.g., you can tell it to jump to the next paragraph, or next h3 heading, or whatever, and we were trying to catch all those. But if you tell it to jump to the next paragraph and the next thing is an iframe will a screen reader like JAWS really cross silently into the iframe and jump to a paragraph in there? I guess that is what is worth testing.

The patch no longer applied so here is a straight reroll (attached).

aspilicious’s picture

232 insertions, 1638 deletions.

You must be joking?

reglogge’s picture

subscribing

aspilicious’s picture

First impressions:

PRO
----
- IT IS INCREDIBLY FAST

CON
----
- behind the overlay you see the page loading again for every page, *very* *very* annoying.
- on switching: when there is a small lag you get a white screen for a sec just like any non overlay pages.

BUG
----
You deleted some code that put the "add to shotcuts" behind the title

David_Rothstein’s picture

- behind the overlay you see the page loading again for every page, *very* *very* annoying.

I noticed that too (sometimes) but that seems to be a bug. The intention of @casey's patch is that the reload only happens on e.g. form submissions and the like, not all the time. While testing it out, sometimes it worked that way for me, but other times it didn't, so there's probably just a bug in there we need to track down.

You deleted some code that put the "add to shotcuts" behind the title

There's an issue at #782652: Shortcut-specific code shouldn't be in the Overlay module that would make that work, and it's a good idea in its own right (and probably not a hard patch, just haven't tried writing it yet though). @casey's patch here just reveals what any other module besides the shortcut module is going to experience anyway if they try to attach something to the page title, so it's a good argument for why that other issue should be fixed :)

aspilicious’s picture

I also noticed this: on switching: when there is a small lag you get a white screen for a sec just like any non overlay pages..

Added it to my previous post

Cons:
* Parent page is reloaded every time another overlay page is visited

Isn't this the cause of the reload?

Everett Zufelt’s picture

I tested the patch in #5 with JAWS 11.0.756 / FF 3.6.8 and VoiceOver (OS X 10.6.3) / Safari 4.0.4

JAWS parsed all content into the same virtual buffer, meaning that all of the underlying page content in the iFrame is still available to the user.

VoiceOver only presented the frame as a single object in the DOM that the user would need to interact with to read the content. However, if the user were to interact they would be confused by the fact that the toolbar and other content would appear to be duplicated twice on the page.

Status: Needs review » Needs work

The last submitted patch, overlay-reversed-885690-5.patch, failed testing.

aspilicious’s picture

If this is ever going to work, please include this into a new overlay-rtl.css.

#overlay {
  padding-right: 0px;
  padding-left: 26px;
}
#overlay-title {
  float: right;
}
#overlay-close-wrapper {
  right: auto;
  left: 0;
}
#overlay-close,
#overlay-close:hover {
  background: transparent url(images/close-rtl.png) no-repeat;
  -moz-border-radius-topright: 0;
  -webkit-border-top-right-radius: 0;
  border-top-right-radius: 0;
}

/**
 * Tabs on the overlay.
 */
#overlay-tabs {
  left: 20px;
  right: auto;
}
reglogge’s picture

I just tested this patch against some of the issues reported in http://drupal.org/node/655388 and it solves them, e.g. the problem of clicking on 'More information about text formats' while adding/editing a node in overlay and losing every change you made in your form.

Regarding #10 and #8: I don't see the white flashing and also don't think the page reloads of the parent page (background) are really noticeable due to the very dark overlay.

Big ++ for going forward with this.

casey’s picture

Flashing of the iframe contents differs per browser; IE doesn't seem to do that.

Also the session being used is not fully functional; e.g. when using the browser back button. Could use something like current url style but then reversed: /admin/somepage?overlay-context=node/123 or #overlay-context=node/123. I would prefer the query fragment in this case.

cwgordon7’s picture

Is there any reason we can't do everything on one page - e.g., only load a new page once, on the opening of the overlay. The overlay then opens on the main part of the new page, with the old page in an iframe in the background. Then when the overlay moves around, e.g. a form submits, or a link is clicked, the overlay is reloaded through javascript -- not an iframe. Not sure if this makes sense or if it does whether it's too much code to be viable, but perhaps worth considering.

kika’s picture

subscribe

casey’s picture

We could try an <object> instead of and <iframe> and see if this isn't included in the accessibility tree...

Also for ARIA supported ATs we can use aria-hidden role="presentation" or role="image"

Everett Zufelt’s picture

@Casey

I am not sure if embedding the underlying document in an would be effective, but I can test. Otherwise the most important issue for D7 release is connecting a link from the Overlay to the user profile / edit page where it can be disabled.

casey’s picture

Ok lets finish #716612: Overlay is not accessible to screen reader users first then. I'll provide a patch for the disable link after that one.

casey’s picture

Content of <object> is included in the accessibility tree too.

Everett Zufelt’s picture

@Casey

Curious where you found the info that content of object is included in accessibility tree? Can you please provide more details?

casey’s picture

I tested it myself; I have JAWS (10 and 11) installed and I still can access elements (forms, links, headings, etc) from the underlying page.

Everett Zufelt’s picture

Status: Needs work » Closed (won't fix)

This was a demonstration to assess if reversing the Overlay would aid accessibility. We are looking at a different route, setting to wn't fix.

David_Rothstein’s picture

Status: Closed (won't fix) » Needs work

Wait... why? There are tons and tons of possible benefits from this patch.

Granted, I think the chances of this getting into Drupal 7 (at least Drupal 7 core, that is) are pretty slim at this point, but I don't think it should be "won't fix" overall.

Everett Zufelt’s picture

@David

Thanks for reopening this. I was only looking at it from an accessibility perspective. If there are other possible benefits then it's good for it to be reopened.

Everett Zufelt’s picture

Version: 7.x-dev » 8.x-dev

Bumping to D8. We are on beta2, I don't see this getting into D7.

jcisio’s picture

Subscribe. Is the overlay-context needed at all, or just for visualization pleasure? We have an overlay of 90% window size, thus the overlay-context can be replaced with a "fake background".

ksenzee’s picture

I'll take a more careful look at this now that the Drupal 8 branch is open. The idea definitely has merit, and now is the time for total rewrites like this.

tkoleary’s picture

Status: Needs work » Closed (won't fix)

Out of date.

David_Rothstein’s picture

Version: 8.x-dev » 9.x-dev
Status: Closed (won't fix) » Needs work

In what way is it out of date?

It still seems relevant to me, but I don't think it can really happen for Drupal 8 at this point, so moving to Drupal 9.

David_Rothstein’s picture

Title: Overlay reversed » Reverse the overlay implementation (put the parent page in an iframe underneath the administrative page)

More descriptive title.

haydeniv’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Overlay has been removed from core so this is no longer an issue that needs resolved. #2088121: Remove Overlay

Version: 9.x-dev » 9.0.x-dev

The 9.0.x branch will open for development soon, and the placeholder 9.x branch should no longer be used. Only issues that require a new major version should be filed against 9.0.x (for example, removing deprecated code or updating dependency major versions). New developments and disruptive changes that are allowed in a minor version should be filed against 8.9.x, and significant new features will be moved to 9.1.x at committer discretion. For more information see the Allowed changes during the Drupal 8 and 9 release cycles and the Drupal 9.0.0 release plan.