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

Skip to content

CSS: Add tests for negative padding and borderWidth#5850

Open
sawirricardo wants to merge 1 commit into
jquery:mainfrom
sawirricardo:fix-negative-padding-borderwidth-tests
Open

CSS: Add tests for negative padding and borderWidth#5850
sawirricardo wants to merge 1 commit into
jquery:mainfrom
sawirricardo:fix-negative-padding-borderwidth-tests

Conversation

@sawirricardo

Copy link
Copy Markdown

Summary

Adds test coverage for negative padding and borderWidth values being clipped to zero by setPositiveNumber.

Negative padding and borderWidth values should be clipped to zero (they are not valid CSS). The setPositiveNumber function enforces this via Math.max(0, ...), but there were no explicit tests covering this behavior for padding and border properties.

Test coverage

  • padding-top, padding-right, padding-bottom, padding-left with negative values (-10px, -5px, -1em, -20 numeric)
  • All four border-*-width properties with negative values (-5px)
  • All assertions verify the computed value is clipped to 0px

Closes gh-2700

Negative padding and borderWidth values are clipped to zero by
setPositiveNumber. Add explicit test coverage for this behavior
across all four sides for both padding and borderWidth properties,
including em units and numeric (unitless) values.

Closes jquerygh-2700
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add CSS tests for setting negative padding and borderWidth

1 participant