Skip to content

[css-easings-2] When does a linear() includes a point with a null input? #9289

@cdoublev

Description

@cdoublev

https://drafts.csswg.org/css-easing-2/#create-a-linear-easing-function

  1. For runs of items in function’s points that have a null input, [...]

Can you please add an example when this happens?

I cannot figure it out.
function createLinearEasingFunction(list) {
  const points = []
  const fn = { points }
  let largestInput = -Infinity
  list.forEach((stop, index) => {
    const [progress, time] = stop
    const point = { input: null, output: progress }
    points.push(point)
    if (isOmitted(time)) {
      if (index === 0) {
        point.input = 0
        largestInput = 0
      } else {
        point.input = Math.max(1, largestInput)
      }
      return
    }
    const [start, end] = time
    largestInput = point.input = Math.max(start / 100, largestInput)
    if (end) {
      const input = largestInput = Math.max(end / 100, largestInput)
      const extraPoint = { input, output: progress }
      points.push(extraPoint)
    }
  })
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.css-easing-2Current Work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions