Skip to main content

intersection_observer_ctor

Function intersection_observer_ctor 

Source
pub(crate) fn intersection_observer_ctor(
    _it: &mut Interp,
    _t: Value,
    a: &[Value],
) -> Result<Value, Value>
Expand description

new IntersectionObserver(cb, options)の第2引数optionsroot/rootMargin/threshold)が丸ごと無視されており、対応する .root/.rootMargin/.thresholds読み取り専用プロパティも存在しな かった(丸ごと未対応だった。2026-07-17 発見)。実際の交差判定は 「observe時点で常に完全交差」という既存の簡略実装のままだが(root/ thresholdに応じた複数回発火は対象外)、構築時に渡された値を正しく 読み取り専用プロパティとして反映するだけでも、既存コードの if (observer.rootMargin !== '10px') {...}等のフィーチャー検出 イディオムには対応できる。