Skip to content

Should IOv2 expose more details about why a target isn't visible for same-document case? #3

@szager-chromium

Description

@szager-chromium

If IOv2 is used in a cross-origin iframe, then for privacy/security reasons, we probably can't be any more specific than a simple boolean isVisible flag.

But for the same-origin or same-document case -- where the full DOM is available to script to analyze -- then the privacy and security concerns don't really hold. This is similar to the handling of the rootBounds field of IntersectionObserverEntry.

In the same-origin/same-document case, it may be useful to provide more detailed information about why a target is reported as not visible. This could be, e.g., an enum:

enum VisibilityCheckFailureReason {
kOccluded,
kOpacity,
kTransform,
kFilter
};

We could also provide the Element (or one of the Elements) that occludes the target.

I have heard interest in this feature primarily from ad networks, who typically have their code injected into the top-level browsing context. In that situation, the ad network code doesn't know anything about the host page, and they would like to be able to use IOv2 to identify when pages inadvertently occlude or visually distort ads, for the purpose of working with the publisher to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions