Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp

Issue 1925703003: Set needsPaintPhaseDescendantBlockBackgrounds if a table has collapsed borders (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInfo.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/LayoutBlock.h" 5 #include "core/layout/LayoutBlock.h"
6 #include "core/layout/LayoutInline.h" 6 #include "core/layout/LayoutInline.h"
7 #include "core/layout/compositing/CompositedLayerMapping.h" 7 #include "core/layout/compositing/CompositedLayerMapping.h"
8 #include "core/paint/PaintControllerPaintTest.h" 8 #include "core/paint/PaintControllerPaintTest.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 10
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines()); 496 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantOutlines());
497 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); 497 EXPECT_FALSE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
498 498
499 toHTMLElement(layerDiv.node())->setAttribute(HTMLNames::styleAttr, "width: 1 00px; height: 100px; overflow: hidden"); 499 toHTMLElement(layerDiv.node())->setAttribute(HTMLNames::styleAttr, "width: 1 00px; height: 100px; overflow: hidden");
500 document().view()->updateAllLifecyclePhases(); 500 document().view()->updateAllLifecyclePhases();
501 EXPECT_FALSE(layer.isSelfPaintingLayer()); 501 EXPECT_FALSE(layer.isSelfPaintingLayer());
502 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines()); 502 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantOutlines());
503 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds()); 503 EXPECT_TRUE(htmlLayer.needsPaintPhaseDescendantBlockBackgrounds());
504 } 504 }
505 505
506 TEST_P(PaintLayerPainterTest, TableCollapsedBorderNeedsPaintPhaseDescendantBlock Backgrounds)
507 {
508 // "position: relative" makes the table and td self-painting layers.
509 // The table's layer should be marked needsPaintPhaseDescendantBlockBackgrou nd because it
510 // will paint collapsed borders in the phase.
511 setBodyInnerHTML(
512 "<table id='table' style='position: relative; border-collapse: collapse' >"
513 " <tr><td style='position: relative; border: 1px solid green'>Cell</td> </tr>"
514 "</table>");
515
516 LayoutBlock& table = *toLayoutBlock(getLayoutObjectByElementId("table"));
517 ASSERT_TRUE(table.hasLayer());
518 PaintLayer& layer = *table.layer();
519 EXPECT_TRUE(layer.isSelfPaintingLayer());
520 EXPECT_TRUE(layer.needsPaintPhaseDescendantBlockBackgrounds());
chrishtr 2016/04/27 19:57:22 Also test that adding the property resuts in setti
Xianzhu 2016/04/27 22:08:38 Done.
521 }
522
506 } // namespace blink 523 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698