Commit f2cad857 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Adjust DCHECK to include inactive documents for scrollingElement.

The DCHECK already covers the stopped/stopping states, so the only states it
doesn't cover are kInactive and kUninitialized. Since JS is calling
this API, the kUninitialized state is impossible. So the only state that
this occurs in is kInactive. The method can return null in quirks mode
so adjusting the DCHECK for inactive documents seems best.

BUG=1020787, 1002472

Change-Id: Ief51eb7783ea7ed506107646a258f24e274127b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902007
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713427}
parent 23628a6f
...@@ -2048,7 +2048,8 @@ Element* Document::scrollingElement() { ...@@ -2048,7 +2048,8 @@ Element* Document::scrollingElement() {
Element* Document::ScrollingElementNoLayout() { Element* Document::ScrollingElementNoLayout() {
if (RuntimeEnabledFeatures::ScrollTopLeftInteropEnabled()) { if (RuntimeEnabledFeatures::ScrollTopLeftInteropEnabled()) {
if (InQuirksMode()) { if (InQuirksMode()) {
DCHECK(lifecycle_.GetState() >= DocumentLifecycle::kStyleClean); DCHECK(!IsActive() ||
lifecycle_.GetState() >= DocumentLifecycle::kStyleClean);
HTMLBodyElement* body = FirstBodyElement(); HTMLBodyElement* body = FirstBodyElement();
if (body && body->GetLayoutObject() && if (body && body->GetLayoutObject() &&
body->GetLayoutObject()->HasOverflowClip()) body->GetLayoutObject()->HasOverflowClip())
......
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