Bug 702146 - Move :-moz-full-screen-ancestor to an override style sheet. r=bz

This commit is contained in:
Chris Pearce 2011-11-30 11:00:31 +13:00
parent 141d85d850
commit d42af5d3c8
7 changed files with 82 additions and 17 deletions

View File

@ -252,6 +252,7 @@ res/fonts/mathfontMath4.properties
res/fonts/mathfontPUA.properties
res/fonts/pangoFontEncoding.properties
res/forms.css
res/full-screen-override.css
res/hiddenWindow.html
res/html.css
res/html/gopher-audio.gif

View File

@ -2219,6 +2219,11 @@ DocumentViewerImpl::CreateStyleSet(nsIDocument* aDocument,
styleSet->PrependStyleSheet(nsStyleSet::eAgentSheet, sheet);
}
sheet = nsLayoutStylesheetCache::FullScreenOverrideSheet();
if (sheet) {
styleSet->PrependStyleSheet(nsStyleSet::eOverrideSheet, sheet);
}
// Make sure to clone the quirk sheet so that it can be usefully
// enabled/disabled as needed.
nsRefPtr<nsCSSStyleSheet> quirkClone;

View File

@ -0,0 +1,56 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Chris Pearce <chris@pearce.org.nz>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
*|*:-moz-full-screen-ancestor {
/* Ancestors of a full-screen element should not induce stacking contexts
that would prevent the full-screen element from being on top. */
z-index: auto;
/* Ancestors of a full-screen element should not be partially transparent,
since that would apply to the full-screen element and make the page visible
behind it. It would also create a pseudo-stacking-context that would let content
draw on top of the full-screen element. */
opacity: 1;
/* Ancestors of a full-screen element should not apply SVG masking, clipping, or
filtering, since that would affect the full-screen element and create a pseudo-
stacking context. */
mask: none;
clip: auto;
filter: none;
-moz-transform: none;
}

View File

@ -2,6 +2,7 @@ toolkit.jar:
* res/ua.css (ua.css)
res/html.css (html.css)
res/quirk.css (quirk.css)
res/full-screen-override.css (full-screen-override.css)
res/viewsource.css (viewsource.css)
* res/forms.css (forms.css)
res/arrow.gif (arrow.gif)

View File

@ -155,6 +155,16 @@ nsLayoutStylesheetCache::QuirkSheet()
return gStyleCache->mQuirkSheet;
}
nsCSSStyleSheet*
nsLayoutStylesheetCache::FullScreenOverrideSheet()
{
EnsureGlobal();
if (!gStyleCache)
return nsnull;
return gStyleCache->mFullScreenOverrideSheet;
}
void
nsLayoutStylesheetCache::Shutdown()
{
@ -191,6 +201,13 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache()
LoadSheet(uri, mQuirkSheet, true);
}
NS_ASSERTION(mQuirkSheet, "Could not load quirk.css");
NS_NewURI(getter_AddRefs(uri), "resource://gre-resources/full-screen-override.css");
if (uri) {
LoadSheet(uri, mFullScreenOverrideSheet, true);
}
NS_ASSERTION(mFullScreenOverrideSheet, "Could not load full-screen-override.css");
}
void

View File

@ -64,6 +64,7 @@ class nsLayoutStylesheetCache
static nsCSSStyleSheet* UserChromeSheet();
static nsCSSStyleSheet* UASheet();
static nsCSSStyleSheet* QuirkSheet();
static nsCSSStyleSheet* FullScreenOverrideSheet();
static void Shutdown();
@ -85,6 +86,7 @@ private:
nsRefPtr<nsCSSStyleSheet> mUserChromeSheet;
nsRefPtr<nsCSSStyleSheet> mUASheet;
nsRefPtr<nsCSSStyleSheet> mQuirkSheet;
nsRefPtr<nsCSSStyleSheet> mFullScreenOverrideSheet;
};
#endif

View File

@ -260,23 +260,6 @@
overflow: hidden !important;
}
*|*:-moz-full-screen-ancestor {
/* Ancestors of a full-screen element should not induce stacking contexts
that would prevent the full-screen element from being on top. */
z-index:auto !important;
/* Ancestors of a full-screen element should not be partially transparent,
since that would apply to the full-screen element and make the page visible
behind it. It would also create a pseudo-stacking-context that would let content
draw on top of the full-screen element. */
opacity:1 !important;
/* Ancestors of a full-screen element should not apply SVG masking, clipping, or
filtering, since that would affect the full-screen element and create a pseudo-
stacking context. */
mask:none !important;
clip:none !important;
filter:none !important;
}
/* XML parse error reporting */
parsererror|parsererror {