Skip to content

Commit 9452d1d

Browse files
committed
refactor(registry): restore a lifted visibility in one call and lift any hidden form
1 parent 2b266f3 commit 9452d1d

6 files changed

Lines changed: 11 additions & 16 deletions

File tree

‎packages/cli/src/registry/motionBlurShutter.browser.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function makeTimeline(onTo?: () => void): Fake {
116116
return { tl, currentTime: () => now, fire: () => onUpdate?.(), trackers: () => trackers };
117117
}
118118

119-
/** What the browser resolves for the target: the marker's !important rule wins, else the inline value. */
119+
/** What the browser resolves for the target: an inline !important, else the marker's rule, else the inline value. */
120120
function wordVisibility(word: Element): string {
121121
const style = (word as HTMLElement).style;
122122
if (style.getPropertyPriority("visibility") === "important") return style.visibility;

‎registry/blocks/gooey-split/gooey-split.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,12 @@
351351
function snapshot() {
352352
// Read a target hidden right now (an autoAlpha entrance) as shown, so a descendant
353353
// hidden by its own rule still differs from it; the inline value goes back exactly.
354-
var hidden = getComputedStyle(el).visibility === "hidden";
354+
var hidden = getComputedStyle(el).visibility !== "visible";
355355
var inline = el.style.getPropertyValue("visibility");
356356
var priority = el.style.getPropertyPriority("visibility");
357357
if (hidden) el.style.setProperty("visibility", "visible", "important");
358358
var styles = resolvedStyles(el, []);
359-
if (hidden && inline) el.style.setProperty("visibility", inline, priority);
360-
else if (hidden) el.style.removeProperty("visibility");
359+
if (hidden) el.style.setProperty("visibility", inline, priority);
361360
s.perspective = parentPerspective(el);
362361
for (var c = 0; c < clones.length; c++) {
363362
paintResolvedStyles(clones[c], styles, { i: 0 });

‎registry/components/motion-blur/demo.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,12 @@
473473
function snapshot() {
474474
// Read a target hidden right now (an autoAlpha entrance) as shown, so a descendant
475475
// hidden by its own rule still differs from it; the inline value goes back exactly.
476-
var hidden = getComputedStyle(el).visibility === "hidden";
476+
var hidden = getComputedStyle(el).visibility !== "visible";
477477
var inline = el.style.getPropertyValue("visibility");
478478
var priority = el.style.getPropertyPriority("visibility");
479479
if (hidden) el.style.setProperty("visibility", "visible", "important");
480480
var styles = resolvedStyles(el, []);
481-
if (hidden && inline) el.style.setProperty("visibility", inline, priority);
482-
else if (hidden) el.style.removeProperty("visibility");
481+
if (hidden) el.style.setProperty("visibility", inline, priority);
483482
s.perspective = parentPerspective(el);
484483
for (var c = 0; c < clones.length; c++) {
485484
paintResolvedStyles(clones[c], styles, { i: 0 });

‎registry/components/motion-blur/motion-blur.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,12 @@
342342
function snapshot() {
343343
// Read a target hidden right now (an autoAlpha entrance) as shown, so a descendant
344344
// hidden by its own rule still differs from it; the inline value goes back exactly.
345-
var hidden = getComputedStyle(el).visibility === "hidden";
345+
var hidden = getComputedStyle(el).visibility !== "visible";
346346
var inline = el.style.getPropertyValue("visibility");
347347
var priority = el.style.getPropertyPriority("visibility");
348348
if (hidden) el.style.setProperty("visibility", "visible", "important");
349349
var styles = resolvedStyles(el, []);
350-
if (hidden && inline) el.style.setProperty("visibility", inline, priority);
351-
else if (hidden) el.style.removeProperty("visibility");
350+
if (hidden) el.style.setProperty("visibility", inline, priority);
352351
s.perspective = parentPerspective(el);
353352
for (var c = 0; c < clones.length; c++) {
354353
paintResolvedStyles(clones[c], styles, { i: 0 });

‎registry/components/shutter-slam/demo.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,12 @@
303303
function snapshot() {
304304
// Read a target hidden right now (an autoAlpha entrance) as shown, so a descendant
305305
// hidden by its own rule still differs from it; the inline value goes back exactly.
306-
var hidden = getComputedStyle(el).visibility === "hidden";
306+
var hidden = getComputedStyle(el).visibility !== "visible";
307307
var inline = el.style.getPropertyValue("visibility");
308308
var priority = el.style.getPropertyPriority("visibility");
309309
if (hidden) el.style.setProperty("visibility", "visible", "important");
310310
var styles = resolvedStyles(el, []);
311-
if (hidden && inline) el.style.setProperty("visibility", inline, priority);
312-
else if (hidden) el.style.removeProperty("visibility");
311+
if (hidden) el.style.setProperty("visibility", inline, priority);
313312
s.perspective = parentPerspective(el);
314313
for (var c = 0; c < clones.length; c++) {
315314
paintResolvedStyles(clones[c], styles, { i: 0 });

‎registry/components/shutter-slam/shutter-slam.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,12 @@
337337
function snapshot() {
338338
// Read a target hidden right now (an autoAlpha entrance) as shown, so a descendant
339339
// hidden by its own rule still differs from it; the inline value goes back exactly.
340-
var hidden = getComputedStyle(el).visibility === "hidden";
340+
var hidden = getComputedStyle(el).visibility !== "visible";
341341
var inline = el.style.getPropertyValue("visibility");
342342
var priority = el.style.getPropertyPriority("visibility");
343343
if (hidden) el.style.setProperty("visibility", "visible", "important");
344344
var styles = resolvedStyles(el, []);
345-
if (hidden && inline) el.style.setProperty("visibility", inline, priority);
346-
else if (hidden) el.style.removeProperty("visibility");
345+
if (hidden) el.style.setProperty("visibility", inline, priority);
347346
s.perspective = parentPerspective(el);
348347
for (var c = 0; c < clones.length; c++) {
349348
paintResolvedStyles(clones[c], styles, { i: 0 });

0 commit comments

Comments
 (0)