diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-03-12 09:13:00 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-03-16 09:58:26 +0000 |
commit | 03561cae90f1d99b5c54b1ef3be69f10e882b25e (patch) | |
tree | cc5f0958e823c044e7ae51cc0117fe51432abe5e /chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc | |
parent | fa98118a45f7e169f8846086dc2c22c49a8ba310 (diff) | |
download | qtwebengine-chromium-03561cae90f1d99b5c54b1ef3be69f10e882b25e.tar.gz |
BASELINE: Update Chromium to 88.0.4324.208
Change-Id: I3ae87d23e4eff4b4a469685658740a213600c667
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@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 | 66 |
1 files changed, 36 insertions, 30 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 fe5931f3544..a84ae32eb78 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 @@ -50,7 +50,6 @@ #include "third_party/blink/renderer/core/layout/list_marker.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_fragment_item.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/inline/ng_text_fragment.h" #include "third_party/blink/renderer/core/layout/ng/list/layout_ng_list_item.h" #include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_image.h" @@ -134,10 +133,11 @@ void LayoutTreeAsText::WriteLayoutObject(WTF::TextStream& ts, ts << " " << rect; if (!(o.IsText() && !o.IsBR())) { - if (o.IsFileUploadControl()) + if (o.IsFileUploadControl()) { ts << " " << QuoteAndEscapeNonPrintables( - ToLayoutFileUploadControl(&o)->FileTextValue()); + To<LayoutFileUploadControl>(o).FileTextValue()); + } if (o.Parent()) { Color color = o.ResolveColor(GetCSSPropertyColor()); @@ -175,7 +175,7 @@ void LayoutTreeAsText::WriteLayoutObject(WTF::TextStream& ts, if (!o.IsBoxModelObject()) return; - const LayoutBoxModelObject& box = ToLayoutBoxModelObject(o); + const auto& box = To<LayoutBoxModelObject>(o); if (box.BorderTop() || box.BorderRight() || box.BorderBottom() || box.BorderLeft()) { ts << " [border:"; @@ -235,7 +235,7 @@ void LayoutTreeAsText::WriteLayoutObject(WTF::TextStream& ts, if (o.IsDetailsMarker()) { ts << ": "; - switch (ToLayoutDetailsMarker(&o)->GetOrientation()) { + switch (To<LayoutDetailsMarker>(o).GetOrientation()) { case LayoutDetailsMarker::kLeft: ts << "left"; break; @@ -252,7 +252,7 @@ void LayoutTreeAsText::WriteLayoutObject(WTF::TextStream& ts, } if (o.IsListMarkerForNormalContent()) { - String text = ToLayoutListMarker(o).GetText(); + String text = To<LayoutListMarker>(o).GetText(); if (!text.IsEmpty()) { if (text.length() != 1) { text = QuoteAndEscapeNonPrintables(text); @@ -453,8 +453,8 @@ static void WriteTextFragment(WTF::TextStream& ts, DynamicTo<NGPhysicalTextFragment>(paint_fragment->PhysicalFragment()); if (!physical_text_fragment) return; - const NGTextFragment fragment(paint_fragment->Style().GetWritingMode(), - *physical_text_fragment); + const NGFragment fragment(paint_fragment->Style().GetWritingDirection(), + *physical_text_fragment); WriteTextFragment(ts, paint_fragment->GetLayoutObject(), paint_fragment->RectInContainerBlock(), paint_fragment->Style(), physical_text_fragment->Text(), @@ -501,7 +501,7 @@ void Write(WTF::TextStream& ts, int indent, LayoutAsTextBehavior behavior) { if (o.IsSVGShape()) { - Write(ts, ToLayoutSVGShape(o), indent); + Write(ts, To<LayoutSVGShape>(o), indent); return; } if (o.IsSVGResourceContainer()) { @@ -513,23 +513,23 @@ void Write(WTF::TextStream& ts, return; } if (o.IsSVGRoot()) { - Write(ts, ToLayoutSVGRoot(o), indent); + Write(ts, To<LayoutSVGRoot>(o), indent); return; } if (o.IsSVGText()) { - WriteSVGText(ts, ToLayoutSVGText(o), indent); + WriteSVGText(ts, To<LayoutSVGText>(o), indent); return; } if (o.IsSVGInline()) { - WriteSVGInline(ts, ToLayoutSVGInline(o), indent); + WriteSVGInline(ts, To<LayoutSVGInline>(o), indent); return; } if (o.IsSVGInlineText()) { - WriteSVGInlineText(ts, ToLayoutSVGInlineText(o), indent); + WriteSVGInlineText(ts, To<LayoutSVGInlineText>(o), indent); return; } if (o.IsSVGImage()) { - WriteSVGImage(ts, ToLayoutSVGImage(o), indent); + WriteSVGImage(ts, To<LayoutSVGImage>(o), indent); return; } @@ -548,7 +548,7 @@ void Write(WTF::TextStream& ts, } if (o.IsText() && !o.IsBR()) { - const LayoutText& text = ToLayoutText(o); + const auto& text = To<LayoutText>(o); if (const LayoutBlockFlow* block_flow = text.ContainingNGBlockFlow()) { NGInlineCursor cursor(*block_flow); cursor.MoveTo(text); @@ -573,7 +573,7 @@ void Write(WTF::TextStream& ts, } if (o.IsLayoutEmbeddedContent()) { - FrameView* frame_view = ToLayoutEmbeddedContent(o).ChildFrameView(); + FrameView* frame_view = To<LayoutEmbeddedContent>(o).ChildFrameView(); if (auto* local_frame_view = DynamicTo<LocalFrameView>(frame_view)) { if (auto* layout_view = local_frame_view->GetLayoutView()) { layout_view->GetDocument().UpdateStyleAndLayout( @@ -729,8 +729,8 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts, : layer->IntersectsDamageRect(layer_bounds, damage_rect.Rect(), offset_from_root); - if (layer->GetLayoutObject().IsLayoutEmbeddedContent() && - ToLayoutEmbeddedContent(layer->GetLayoutObject()).IsThrottledFrameView()) + auto* embedded = DynamicTo<LayoutEmbeddedContent>(layer->GetLayoutObject()); + if (embedded && embedded->IsThrottledFrameView()) should_paint = false; #if DCHECK_IS_ON() @@ -758,8 +758,10 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts, 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); + for (auto* child_layer : neg_list) { + WriteLayers(ts, root_layer, child_layer, curr_indent, behavior, + marked_layer); + } } if (should_paint) { @@ -778,8 +780,10 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts, 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); + for (auto* child_layer : normal_flow_list) { + WriteLayers(ts, root_layer, child_layer, curr_indent, behavior, + marked_layer); + } } const auto& pos_list = ChildLayers(layer, kPositiveZOrderChildren); @@ -790,8 +794,10 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts, 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); + for (auto* child_layer : pos_list) { + WriteLayers(ts, root_layer, child_layer, curr_indent, behavior, + marked_layer); + } } } @@ -880,7 +886,7 @@ String ExternalRepresentation(LocalFrame* frame, LayoutObject* layout_object = frame->ContentLayoutObject(); if (!layout_object || !layout_object->IsBox()) return String(); - LayoutBox* layout_box = ToLayoutBox(layout_object); + auto* layout_box = To<LayoutBox>(layout_object); PrintContext print_context(frame, /*use_printing_layout=*/true); bool is_text_printing_mode = !!(behavior & kLayoutAsTextPrintingMode); @@ -894,8 +900,8 @@ String ExternalRepresentation(LocalFrame* frame, frame->View()->UpdateLifecyclePhasesForPrinting(); } - String representation = ExternalRepresentation(ToLayoutBox(layout_object), - behavior, marked_layer); + String representation = + ExternalRepresentation(layout_box, behavior, marked_layer); if (is_text_printing_mode) print_context.EndPrintMode(); return representation; @@ -912,7 +918,7 @@ String ExternalRepresentation(Element* element, LayoutAsTextBehavior behavior) { if (!layout_object || !layout_object->IsBox()) return String(); - return ExternalRepresentation(ToLayoutBox(layout_object), + return ExternalRepresentation(To<LayoutBox>(layout_object), behavior | kLayoutAsTextShowAllLayers); } @@ -925,7 +931,7 @@ static void WriteCounterValuesFromChildren(WTF::TextStream& stream, if (!is_first_counter) stream << " "; is_first_counter = false; - String str(ToLayoutText(child)->GetText()); + String str(To<LayoutText>(child)->GetText()); stream << str; } } @@ -956,7 +962,7 @@ String MarkerTextForListItem(Element* element) { if (ListMarker* list_marker = ListMarker::Get(marker)) return list_marker->MarkerTextWithoutSuffix(*marker); if (marker && marker->IsListMarkerForNormalContent()) - return ToLayoutListMarker(marker)->GetText(); + return To<LayoutListMarker>(marker)->GetText(); return String(); } |