Commit e0693b41 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Adjust code to look for the HTML element, not the document

This was a mistake in the previous patch. When walking up the DOM tree,
we don't encounter the document object directly (this is different than
the layout tree).

Bug: 1129979

Change-Id: Ib6b7040e2a54658948d0830230d7a8ebeba44b8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446517Reviewed-by: default avatarScott Little <sclittle@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813389}
parent d6161ec0
......@@ -84,12 +84,11 @@ bool IsElementInInvisibleSubTree(const Element& element) {
return true;
for (Node& ancestor : FlatTreeTraversal::InclusiveAncestorsOf(element)) {
auto* ancestor_element = DynamicTo<Element>(ancestor);
if (!ancestor_element) {
// Return true if the whole frame is not rendered.
if (ancestor.IsDocumentNode() && !ancestor.GetLayoutObject())
return true;
if (!ancestor_element)
continue;
}
// Return true if the whole frame is not rendered.
if (ancestor.IsHTMLElement() && !ancestor.GetLayoutObject())
return true;
const ComputedStyle* style = ancestor_element->EnsureComputedStyle();
if (style && (style->Visibility() != EVisibility::kVisible ||
style->Display() == EDisplay::kNone)) {
......
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