diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) | |
download | qtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc | 126 |
1 files changed, 58 insertions, 68 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc b/chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc index a7ee036bf62..9c20cd4198a 100644 --- a/chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc +++ b/chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc @@ -26,6 +26,7 @@ #include "third_party/blink/renderer/core/layout/layout_tree_as_text.h" #include "third_party/blink/renderer/core/css/css_property_value_set.h" +#include "third_party/blink/renderer/core/display_lock/display_lock_context.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/editing/frame_selection.h" @@ -59,6 +60,7 @@ #include "third_party/blink/renderer/core/page/print_context.h" #include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" +#include "third_party/blink/renderer/core/paint/paint_layer_paint_order_iterator.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" #include "third_party/blink/renderer/platform/wtf/text/character_names.h" @@ -303,18 +305,16 @@ void LayoutTreeAsText::WriteLayoutObject(WTF::TextStream& ts, } if (behavior & kLayoutAsTextShowIDAndClass) { - Node* node = o.GetNode(); - if (node && node->IsElementNode()) { - Element& element = ToElement(*node); - if (element.HasID()) - ts << " id=\"" + element.GetIdAttribute() + "\""; + if (auto* element = DynamicTo<Element>(o.GetNode())) { + if (element->HasID()) + ts << " id=\"" + element->GetIdAttribute() + "\""; - if (element.HasClass()) { + if (element->HasClass()) { ts << " class=\""; - for (wtf_size_t i = 0; i < element.ClassNames().size(); ++i) { + for (wtf_size_t i = 0; i < element->ClassNames().size(); ++i) { if (i > 0) ts << " "; - ts << element.ClassNames()[i]; + ts << element->ClassNames()[i]; } ts << "\""; } @@ -357,6 +357,9 @@ void LayoutTreeAsText::WriteLayoutObject(WTF::TextStream& ts, if (needs_layout) ts << ")"; } + + if (o.LayoutBlockedByDisplayLock(DisplayLockContext::kChildren)) + ts << " (display-locked)"; } static void WriteInlineBox(WTF::TextStream& ts, @@ -569,11 +572,13 @@ void Write(WTF::TextStream& ts, } } - for (LayoutObject* child = o.SlowFirstChild(); child; - child = child->NextSibling()) { - if (child->HasLayer()) - continue; - Write(ts, *child, indent + 1, behavior); + if (!o.LayoutBlockedByDisplayLock(DisplayLockContext::kChildren)) { + for (LayoutObject* child = o.SlowFirstChild(); child; + child = child->NextSibling()) { + if (child->HasLayer()) + continue; + Write(ts, *child, indent + 1, behavior); + } } if (o.IsLayoutEmbeddedContent()) { @@ -689,14 +694,12 @@ static void Write(WTF::TextStream& ts, Write(ts, layer.GetLayoutObject(), indent + 1, behavior); } -static PaintLayerStackingNode::PaintLayers NormalFlowListFor( - PaintLayerStackingNode* node) { - PaintLayerStackingNode::PaintLayers vector; - if (node) { - PaintLayerStackingNodeIterator it(*node, kNormalFlowChildren); - while (PaintLayer* normal_flow_child = it.Next()) - vector.push_back(normal_flow_child); - } +static Vector<PaintLayer*> ChildLayers(const PaintLayer* layer, + PaintLayerIteration which_children) { + Vector<PaintLayer*> vector; + PaintLayerPaintOrderIterator it(*layer, which_children); + while (PaintLayer* child = it.Next()) + vector.push_back(child); return vector; } @@ -743,29 +746,23 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts, } #endif - bool paints_background_separately = false; - if (layer->StackingNode()) { - PaintLayerStackingNode::PaintLayers* neg_list = - layer->StackingNode()->NegZOrderList(); - paints_background_separately = neg_list && neg_list->size() > 0; - if (should_paint && paints_background_separately) { - Write(ts, *layer, layer_bounds, damage_rect.Rect(), - clip_rect_to_apply.Rect(), kLayerPaintPhaseBackground, indent, - behavior, marked_layer); - } + const auto& neg_list = ChildLayers(layer, kNegativeZOrderChildren); + bool paints_background_separately = !neg_list.IsEmpty(); + if (should_paint && paints_background_separately) { + Write(ts, *layer, layer_bounds, damage_rect.Rect(), + clip_rect_to_apply.Rect(), kLayerPaintPhaseBackground, indent, + behavior, marked_layer); + } - if (neg_list) { - int curr_indent = indent; - if (behavior & kLayoutAsTextShowLayerNesting) { - WriteIndent(ts, indent); - ts << " negative z-order list(" << neg_list->size() << ")\n"; - ++curr_indent; - } - for (unsigned i = 0; i != neg_list->size(); ++i) { - WriteLayers(ts, root_layer, neg_list->at(i), curr_indent, behavior, - marked_layer); - } + if (!neg_list.IsEmpty()) { + int curr_indent = indent; + if (behavior & kLayoutAsTextShowLayerNesting) { + WriteIndent(ts, indent); + ts << " negative z-order list(" << neg_list.size() << ")\n"; + ++curr_indent; } + for (auto* layer : neg_list) + WriteLayers(ts, root_layer, layer, curr_indent, behavior, marked_layer); } if (should_paint) { @@ -776,35 +773,28 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts, indent, behavior, marked_layer); } - if (layer->StackingNode()) { - PaintLayerStackingNode::PaintLayers normal_flow_list = - NormalFlowListFor(layer->StackingNode()); - if (!normal_flow_list.IsEmpty()) { - int curr_indent = indent; - if (behavior & kLayoutAsTextShowLayerNesting) { - WriteIndent(ts, indent); - ts << " normal flow list(" << normal_flow_list.size() << ")\n"; - ++curr_indent; - } - for (unsigned i = 0; i != normal_flow_list.size(); ++i) { - WriteLayers(ts, root_layer, normal_flow_list.at(i), curr_indent, - behavior, marked_layer); - } + const auto& normal_flow_list = ChildLayers(layer, kNormalFlowChildren); + if (!normal_flow_list.IsEmpty()) { + int curr_indent = indent; + if (behavior & kLayoutAsTextShowLayerNesting) { + WriteIndent(ts, indent); + ts << " normal flow list(" << normal_flow_list.size() << ")\n"; + ++curr_indent; } + for (auto* layer : normal_flow_list) + WriteLayers(ts, root_layer, layer, curr_indent, behavior, marked_layer); + } - if (PaintLayerStackingNode::PaintLayers* pos_list = - layer->StackingNode()->PosZOrderList()) { - int curr_indent = indent; - if (behavior & kLayoutAsTextShowLayerNesting) { - WriteIndent(ts, indent); - ts << " positive z-order list(" << pos_list->size() << ")\n"; - ++curr_indent; - } - for (unsigned i = 0; i != pos_list->size(); ++i) { - WriteLayers(ts, root_layer, pos_list->at(i), curr_indent, behavior, - marked_layer); - } + const auto& pos_list = ChildLayers(layer, kPositiveZOrderChildren); + if (!pos_list.IsEmpty()) { + int curr_indent = indent; + if (behavior & kLayoutAsTextShowLayerNesting) { + WriteIndent(ts, indent); + ts << " positive z-order list(" << pos_list.size() << ")\n"; + ++curr_indent; } + for (auto* layer : pos_list) + WriteLayers(ts, root_layer, layer, curr_indent, behavior, marked_layer); } } |