Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export default class JtLinesFallback extends Component {
this.host.className = this.hostClass;
this.#root = this.host.attachShadow({ mode: "closed" });
this.#root.adoptedStyleSheets = [sheet()];
this.#sprite.setAttribute("hidden", "");
// hidden takes no effect on an svg: it would hold 300×150 of room
this.#sprite.style.display = "none";
this.inner.className = "jt-lines";
this.#root.append(this.#sprite, this.inner);
}
Expand Down
7 changes: 7 additions & 0 deletions spec/system/ads_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ def hide_space
"Spring sale",
)
end

# the fallback is the card's size, nothing more
sizes =
page.evaluate_script(
"[#{host}, #{fallback}.querySelector('.jt-lines')].map((el) => el.getBoundingClientRect().height)",
)
expect(sizes[0]).to be_within(1).of(sizes[1])
end

# Nothing outside the root a page rule could name, and a script that
Expand Down
Loading