Commit a205470e authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Retire IntersectionObserverV2 runtime flag

The flag IntersectionObserverV2 has been stable since 2019-01.

Bug: 827639
Change-Id: I31e4e6b5a0cdae99a0a3c56d504a99216cc653b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2208802Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772052}
parent 41e72abe
...@@ -64,8 +64,7 @@ bool FrameView::UpdateViewportIntersection(unsigned flags, ...@@ -64,8 +64,7 @@ bool FrameView::UpdateViewportIntersection(unsigned flags,
bool should_compute_occlusion = bool should_compute_occlusion =
needs_occlusion_tracking && needs_occlusion_tracking &&
occlusion_state == FrameOcclusionState::kGuaranteedNotOccluded && occlusion_state == FrameOcclusionState::kGuaranteedNotOccluded &&
parent_lifecycle_state >= DocumentLifecycle::kPrePaintClean && parent_lifecycle_state >= DocumentLifecycle::kPrePaintClean;
RuntimeEnabledFeatures::IntersectionObserverV2Enabled();
LayoutEmbeddedContent* owner_layout_object = LayoutEmbeddedContent* owner_layout_object =
owner_element->GetLayoutEmbeddedContent(); owner_element->GetLayoutEmbeddedContent();
......
...@@ -93,7 +93,6 @@ LayoutView* LocalRootView(const LayoutObject& object) { ...@@ -93,7 +93,6 @@ LayoutView* LocalRootView(const LayoutObject& object) {
// //
// https://w3c.github.io/IntersectionObserver/v2/#calculate-visibility-algo // https://w3c.github.io/IntersectionObserver/v2/#calculate-visibility-algo
bool ComputeIsVisible(const LayoutObject* target, const PhysicalRect& rect) { bool ComputeIsVisible(const LayoutObject* target, const PhysicalRect& rect) {
DCHECK(RuntimeEnabledFeatures::IntersectionObserverV2Enabled());
if (target->GetDocument().GetFrame()->LocalFrameRoot().GetOcclusionState() != if (target->GetDocument().GetFrame()->LocalFrameRoot().GetOcclusionState() !=
FrameOcclusionState::kGuaranteedNotOccluded) { FrameOcclusionState::kGuaranteedNotOccluded) {
return false; return false;
......
...@@ -169,20 +169,18 @@ IntersectionObserver* IntersectionObserver::Create( ...@@ -169,20 +169,18 @@ IntersectionObserver* IntersectionObserver::Create(
DOMHighResTimeStamp delay = 0; DOMHighResTimeStamp delay = 0;
bool track_visibility = false; bool track_visibility = false;
if (RuntimeEnabledFeatures::IntersectionObserverV2Enabled()) { delay = observer_init->delay();
delay = observer_init->delay(); track_visibility = observer_init->trackVisibility();
track_visibility = observer_init->trackVisibility(); if (track_visibility && delay < 100) {
if (track_visibility && delay < 100) { exception_state.ThrowDOMException(
exception_state.ThrowDOMException( DOMExceptionCode::kNotSupportedError,
DOMExceptionCode::kNotSupportedError, "To enable the 'trackVisibility' option, you must also use a "
"To enable the 'trackVisibility' option, you must also use a " "'delay' option with a value of at least 100. Visibility is more "
"'delay' option with a value of at least 100. Visibility is more " "expensive to compute than the basic intersection; enabling this "
"expensive to compute than the basic intersection; enabling this " "option may negatively affect your page's performance. Please make "
"option may negatively affect your page's performance. Please make " "sure you *really* need visibility tracking before enabling the "
"sure you *really* need visibility tracking before enabling the " "'trackVisibility' option.");
"'trackVisibility' option."); return nullptr;
return nullptr;
}
} }
Vector<Length> root_margin; Vector<Length> root_margin;
......
...@@ -15,8 +15,8 @@ callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry ...@@ -15,8 +15,8 @@ callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry
readonly attribute DOMString rootMargin; readonly attribute DOMString rootMargin;
// https://github.com/WICG/IntersectionObserver/issues/114 // https://github.com/WICG/IntersectionObserver/issues/114
readonly attribute FrozenArray<double> thresholds; readonly attribute FrozenArray<double> thresholds;
[RuntimeEnabled=IntersectionObserverV2] readonly attribute DOMHighResTimeStamp delay; readonly attribute DOMHighResTimeStamp delay;
[RuntimeEnabled=IntersectionObserverV2] readonly attribute boolean trackVisibility; readonly attribute boolean trackVisibility;
[RaisesException] void observe(Element target); [RaisesException] void observe(Element target);
[RaisesException] void unobserve(Element target); [RaisesException] void unobserve(Element target);
[RaisesException] void disconnect(); [RaisesException] void disconnect();
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
readonly attribute DOMRectReadOnly boundingClientRect; readonly attribute DOMRectReadOnly boundingClientRect;
readonly attribute DOMRectReadOnly intersectionRect; readonly attribute DOMRectReadOnly intersectionRect;
readonly attribute boolean isIntersecting; readonly attribute boolean isIntersecting;
[RuntimeEnabled=IntersectionObserverV2] readonly attribute boolean isVisible; readonly attribute boolean isVisible;
readonly attribute double intersectionRatio; readonly attribute double intersectionRatio;
readonly attribute Element target; readonly attribute Element target;
}; };
...@@ -8,6 +8,6 @@ dictionary IntersectionObserverInit { ...@@ -8,6 +8,6 @@ dictionary IntersectionObserverInit {
(Element or Document)? root = null; (Element or Document)? root = null;
DOMString rootMargin = "0px"; DOMString rootMargin = "0px";
(double or sequence<double>) threshold = 0; (double or sequence<double>) threshold = 0;
[RuntimeEnabled=IntersectionObserverV2] DOMHighResTimeStamp delay = 0; DOMHighResTimeStamp delay = 0;
[RuntimeEnabled=IntersectionObserverV2] boolean trackVisibility = false; boolean trackVisibility = false;
}; };
...@@ -80,11 +80,9 @@ class TestIntersectionObserverDelegate : public IntersectionObserverDelegate { ...@@ -80,11 +80,9 @@ class TestIntersectionObserverDelegate : public IntersectionObserverDelegate {
class IntersectionObserverTest : public SimTest {}; class IntersectionObserverTest : public SimTest {};
class IntersectionObserverV2Test : public IntersectionObserverTest, class IntersectionObserverV2Test : public IntersectionObserverTest {
public ScopedIntersectionObserverV2ForTest {
public: public:
IntersectionObserverV2Test() IntersectionObserverV2Test() {
: IntersectionObserverTest(), ScopedIntersectionObserverV2ForTest(true) {
IntersectionObserver::SetThrottleDelayEnabledForTesting(false); IntersectionObserver::SetThrottleDelayEnabledForTesting(false);
} }
......
...@@ -899,10 +899,6 @@ ...@@ -899,10 +899,6 @@
name: "IntersectionObserverDocumentScrollingElementRoot", name: "IntersectionObserverDocumentScrollingElementRoot",
status: "stable", status: "stable",
}, },
{
name: "IntersectionObserverV2",
status: "stable",
},
{ {
// Launched by default. TODO(mythria): cleanup virtual tests and // Launched by default. TODO(mythria): cleanup virtual tests and
// other hooks in blink. // other hooks in blink.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment