summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-08-28 15:28:34 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-08-28 13:54:51 +0000
commit2a19c63448c84c1805fb1a585c3651318bb86ca7 (patch)
treeeb17888e8531aa6ee5e85721bd553b832a7e5156 /chromium/third_party/blink/renderer/core/layout/layout_tree_as_text.cc
parentb014812705fc80bff0a5c120dfcef88f349816dc (diff)
downloadqtwebengine-chromium-2a19c63448c84c1805fb1a585c3651318bb86ca7.tar.gz
BASELINE: Update Chromium to 69.0.3497.70
Change-Id: I2b7b56e4e7a8b26656930def0d4575dc32b900a0 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.cc116
1 files changed, 63 insertions, 53 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 f7d8c402de2..f589fe02384 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
@@ -59,6 +59,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_scrollable_area.h"
#include "third_party/blink/renderer/platform/layout_unit.h"
#include "third_party/blink/renderer/platform/wtf/hex_number.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
@@ -628,10 +629,10 @@ static void Write(WTF::TextStream& ts,
ts << " transparent";
if (layer.GetLayoutObject().HasOverflowClip()) {
- ScrollableArea* scrollable_area = layer.GetScrollableArea();
+ PaintLayerScrollableArea* scrollable_area = layer.GetScrollableArea();
ScrollOffset adjusted_scroll_offset =
scrollable_area->GetScrollOffset() +
- ToFloatSize(scrollable_area->ScrollOrigin());
+ ToFloatSize(FloatPoint(scrollable_area->ScrollOrigin()));
if (adjusted_scroll_offset.Width())
ts << " scrollX " << adjusted_scroll_offset.Width();
if (adjusted_scroll_offset.Height())
@@ -680,12 +681,14 @@ static void Write(WTF::TextStream& ts,
Write(ts, layer.GetLayoutObject(), indent + 1, behavior);
}
-static Vector<PaintLayerStackingNode*> NormalFlowListFor(
+static PaintLayerStackingNode::PaintLayers NormalFlowListFor(
PaintLayerStackingNode* node) {
- PaintLayerStackingNodeIterator it(*node, kNormalFlowChildren);
- Vector<PaintLayerStackingNode*> vector;
- while (PaintLayerStackingNode* normal_flow_child = it.Next())
- vector.push_back(normal_flow_child);
+ PaintLayerStackingNode::PaintLayers vector;
+ if (node) {
+ PaintLayerStackingNodeIterator it(*node, kNormalFlowChildren);
+ while (PaintLayer* normal_flow_child = it.Next())
+ vector.push_back(normal_flow_child);
+ }
return vector;
}
@@ -701,12 +704,9 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts,
ClipRect damage_rect, clip_rect_to_apply;
layer->Clipper(PaintLayer::kUseGeometryMapper)
.CalculateRects(ClipRectsContext(root_layer, kUncachedClipRects),
- &layer->GetLayoutObject().FirstFragment(), paint_rect,
+ &layer->GetLayoutObject().FirstFragment(), &paint_rect,
layer_bounds, damage_rect, clip_rect_to_apply);
- // Ensure our lists are up to date.
- layer->StackingNode()->UpdateLayerListsIfNeeded();
-
LayoutPoint offset_from_root;
layer->ConvertToLayerCoords(root_layer, offset_from_root);
bool should_paint =
@@ -726,58 +726,68 @@ void LayoutTreeAsText::WriteLayers(WTF::TextStream& ts,
}
#endif
- Vector<PaintLayerStackingNode*>* neg_list =
- layer->StackingNode()->NegZOrderList();
- bool 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);
-
- if (neg_list) {
- int curr_indent = indent;
- if (behavior & kLayoutAsTextShowLayerNesting) {
- WriteIndent(ts, indent);
- ts << " negative z-order list(" << neg_list->size() << ")\n";
- ++curr_indent;
+ 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);
+ }
+
+ 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), paint_rect, curr_indent,
+ behavior, marked_layer);
+ }
}
- for (unsigned i = 0; i != neg_list->size(); ++i)
- WriteLayers(ts, root_layer, neg_list->at(i)->Layer(), paint_rect,
- curr_indent, behavior, marked_layer);
}
- if (should_paint)
+ if (should_paint) {
Write(ts, *layer, layer_bounds, damage_rect.Rect(),
clip_rect_to_apply.Rect(),
paints_background_separately ? kLayerPaintPhaseForeground
: kLayerPaintPhaseAll,
indent, behavior, marked_layer);
+ }
- Vector<PaintLayerStackingNode*> 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;
+ 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), paint_rect,
+ curr_indent, behavior, marked_layer);
+ }
}
- for (unsigned i = 0; i != normal_flow_list.size(); ++i)
- WriteLayers(ts, root_layer, normal_flow_list.at(i)->Layer(), paint_rect,
- curr_indent, behavior, marked_layer);
- }
-
- if (Vector<PaintLayerStackingNode*>* 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;
+
+ 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), paint_rect, curr_indent,
+ behavior, marked_layer);
+ }
}
- for (unsigned i = 0; i != pos_list->size(); ++i)
- WriteLayers(ts, root_layer, pos_list->at(i)->Layer(), paint_rect,
- curr_indent, behavior, marked_layer);
}
}
@@ -861,7 +871,7 @@ String ExternalRepresentation(LocalFrame* frame,
LayoutAsTextBehavior behavior,
const PaintLayer* marked_layer) {
if (!(behavior & kLayoutAsTextDontUpdateLayout)) {
- bool success = frame->View()->UpdateLifecycleToPrePaintClean();
+ bool success = frame->View()->UpdateAllLifecyclePhasesExceptPaint();
DCHECK(success);
};