Add override style sheet for :-moz-full-screen-ancestor

RESOLVED FIXED in Firefox 11

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: cpearce, Assigned: cpearce)

Tracking

Trunk
mozilla11
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox10 wontfix, firefox11 fixed)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
The :-moz-full-screen-ancestor style rules should be in an override style sheet, not ua.css.
(Assignee)

Comment 1

6 years ago
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.
(Assignee)

Comment 2

6 years ago
That should be -moz-transform:none rather than transform:none, the latter isn't supported in Firefox yet.
(Assignee)

Comment 3

6 years ago
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.
Assignee: nobody → chris
Status: NEW → ASSIGNED
Attachment #574752 - Flags: review?(bzbarsky)

Comment 4

6 years ago
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?
Attachment #574752 - Flags: review?(bzbarsky) → review-
(Assignee)

Comment 5

6 years ago
(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

6 years ago
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?
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.
(Assignee)

Comment 8

6 years ago
Created attachment 575768 [details] [diff] [review]
Patch v2: Store override sheet in style cache

Store override sheet in style cache, similar to forms.css.
Attachment #574752 - Attachment is obsolete: true
Attachment #575768 - Flags: review?(bzbarsky)
(Assignee)

Comment 9

6 years ago
bz: review ping?
Blocks: 706192

Comment 10

6 years ago
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

6 years ago
Comment on attachment 575768 [details] [diff] [review]
Patch v2: Store override sheet in style cache

r=me.
Attachment #575768 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 12

6 years ago
Landed, targeting Firefox 11 for this.

https://hg.mozilla.org/integration/mozilla-inbound/rev/bb3bfc552568
status-firefox10: --- → wontfix
status-firefox11: --- → fixed
Target Milestone: --- → mozilla11
https://hg.mozilla.org/mozilla-central/rev/bb3bfc552568
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Blocks: 703546
Blocks: 714743
Blocks: 714744
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.