Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[css-typed-om] CSSMatrixComponent handles is2D inconsistently #1155

@AtkinsSJ

Description

@AtkinsSJ

CSSMatrixComponent has an is2D slot like any other CSSTransformComponent. Its held DOMMatrix also has an is2D slot, and these don't always match up. For example, the CSSMatrixComponent(matrix, options) constructor lets the user pass in their own is2D flag, which overrides CSSMatrixComponent's, but doesn't change its internal DOMMatrix's one.

A bug is that serialize a CSSMatrixComponent says this, which means it uses its held DOMMatrix's is2D flag and ignores its own:

  1. Return the serialization of this’s matrix internal slot.

Some other things that might not be bugs but are confusing, are:

  • When setting CSSMatrixComponent.matrix, should the is2D slots be affected?
  • Related, when getting CSSMatrixComponent.matrix, what should its is2D slot be? Should the matrix be different depending on is2D?
  • If the DOMMatrix is mutated so that its is2D slot becomes false, should the CSSMatrixComponent's is2D be updated?

In my opinion, CSSMatrixComponent shouldn't have an is2D of its own, but should just reflect the is2D of its contained DOMMatrix. The constructor above could then create a copy of the DOMMatrix if it needs to mutate is2D on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions