Skip to content

Commit

Permalink
Reland "[CompositeAfterPaint] Remove internals.elementLayerTreeAsText()"
Browse files Browse the repository at this point in the history
This reverts commit 93235d0.

Reason for revert: The failing test just needs a rebaseline (done in this
CL). We don't have CQ coverage for mac10.10 so the original CL passed CQ.

Original change's description:
> Revert "[CompositeAfterPaint] Remove internals.elementLayerTreeAsText()"
>
> This reverts commit bd07dee.
>
> Reason for revert: Fails color-layer test on Mac10.10:
> https://ci.chromium.org/p/chromium/builders/ci/Mac10.10%20Tests/48789
>
> Original change's description:
> > [CompositeAfterPaint] Remove internals.elementLayerTreeAsText()
> >
> > The layer tree mode is not supported in CompositedAfterPaint.
> > Remove it and rewrite the tests so that the tests will pass in
> > CompositeAfterPaint.
> >
> > Change-Id: Ided24dc50b6804397777fec8fbce45d8d6cb3174
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918295
> > Reviewed-by: Philip Rogers <pdr@chromium.org>
> > Reviewed-by: Ken Buchanan <kenrb@chromium.org>
> > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#716300}
>
> TBR=kenrb@chromium.org,wangxianzhu@chromium.org,pdr@chromium.org
>
> Change-Id: I5a8667762698a7879975510df28578558c29295e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1923208
> Reviewed-by: Alexey Baskakov <loyso@chromium.org>
> Commit-Queue: Alexey Baskakov <loyso@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#716389}

TBR=kenrb@chromium.org,wangxianzhu@chromium.org,pdr@chromium.org,loyso@chromium.org

Change-Id: I1d26efe39fb7dd21ce0509a43cdd62981c68ad1d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1923329
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716437}
  • Loading branch information
wangxianzhu authored and Commit Bot committed Nov 19, 2019
1 parent b9ac269 commit 5ad3928
Show file tree
Hide file tree
Showing 59 changed files with 427 additions and 890 deletions.
10 changes: 0 additions & 10 deletions content/browser/site_per_process_hit_test_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -942,16 +942,6 @@ IN_PROC_BROWSER_TEST_P(SitePerProcessInternalsHitTestBrowserTest,
rwhv_root->OnScrollEvent(&scroll_event);
ack_observer.Wait();

// Check compositor layers.
EXPECT_TRUE(
ExecuteScriptAndExtractString(nested_iframe_node->current_frame_host(),
"window.domAutomationController.send("
"window.internals.layerTreeAsText(document,"
" internals.OUTPUT_AS_LAYER_TREE));",
&str));
// We expect the nested OOPIF to not have any compositor layers.
EXPECT_EQ(std::string(), str);

// Verify the div scrolled.
double div_scroll_top = div_scroll_top_start;
EXPECT_TRUE(ExecuteScriptAndExtractDouble(
Expand Down
309 changes: 172 additions & 137 deletions third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc

Large diffs are not rendered by default.

38 changes: 0 additions & 38 deletions third_party/blink/renderer/core/testing/internals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2089,13 +2089,6 @@ String Internals::layerTreeAsText(Document* document,
return layerTreeAsText(document, 0, exception_state);
}

String Internals::elementLayerTreeAsText(
Element* element,
ExceptionState& exception_state) const {
DCHECK(element);
return elementLayerTreeAsText(element, 0, exception_state);
}

bool Internals::scrollsWithRespectTo(Element* element1,
Element* element2,
ExceptionState& exception_state) {
Expand Down Expand Up @@ -2152,37 +2145,6 @@ String Internals::layerTreeAsText(Document* document,
return document->GetFrame()->GetLayerTreeAsTextForTesting(flags);
}

String Internals::elementLayerTreeAsText(
Element* element,
unsigned flags,
ExceptionState& exception_state) const {
DCHECK(element);

LocalFrameView* frame_view = element->GetDocument().View();
frame_view->UpdateAllLifecyclePhases(
DocumentLifecycle::LifecycleUpdateReason::kTest);

LayoutObject* layout_object = element->GetLayoutObject();
if (!layout_object || !layout_object->IsBox()) {
exception_state.ThrowDOMException(
DOMExceptionCode::kInvalidAccessError,
layout_object ? "The provided element's layoutObject is not a box."
: "The provided element has no layoutObject.");
return String();
}

PaintLayer* layer = ToLayoutBox(layout_object)->Layer();
if (!layer || !layer->HasCompositedLayerMapping() ||
!layer->GetCompositedLayerMapping()->MainGraphicsLayer()) {
// Don't raise exception in these cases which may be normally used in tests.
return String();
}

return GraphicsLayerTreeAsTextForTesting(
layer->GetCompositedLayerMapping()->MainGraphicsLayer(),
flags | kOutputAsLayerTree);
}

String Internals::scrollingStateTreeAsText(Document*) const {
return String();
}
Expand Down
4 changes: 0 additions & 4 deletions third_party/blink/renderer/core/testing/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ class Internals final : public ScriptWrappable {

String layerTreeAsText(Document*, unsigned flags, ExceptionState&) const;
String layerTreeAsText(Document*, ExceptionState&) const;
String elementLayerTreeAsText(Element*,
unsigned flags,
ExceptionState&) const;
String elementLayerTreeAsText(Element*, ExceptionState&) const;

bool scrollsWithRespectTo(Element*, Element*, ExceptionState&);

Expand Down
2 changes: 0 additions & 2 deletions third_party/blink/renderer/core/testing/internals.idl
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@
const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER = 8;
const unsigned short LAYER_TREE_INCLUDES_COMPOSITING_REASONS = 32;
const unsigned short LAYER_TREE_INCLUDES_PAINT_RECORDS = 64;
const unsigned short OUTPUT_AS_LAYER_TREE = 0x4000;

[RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags);
[RaisesException] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);

[RaisesException] boolean scrollsWithRespectTo(Element element1, Element element2);

Expand Down
21 changes: 2 additions & 19 deletions third_party/blink/web_tests/FlagExpectations/composite-after-paint
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ crbug.com/1008501 compositing/reflections/deeply-nested-reflections.html [ Failu

Bug(none) compositing/animation/hidden-composited.html [ Failure ]
Bug(none) compositing/change-preferCompositingToLCDText-setting.html [ Failure ]
Bug(none) compositing/contents-opaque/control-layer.html [ Failure ]
Bug(none) compositing/contents-opaque/hidden-with-visible-child.html [ Failure ]
Bug(none) compositing/contents-opaque/layer-opacity.html [ Failure ]
Bug(none) compositing/draws-content/canvas-background-layer.html [ Failure ]
Expand All @@ -66,25 +67,12 @@ Bug(none) compositing/layer-creation/overlap-transformed-preserved-3d.html [ Fai
Bug(none) compositing/layer-creation/overlap-transforms.html [ Failure ]
Bug(none) compositing/layer-creation/scroll-partial-update.html [ Failure ]
Bug(none) compositing/masks/mask-with-removed-filters.html [ Failure ]
Bug(none) compositing/overflow/opt-in-if-composited.html [ Failure ]
crbug.com/979367 compositing/overflow/overflow-scroll-background-fractional-offset.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-background-opaque-to-transparent.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-background-transparent-to-opaque.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-content-fractional-offset.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-with-negative-offset-translucent-outline.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-with-opaque-background-will-change.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-with-opaque-background.html [ Failure ]
Bug(none) compositing/overflow/overflow-scroll-with-transparent-background.html [ Failure ]
Bug(none) compositing/overflow/scaled-overflow.html [ Failure ]
crbug.com/667946 compositing/overflow/scrolls-with-respect-to-nested.html [ Failure ]
crbug.com/667946 compositing/overflow/scrolls-with-respect-to-transform.html [ Failure ]
crbug.com/667946 compositing/overflow/scrolls-with-respect-to.html [ Failure ]
Bug(none) compositing/reflections/nested-reflection-mask-change.html [ Failure ]
Bug(none) compositing/squashing/do-not-squash-scroll-child-with-composited-descendants.html [ Failure ]
Bug(none) compositing/squashing/dont-squash-into-animated-layers.html [ Failure ]
Bug(none) compositing/squashing/dont-squash-into-blend-mode.html [ Failure ]
Bug(none) compositing/squashing/dont-squash-into-videos.html [ Failure ]
Bug(none) compositing/squashing/dont-squash-with-scale-transform.html [ Failure ]
Bug(none) compositing/squashing/squash-transform-repainting-child.html [ Failure ]
Bug(none) compositing/squashing/squash-transform-repainting-transformed-child.html [ Failure ]
Bug(none) compositing/squashing/squash-transform.html [ Failure ]
Expand Down Expand Up @@ -194,14 +182,12 @@ Bug(none) external/wpt/css/css-position/hypothetical-box-scroll-parent.html [ Fa
Bug(none) external/wpt/svg/render/reftests/blending-001.svg [ Failure ]
Bug(none) external/wpt/svg/render/reftests/blending-002.svg [ Failure ]

# Subpixel differences that look benign, but we can't rebaseline ref tests.
# Invisible subpixel or invisible color differences that look benign, but we can't rebaseline ref tests.
Bug(none) fast/multicol/mixed-opacity-fixed-test.html [ Failure ]
Bug(none) fast/multicol/mixed-positioning-stacking-order.html [ Failure ]
Bug(none) fullscreen/rendering/backdrop-object.html [ Failure ]

# Text failures due to layerization differences
Bug(none) compositing/overflow/ancestor-with-clip-path.html [ Failure ]
Bug(none) compositing/overflow/descendant-with-clip-path.html [ Failure ]
Bug(none) compositing/overflow/scroller-with-border-radius.html [ Failure ]
Bug(none) css3/blending/mix-blend-mode-isolation-remove.html [ Failure ]

Expand Down Expand Up @@ -238,7 +224,6 @@ crbug.com/738613 compositing/overflow/composited-scroll-overlap-test.html [ Fail
crbug.com/738613 paint/invalidation/scroll/caret-with-composited-scroll.html [ Failure ]
crbug.com/738613 paint/invalidation/overflow/composited-overflow-with-local-background.html [ Failure ]
crbug.com/738613 paint/invalidation/compositing/new-stacking-context.html [ Failure ]
crbug.com/738613 compositing/overflow/overflow-scroll-with-pointer-events-toggle.html [ Failure ]

# Needs fully composited scrollbar support: needs investigation on unwanted squashing into scrollbars.
crbug.com/931486 compositing/overflow/overlap-testing-ancestor-scroller-high-dpi.html [ Failure ]
Expand All @@ -248,7 +233,6 @@ crbug.com/931486 compositing/rtl/rtl-iframe-absolute-overflow.html [ Failure ]
crbug.com/931486 compositing/rtl/rtl-iframe-fixed-overflow.html [ Failure ]
crbug.com/931486 compositing/squashing/squash-above-fixed-1.html [ Failure ]
crbug.com/931486 compositing/squashing/squash-above-fixed-3.html [ Failure ]
crbug.com/931486 paint/invalidation/compositing/opacity-from-zero-to-non-zero-composited.html [ Failure ]
crbug.com/931486 paint/invalidation/compositing/pointer-events-composited-scrolling.html [ Failure ]
crbug.com/931486 paint/invalidation/compositing/scrolling-neg-z-index-descendants.html [ Failure ]
crbug.com/931486 paint/invalidation/compositing/text-color-change.html [ Failure ]
Expand All @@ -265,7 +249,6 @@ crbug.com/931486 paint/invalidation/line-flow-with-floats-7.html [ Failure ]
crbug.com/931486 paint/invalidation/line-flow-with-floats-8.html [ Failure ]
crbug.com/931486 paint/invalidation/line-flow-with-floats-9.html [ Failure ]
crbug.com/931486 paint/invalidation/flexbox/scrollbars-changed.html [ Failure ]
crbug.com/931486 paint/invalidation/scroll/composited-add-resizer.html [ Failure ]
crbug.com/931486 paint/invalidation/scroll/composited-iframe-scroll-repaint.html [ Failure ]
crbug.com/931486 paint/invalidation/scroll/overflow-scroll-composited-non-stacking-child.html [ Failure ]
crbug.com/931486 paint/invalidation/scroll/overflow-scroll-delete.html [ Failure ]
Expand Down
3 changes: 3 additions & 0 deletions third_party/blink/web_tests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ crbug.com/1018273 [ Mac ] paint/invalidation/compositing/should-not-repaint-scro
crbug.com/1018273 [ Mac ] paint/invalidation/compositing/stop-painting-onto-scrolling-contents.html [ Failure ]
crbug.com/1018273 [ Mac ] paint/overflow/composited-scroll-vertical-rl.html [ Failure ]

crbug.com/1025019 compositing/overflow/scroller-with-border-radius.html [ Crash ]
crbug.com/1025019 virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroller-with-border-radius.html [ Crash ]

# ====== Paint team owned tests to here ======

crbug.com/922249 virtual/android/fullscreen/compositor-touch-hit-rects-fullscreen-video-controls.html [ Failure Pass ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
PASS
{
"layers": [
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutButton INPUT id='control' class='composited'",
"bounds": [127, 22],
"backgroundColor": "#DDDDDD",
"transform": 1
}
],
"transforms": [
{
"id": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 8, 0, 1]
]
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

function doTest() {
if (window.testRunner && window.internals) {
var layerTree = internals.elementLayerTreeAsText(document.getElementById('control'));
document.getElementById('result').innerText =
layerTree.indexOf('contentsOpaque 1') == -1 ? 'PASS' : 'FAIL:\n' + layerTree;
testRunner.setCustomTextOutput(internals.layerTreeAsText(document));
}
}
window.addEventListener('load', doTest, false);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE HTML>
<style>
#scroller {
overflow: scroll;
height: 300px;
width: 300px;
background-color: red;
}

#outer {
height: 800px;
width: 250px;
background-color: blue;
clip-path: polygon(40px 550px,432px 302px,409px 237px,46px 156px);
}

#scrolled {
height: 1000px;
width: 250px;
background-color: green;
}

#fixed {
position: fixed;
height: 100px;
width: 100px;
background-color: green;
top: 400px;
left: 100px;
}
</style>
<div id="outer">
<div id="scroller">
<div id="scrolled"></div>
<div id="fixed"></div>
</div>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE HTML>
<script src="resources/composited-scroll.js"></script>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
#scroller {
overflow: scroll;
Expand Down Expand Up @@ -39,34 +39,9 @@
if (window.internals)
internals.settings.setPreferCompositingToLCDTextEnabled(true);

if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}

var result = "";

onload = function() {
if (window.internals) {
result += "No clip path ancestor (should be using composited scrolling): ";
if (elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller')))
result += "Pass.\n";
else
result += "Fail.\n"
}
document.getElementById("outer").style.webkitClipPath = "polygon(40px 550px,432px 302px,409px 237px,46px 156px)";
requestAnimationFrame(function() {
if (window.internals) {
result += "Has clip path ancestor (should not be using composited scrolling): ";
if (!elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller')))
result += "Pass.\n";
else
result += "Fail.\n"
}
if (window.testRunner) {
testRunner.setCustomTextOutput(result);
testRunner.notifyDone();
}
});
runAfterLayoutAndPaint(function() {
outer.style.clipPath = "polygon(40px 550px,432px 302px,409px 237px,46px 156px)";
}, true);
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE HTML>
<style>
#scroller {
overflow: scroll;
height: 300px;
width: 300px;
background-color: red;
}

#inner {
height: 1000px;
width: 250px;
background-color: blue;
clip-path: polygon(40px 550px,432px 302px,409px 237px,46px 156px);
}

#fixed {
position: fixed;
height: 100px;
width: 100px;
background-color: green;
top: 400px;
left: 100px;
}
</style>
<div id="scroller">
<div id="inner">
<div id="fixed"></div>
</div>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE HTML>
<script src="resources/composited-scroll.js"></script>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
#scroller {
overflow: scroll;
Expand Down Expand Up @@ -32,35 +32,9 @@
if (window.internals)
internals.settings.setPreferCompositingToLCDTextEnabled(true);

if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}

var result = "";

onload = function() {
if (window.internals) {
result += "No clip path descendant (should be using composited scrolling): ";
if (elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller')))
result += "Pass.\n";
else
result += "Fail.\n"
}
document.getElementById("inner").style.webkitClipPath = "polygon(40px 550px,432px 302px,409px 237px,46px 156px)";
requestAnimationFrame(function() {
if (window.internals) {
result += "Has clip path descendant (should not be using composited scrolling): ";
if (!elementSubtreeHasCompositedScrollLayers(document.getElementById('scroller')))
result += "Pass.\n";
else
result += "Fail.\n"
}

if (window.testRunner) {
testRunner.setCustomTextOutput(result);
testRunner.notifyDone();
}
});
runAfterLayoutAndPaint(function() {
inner.style.clipPath = "polygon(40px 550px,432px 302px,409px 237px,46px 156px)";
}, true);
};
</script>

This file was deleted.

0 comments on commit 5ad3928

Please sign in to comment.