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

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
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('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 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the anonymous container 219 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the anonymous container
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 bool usesCompositedScrolling = m_layoutBlock.hasOverflowModel() && m_layoutB lock.usesCompositedScrolling();
230 overflowRect.unite(m_layoutBlock.layoutOverflowRect()); 230
231 if (usesCompositedScrolling) {
232 LayoutRect layoutOverflowRect = m_layoutBlock.layoutOverflowRect();
233 overflowRect.unite(layoutOverflowRect);
234 }
235 m_layoutBlock.flipForWritingMode(overflowRect);
236
237 // Scrolling is applied in physical space, which is why it is after the flip above.
238 if (usesCompositedScrolling) {
231 overflowRect.move(-m_layoutBlock.scrolledContentOffset()); 239 overflowRect.move(-m_layoutBlock.scrolledContentOffset());
232 } 240 }
233 m_layoutBlock.flipForWritingMode(overflowRect); 241
234 overflowRect.moveBy(adjustedPaintOffset); 242 overflowRect.moveBy(adjustedPaintOffset);
235 return paintInfo.cullRect().intersectsCullRect(overflowRect); 243 return paintInfo.cullRect().intersectsCullRect(overflowRect);
236 } 244 }
237 245
238 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
239 { 247 {
240 DCHECK(!m_layoutBlock.childrenInline()); 248 DCHECK(!m_layoutBlock.childrenInline());
241 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
242 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
243 } 251 }
244 252
245 } // namespace blink 253 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698