| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/paint/PaintControllerPaintTest.h" | 5 #include "core/paint/PaintControllerPaintTest.h" |
| 6 | 6 |
| 7 #include "core/editing/FrameCaret.h" | 7 #include "core/editing/FrameCaret.h" |
| 8 #include "core/editing/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
| 9 #include "core/layout/LayoutText.h" | 9 #include "core/layout/LayoutText.h" |
| 10 #include "core/layout/line/InlineTextBox.h" | 10 #include "core/layout/line/InlineTextBox.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 div.focus(); | 65 div.focus(); |
| 66 document().view()->updateAllLifecyclePhases(); | 66 document().view()->updateAllLifecyclePhases(); |
| 67 | 67 |
| 68 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 68 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 69 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 69 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 70 EXPECT_DISPLAY_LIST( | 70 EXPECT_DISPLAY_LIST( |
| 71 rootPaintController().getDisplayItemList(), 5, | 71 rootPaintController().getDisplayItemList(), 5, |
| 72 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 72 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 73 TestDisplayItem(layoutView(), documentBackgroundType), | 73 TestDisplayItem(layoutView(), documentBackgroundType), |
| 74 TestDisplayItem(textInlineBox, foregroundType), | 74 TestDisplayItem(textInlineBox, foregroundType), |
| 75 TestDisplayItem(document() | 75 TestDisplayItem( |
| 76 .frame() | 76 document().frame()->selection().getCaretDisplayItemClient(), |
| 77 ->selection() | 77 DisplayItem::kCaret), // New! |
| 78 .caretDisplayItemClientForTesting(), | |
| 79 DisplayItem::kCaret), // New! | |
| 80 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); | 78 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence)); |
| 81 } else { | 79 } else { |
| 82 EXPECT_DISPLAY_LIST( | 80 EXPECT_DISPLAY_LIST( |
| 83 rootPaintController().getDisplayItemList(), 7, | 81 rootPaintController().getDisplayItemList(), 7, |
| 84 TestDisplayItem(layoutView(), | 82 TestDisplayItem(layoutView(), |
| 85 DisplayItem::kClipFrameToVisibleContentRect), | 83 DisplayItem::kClipFrameToVisibleContentRect), |
| 86 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), | 84 TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence), |
| 87 TestDisplayItem(layoutView(), documentBackgroundType), | 85 TestDisplayItem(layoutView(), documentBackgroundType), |
| 88 TestDisplayItem(textInlineBox, foregroundType), | 86 TestDisplayItem(textInlineBox, foregroundType), |
| 89 TestDisplayItem(document() | 87 TestDisplayItem( |
| 90 .frame() | 88 document().frame()->selection().getCaretDisplayItemClient(), |
| 91 ->selection() | 89 DisplayItem::kCaret), // New! |
| 92 .caretDisplayItemClientForTesting(), | |
| 93 DisplayItem::kCaret), // New! | |
| 94 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | 90 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), |
| 95 TestDisplayItem(layoutView(), | 91 TestDisplayItem(layoutView(), |
| 96 DisplayItem::clipTypeToEndClipType( | 92 DisplayItem::clipTypeToEndClipType( |
| 97 DisplayItem::kClipFrameToVisibleContentRect))); | 93 DisplayItem::kClipFrameToVisibleContentRect))); |
| 98 } | 94 } |
| 99 } else { | 95 } else { |
| 100 EXPECT_DISPLAY_LIST( | 96 EXPECT_DISPLAY_LIST( |
| 101 rootPaintController().getDisplayItemList(), 3, | 97 rootPaintController().getDisplayItemList(), 3, |
| 102 TestDisplayItem(layoutView(), documentBackgroundType), | 98 TestDisplayItem(layoutView(), documentBackgroundType), |
| 103 TestDisplayItem(textInlineBox, foregroundType), | 99 TestDisplayItem(textInlineBox, foregroundType), |
| 104 TestDisplayItem( | 100 TestDisplayItem( |
| 105 document().frame()->selection().caretDisplayItemClientForTesting(), | 101 document().frame()->selection().getCaretDisplayItemClient(), |
| 106 DisplayItem::kCaret)); // New! | 102 DisplayItem::kCaret)); // New! |
| 107 } | 103 } |
| 108 } | 104 } |
| 109 | 105 |
| 110 TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) { | 106 TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) { |
| 111 setBodyInnerHTML( | 107 setBodyInnerHTML( |
| 112 "<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA " | 108 "<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA " |
| 113 "BBBBBBBBBB</div>"); | 109 "BBBBBBBBBB</div>"); |
| 114 Element& div = *toElement(document().body()->firstChild()); | 110 Element& div = *toElement(document().body()->firstChild()); |
| 115 LayoutBlock& divBlock = | 111 LayoutBlock& divBlock = |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 TestDisplayItem(div, DisplayItem::kEndCompositing), | 283 TestDisplayItem(div, DisplayItem::kEndCompositing), |
| 288 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), | 284 TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence), |
| 289 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), | 285 TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence), |
| 290 TestDisplayItem(layoutView(), | 286 TestDisplayItem(layoutView(), |
| 291 DisplayItem::clipTypeToEndClipType( | 287 DisplayItem::clipTypeToEndClipType( |
| 292 DisplayItem::kClipFrameToVisibleContentRect))); | 288 DisplayItem::kClipFrameToVisibleContentRect))); |
| 293 } | 289 } |
| 294 } | 290 } |
| 295 | 291 |
| 296 } // namespace blink | 292 } // namespace blink |
| OLD | NEW |