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,
bool should_compute_occlusion =
needs_occlusion_tracking &&
occlusion_state == FrameOcclusionState::kGuaranteedNotOccluded &&
parent_lifecycle_state >= DocumentLifecycle::kPrePaintClean &&
RuntimeEnabledFeatures::IntersectionObserverV2Enabled();
parent_lifecycle_state >= DocumentLifecycle::kPrePaintClean;
LayoutEmbeddedContent* owner_layout_object =
owner_element->GetLayoutEmbeddedContent();
......
......@@ -93,7 +93,6 @@ LayoutView* LocalRootView(const LayoutObject& object) {
//
// https://w3c.github.io/IntersectionObserver/v2/#calculate-visibility-algo
bool ComputeIsVisible(const LayoutObject* target, const PhysicalRect& rect) {
DCHECK(RuntimeEnabledFeatures::IntersectionObserverV2Enabled());
if (target->GetDocument().GetFrame()->LocalFrameRoot().GetOcclusionState() !=
FrameOcclusionState::kGuaranteedNotOccluded) {
return false;
......
......@@ -169,20 +169,18 @@ IntersectionObserver* IntersectionObserver::Create(
DOMHighResTimeStamp delay = 0;
bool track_visibility = false;
if (RuntimeEnabledFeatures::IntersectionObserverV2Enabled()) {
delay = observer_init->delay();
track_visibility = observer_init->trackVisibility();
if (track_visibility && delay < 100) {
exception_state.ThrowDOMException(
DOMExceptionCode::kNotSupportedError,
"To enable the 'trackVisibility' option, you must also use a "
"'delay' option with a value of at least 100. Visibility is more "
"expensive to compute than the basic intersection; enabling this "
"option may negatively affect your page's performance. Please make "
"sure you *really* need visibility tracking before enabling the "
"'trackVisibility' option.");
return nullptr;
}
delay = observer_init->delay();
track_visibility = observer_init->trackVisibility();
if (track_visibility && delay < 100) {
exception_state.ThrowDOMException(
DOMExceptionCode::kNotSupportedError,
"To enable the 'trackVisibility' option, you must also use a "
"'delay' option with a value of at least 100. Visibility is more "
"expensive to compute than the basic intersection; enabling this "
"option may negatively affect your page's performance. Please make "
"sure you *really* need visibility tracking before enabling the "
"'trackVisibility' option.");
return nullptr;
}
Vector<Length> root_margin;
......
......@@ -15,8 +15,8 @@ callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry
readonly attribute DOMString rootMargin;
// https://github.com/WICG/IntersectionObserver/issues/114
readonly attribute FrozenArray<double> thresholds;
[RuntimeEnabled=IntersectionObserverV2] readonly attribute DOMHighResTimeStamp delay;
[RuntimeEnabled=IntersectionObserverV2] readonly attribute boolean trackVisibility;
readonly attribute DOMHighResTimeStamp delay;
readonly attribute boolean trackVisibility;
[RaisesException] void observe(Element target);
[RaisesException] void unobserve(Element target);
[RaisesException] void disconnect();
......
......@@ -13,7 +13,7 @@
readonly attribute DOMRectReadOnly boundingClientRect;
readonly attribute DOMRectReadOnly intersectionRect;
readonly attribute boolean isIntersecting;
[RuntimeEnabled=IntersectionObserverV2] readonly attribute boolean isVisible;
readonly attribute boolean isVisible;
readonly attribute double intersectionRatio;
readonly attribute Element target;
};
......@@ -8,6 +8,6 @@ dictionary IntersectionObserverInit {
(Element or Document)? root = null;
DOMString rootMargin = "0px";
(double or sequence<double>) threshold = 0;
[RuntimeEnabled=IntersectionObserverV2] DOMHighResTimeStamp delay = 0;
[RuntimeEnabled=IntersectionObserverV2] boolean trackVisibility = false;
DOMHighResTimeStamp delay = 0;
boolean trackVisibility = false;
};
......@@ -80,11 +80,9 @@ class TestIntersectionObserverDelegate : public IntersectionObserverDelegate {
class IntersectionObserverTest : public SimTest {};
class IntersectionObserverV2Test : public IntersectionObserverTest,
public ScopedIntersectionObserverV2ForTest {
class IntersectionObserverV2Test : public IntersectionObserverTest {
public:
IntersectionObserverV2Test()
: IntersectionObserverTest(), ScopedIntersectionObserverV2ForTest(true) {
IntersectionObserverV2Test() {
IntersectionObserver::SetThrottleDelayEnabledForTesting(false);
}
......
......@@ -899,10 +899,6 @@
name: "IntersectionObserverDocumentScrollingElementRoot",
status: "stable",
},
{
name: "IntersectionObserverV2",
status: "stable",
},
{
// Launched by default. TODO(mythria): cleanup virtual tests and
// 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