Skip to content

[css-typed-om] Describe what setting is2D on CSSTransformComponent should do #414

@wilddamon

Description

@wilddamon

https://drafts.css-houdini.org/css-typed-om/#dom-csstransformcomponent-is2d

Should setting is2D to true clear out any 3D attributes on a component? For example:

  let rotation = new CSSRotation(1, 2, 3, new CSSUnitValue(10, 'deg'));
  assert_false(rotation.is2D);
  assert_equals(rotation.z, 3);

  rotation.is2D = true;
  assert_true(rotation.is2D);
  assert_equals(rotation.z, 1);

Additionally, should setting is2D to false again after that restore the previous value? My guess is no, but if it did, then the following would work

  let rotation = new CSSRotation(1, 2, 3, new CSSUnitValue(10, 'deg'));
  rotation.is2D = true;
  assert_true(rotation.is2D);
  assert_equals(rotation.z, 1);
  rotation.is2D = false;
  assert_false(rotation.is2D);
  assert_equals(rotation.z, 3);

The difference is whether the 3D attributes are still "there but hidden" when is2D is set to true, or whether setting is2D clobbers them.

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