Exclude hidden posts from page search #1544
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This... makes me uncomfortable.
It uses the css
content
property to replace the contents of cell elements we want to hide with a no-op (which must be an image, as it's the only supported value for this value on non-pseudo elements at the moment). This removes the need to target the child element(s) withdisplay: none
, and thus works correctly when the content we want to hide is or contains a text node which cannot be targeted by CSS. (In the case of the linked issue, this is the text that makes offscreen posts searchable via control-F.)We cannot simply
display: none
the target elements themselves, as we need them to continue to be rendered and have bounding boxes so that observers targeting them continue to work.Not entirely sure where the height comes from if you remove
height: 0
; a linear gradient has no intrinsic height. I guess there's a default height?Resolves #1543.
Using a gradient as an element content replacement supposedly requires Firefox 113, per MDN/caniuse. Show Originals smoke tested in Firefox 126, Chrome 126, and desktop Safari 17.4.1 (there's some jank when switching Show Originals on or off and then scrolling into a previously loaded area, but I believe that's the case with or without this PR and is due to Virtual Scroller Things™).
Testing steps