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

Don't allow subsequence caching for foreignObject under multi-col

SVG content can't fragment (see LayoutFlowThread::LocateFlowThreadContainingBlockOf)
but since it is painted as a replaced-normal-flow stacking context, multiple
calls into its paint can happen anyway.

Bug: 859586
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ied0b869d37373499e6a784dee8bd620d7b535fa9
Reviewed-on: https://chromium-review.googlesource.com/1123765Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572200}
parent bcfd13f9
...@@ -1064,6 +1064,7 @@ crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-rowspan ...@@ -1064,6 +1064,7 @@ crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-rowspan
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-rowspan.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-rowspan.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-table-cell.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-table-cell.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-table-with-fixed-height.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-table-with-fixed-height.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/foreignobject-no-pagination.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/image-block-as-first-child.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/image-block-as-first-child.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/multi-line-cells-paginated.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/multi-line-cells-paginated.html [ Failure ]
crbug.com/591099 virtual/layout_ng_experimental/fragmentation/multi-line-cells.html [ Failure ] crbug.com/591099 virtual/layout_ng_experimental/fragmentation/multi-line-cells.html [ Failure ]
......
<!doctype HTML>
<svg>
<foreignObject>
<div style="width: 50px; height: 100px; background: lightblue">
</div>
</foreignObject>
</svg>
<!doctype HTML>
<div style="columns: 2; height: 100px">
<svg>
<foreignObject>
<div style="width: 50px; height: 200px; background: lightblue">
</div>
</foreignObject>
</svg>
</div>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_painter.h" #include "third_party/blink/renderer/core/paint/paint_layer_painter.h"
#include "third_party/blink/renderer/core/paint/svg_paint_context.h" #include "third_party/blink/renderer/core/paint/svg_paint_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/display_item_cache_skipper.h"
namespace blink { namespace blink {
...@@ -26,6 +27,14 @@ void SVGForeignObjectPainter::PaintLayer(const PaintInfo& paint_info) { ...@@ -26,6 +27,14 @@ void SVGForeignObjectPainter::PaintLayer(const PaintInfo& paint_info) {
if (!layout_svg_foreign_object_.FirstFragment().HasLocalBorderBoxProperties()) if (!layout_svg_foreign_object_.FirstFragment().HasLocalBorderBoxProperties())
return; return;
// TODO(crbug.com/797779): For now foreign object contents don't know whether
// they are painted in a fragmented context and may do something bad in a
// fragmented context, e.g. creating subsequences. Skip cache to avoid that.
// This will be unnecessary when the contents are fragment aware.
base::Optional<DisplayItemCacheSkipper> cache_skipper;
if (layout_svg_foreign_object_.Layer()->Parent()->EnclosingPaginationLayer())
cache_skipper.emplace(paint_info.context);
// <foreignObject> is a replaced normal-flow stacking element. // <foreignObject> is a replaced normal-flow stacking element.
// See IsReplacedNormalFlowStacking in paint_layer_painter.cc. // See IsReplacedNormalFlowStacking in paint_layer_painter.cc.
PaintLayerPaintingInfo layer_painting_info( PaintLayerPaintingInfo layer_painting_info(
......
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