Closed Bug 1763495 Opened 2 years ago Closed 2 years ago

Simplify styles in TopLevelVideoDocument.css

Categories

(Core :: Layout: Images, Video, and HTML Frames, task, P3)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files)

In bug 1739691, I noticed that TopLevelVideoDocument.css has some styles that can be simplified, I think.

In particular: we don't need to bother setting any styles at all on body, and we don't need to bother setting margin/padding on the root element.

I'm pretty sure we can make this simplification without having any user-visible impact, but I'm spinning it off to its own bug patch just to be on the safe side in case it somehow does have an effect.

As indicated in the new code-comment, we do need the html element to be the
full height of the viewport. But:

  • we don't need to set width to 100%. The default, 'auto', has the same effect.
  • we don't need to set margin/padding to 0; they default to 0 on 'html'.
  • we don't need to set anything on the body, since it doesn't render or have
    any children in the box tree. (The video descendant is abspos and hence uses
    the viewport as its containing block, not the body.)

As an extra check that this is reasonable, note that the similar
TopLevelImageDocument.css stylesheet doesn't have any CSS rules that target the
html or body elements.

Attachment #9271167 - Attachment description: WIP: Bug 1763495: Remove some unnecessary styles in TopLevelVideoDocument.css. → Bug 1763495: Remove some unnecessary styles in TopLevelVideoDocument.css. r?#layout-reviewers,hsivonen
Attachment #9271167 - Attachment description: Bug 1763495: Remove some unnecessary styles in TopLevelVideoDocument.css. r?#layout-reviewers,hsivonen → Bug 1763495 part 1: Remove some unnecessary styles in TopLevelVideoDocument.css. r?#layout-reviewers

This doesn't change behavior; it just makes the existing CSS a bit more concise.

('inset' is a shorthand that sets top, right, bottom, and left all at once.)

Depends on D143099

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3311357f2912
part 1: Remove some unnecessary styles in TopLevelVideoDocument.css. r=hsivonen,emilio
https://hg.mozilla.org/integration/autoland/rev/ec092287f6b4
part 2: Use 'inset' shorthand in TopLevelImageDocument.css and TopLevelVideoDocument.css. r=emilio
See Also: → 1763667
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: