Last Comment Bug 702146 - Add override style sheet for :-moz-full-screen-ancestor
: Add override style sheet for :-moz-full-screen-ancestor
Status: RESOLVED FIXED
[qa-]
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: Chris Pearce (:cpearce)
:
Mentors:
Depends on:
Blocks: 545812 703546 706192 714743 714744
  Show dependency treegraph
 
Reported: 2011-11-13 13:37 PST by Chris Pearce (:cpearce)
Modified: 2012-02-01 12:59 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
wontfix
fixed


Attachments
Patch v1 (10.60 KB, patch)
2011-11-15 17:23 PST, Chris Pearce (:cpearce)
bzbarsky: review-
Details | Diff | Review
Patch v2: Store override sheet in style cache (8.77 KB, patch)
2011-11-20 13:02 PST, Chris Pearce (:cpearce)
bzbarsky: review+
Details | Diff | Review

Description Chris Pearce (:cpearce) 2011-11-13 13:37:37 PST
The :-moz-full-screen-ancestor style rules should be in an override style sheet, not ua.css.
Comment 1 Chris Pearce (:cpearce) 2011-11-14 16:55:40 PST
We should also add transform:none and change clip:none to clip:auto in the default style for :-moz-full-screen-ancestor.

I've emailed Anne to get the W3 spec changed to clip:auto rather than clip:none.
Comment 2 Chris Pearce (:cpearce) 2011-11-14 17:00:12 PST
That should be -moz-transform:none rather than transform:none, the latter isn't supported in Firefox yet.
Comment 3 Chris Pearce (:cpearce) 2011-11-15 17:23:37 PST
Created attachment 574752 [details] [diff] [review]
Patch v1

* Move rules for :-moz-full-screen-ancestor to a new file /content/base/src/FullScreenOverride.css.
* s/clip:none;/clip:auto;/
* Add -moz-transform:none to :-moz-full-screen-ancestor.
* Load FullScreenOverride.css and add it as an override style sheet to full-screen documents.
Comment 4 Boris Zbarsky [:bz] 2011-11-15 19:29:54 PST
Comment on attachment 574752 [details] [diff] [review]
Patch v1

So as far as I can tell if you AddFullScreenStyleOverride then RemoveFullScreenStyleOverride then AddFullScreenStyleOverride the sheet won't be added.... what am I missing?

Things will also break, I think, if the presshell for the document is recreated while in full-screen.

If we don't need lazy-loading here, it's probably better to just put this stylesheet in the stylesheet cache like the forms sheet and have style set creation add it as an override sheet.

Also, why do we ever need to _remove_ this sheet?

Finally, I assume the !important removal is on purpose so that these rules will override document rules by default but document !important rules will be able to overide our rules?
Comment 5 Chris Pearce (:cpearce) 2011-11-16 17:47:48 PST
(In reply to Boris Zbarsky (:bz) from comment #4)
> Comment on attachment 574752 [details] [diff] [review] [diff] [details] [review]
> Patch v1
> 
> So as far as I can tell if you AddFullScreenStyleOverride then
> RemoveFullScreenStyleOverride then AddFullScreenStyleOverride the sheet
> won't be added.... what am I missing?

Oops. I forgot to reset mFullScreenStyleOverride in RemoveFullScreenStyleOverride() ;)

> Things will also break, I think, if the presshell for the document is
> recreated while in full-screen.

Hmm, so if we put the override sheet in the stylesheet cache would we still need to re-enable the override style sheet if the presshell was recreated? Where do we do this? Or would the recreation automatically do this for us?

> Finally, I assume the !important removal is on purpose so that these rules
> will override document rules by default but document !important rules will
> be able to overide our rules?

Yup.
Comment 6 Anne (:annevk) 2011-11-17 03:14:00 PST
Maybe we should put this at "UA important" (Gecko-only, I know, but we can make it up) instead for now? What are the use cases for wanting to override position:fixed and such?
Comment 7 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-11-17 11:17:50 PST
An author might want to display a badge, or floating toolbar, or advertisement overlay, even while content is fullscreen. They might want to possibly size/position the fullscreen element to not overlap that content.
Comment 8 Chris Pearce (:cpearce) 2011-11-20 13:02:53 PST
Created attachment 575768 [details] [diff] [review]
Patch v2: Store override sheet in style cache

Store override sheet in style cache, similar to forms.css.
Comment 9 Chris Pearce (:cpearce) 2011-11-29 11:51:15 PST
bz: review ping?
Comment 10 Boris Zbarsky [:bz] 2011-11-29 13:00:59 PST
Sorry, this got lost in the travel + holiday weekend mess...

> Or would the recreation automatically do this for us?

Exactly.  CreateStyleSet would get called and things would Just Work.
Comment 11 Boris Zbarsky [:bz] 2011-11-29 13:01:48 PST
Comment on attachment 575768 [details] [diff] [review]
Patch v2: Store override sheet in style cache

r=me.
Comment 12 Chris Pearce (:cpearce) 2011-11-29 14:07:16 PST
Landed, targeting Firefox 11 for this.

https://hg.mozilla.org/integration/mozilla-inbound/rev/bb3bfc552568
Comment 13 Marco Bonardo [::mak] 2011-11-30 03:54:48 PST
https://hg.mozilla.org/mozilla-central/rev/bb3bfc552568

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