Skip to content

[css-zoom?] Zoom and inheritance.  #9397

Closed
@emilio

Description

@emilio

Zoom has some interesting behavior that makes no sense to me (live):

<!doctype html>
<div style="font-size: 16px; width: 100px; line-height: 16px;">
  <div style="background-color: green; font-size: inherit; line-height: inherit; width: inherit; height: 100px; zoom: 2;">What size am I?</div>
</div>

That for some reason ends up with:

  • line-height of 16px
  • font-size of 32px
  • width of 100px
  • height of 200px

That just makes no sense. This happens because the way zoom is implemented in browsers is by mutating the computed value, so inheritance doesn't account for zoom since it copies the un-zoomed computed value.

But then somehow font-size (but not line-height) is special, and gets recomputed on zoom changes??

cc: #5623 @chrishtr @lilles @smfr @tabatkins @atanassov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions