Skip to content

Commit

Permalink
WebKit export: [css-conditional] Negative cqmin/cqmax units are inver…
Browse files Browse the repository at this point in the history
  • Loading branch information
nt1m authored Jan 7, 2025
1 parent b6ca3af commit 906d283
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

function assert_unit_equals(element, actual, expected) {
try {
element.style.padding = actual;
ref.style.padding = expected;
assert_equals(getComputedStyle(element).paddingLeft,
getComputedStyle(ref).paddingLeft);
element.style.margin = actual;
ref.style.margin = expected;
assert_equals(getComputedStyle(element).marginLeft,
getComputedStyle(ref).marginLeft);
} finally {
element.style = '';
ref.style = '';
Expand All @@ -51,6 +51,8 @@
assert_unit_equals(child, '10cqb', '40px');
assert_unit_equals(child, '10cqmin', '10px');
assert_unit_equals(child, '10cqmax', '40px');
assert_unit_equals(child, '-10cqmin', '-10px');
assert_unit_equals(child, '-10cqmax', '-40px');

c3.className = ''; // cqw, cqi now selects c2 instead.
assert_unit_equals(child, '10cqw', '30px');
Expand All @@ -59,6 +61,8 @@
assert_unit_equals(child, '10cqb', '40px');
assert_unit_equals(child, '10cqmin', '30px');
assert_unit_equals(child, '10cqmax', '40px');
assert_unit_equals(child, '-10cqmin', '-30px');
assert_unit_equals(child, '-10cqmax', '-40px');

} finally {
for (let c of [c1, c2, c3, c4, child])
Expand Down

0 comments on commit 906d283

Please sign in to comment.