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

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

Issue 2144413002: Fix invalidation under scroll, and cull rect testing, of flipped-block writing mode elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 5 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
OLDNEW
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/BlockPainter.h" 5 #include "core/paint/BlockPainter.h"
6 6
7 #include "core/editing/DragCaretController.h" 7 #include "core/editing/DragCaretController.h"
8 #include "core/editing/FrameSelection.h" 8 #include "core/editing/FrameSelection.h"
9 #include "core/layout/LayoutFlexibleBox.h" 9 #include "core/layout/LayoutFlexibleBox.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // of <a>, the anonymous container's visual overflow is empty, but we ne ed to continue 220 // of <a>, the anonymous container's visual overflow is empty, but we ne ed to continue
221 // painting to output <a>'s PDF URL rect which covers the continuations, as if we included 221 // painting to output <a>'s PDF URL rect which covers the continuations, as if we included
222 // <a>'s PDF URL rect into m_layoutBlock's visual overflow. 222 // <a>'s PDF URL rect into m_layoutBlock's visual overflow.
223 Vector<LayoutRect> rects; 223 Vector<LayoutRect> rects;
224 m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint()); 224 m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint());
225 overflowRect = unionRect(rects); 225 overflowRect = unionRect(rects);
226 } 226 }
227 overflowRect.unite(m_layoutBlock.visualOverflowRect()); 227 overflowRect.unite(m_layoutBlock.visualOverflowRect());
228 228
229 if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrollin g()) { 229 if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrollin g()) {
230 overflowRect.unite(m_layoutBlock.layoutOverflowRect()); 230 LayoutRect layoutOverflowRect = m_layoutBlock.layoutOverflowRect();
231 overflowRect.move(-m_layoutBlock.scrolledContentOffset()); 231 m_layoutBlock.flipForWritingMode(layoutOverflowRect);
232 layoutOverflowRect.move(-m_layoutBlock.scrolledContentOffset());
233 overflowRect.unite(layoutOverflowRect);
232 } 234 }
233 m_layoutBlock.flipForWritingMode(overflowRect); 235
234 overflowRect.moveBy(adjustedPaintOffset); 236 overflowRect.moveBy(adjustedPaintOffset);
235 return paintInfo.cullRect().intersectsCullRect(overflowRect); 237 return paintInfo.cullRect().intersectsCullRect(overflowRect);
236 } 238 }
237 239
238 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 240 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
239 { 241 {
240 DCHECK(!m_layoutBlock.childrenInline()); 242 DCHECK(!m_layoutBlock.childrenInline());
241 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 243 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
242 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 244 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
243 } 245 }
244 246
245 } // namespace blink 247 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698