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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h

Issue 1647793002: Use ScrollAnchor in FrameView and PaintLayerScrollableArea. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@anchor-skeleton
Patch Set: address review comment Created 4 years, 10 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 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 28 matching lines...) Expand all
39 * other provisions required by the MPL or the GPL, as the case may be. 39 * other provisions required by the MPL or the GPL, as the case may be.
40 * If you do not delete the provisions above, a recipient may use your 40 * If you do not delete the provisions above, a recipient may use your
41 * version of this file under any of the LGPL, the MPL or the GPL. 41 * version of this file under any of the LGPL, the MPL or the GPL.
42 */ 42 */
43 43
44 #ifndef PaintLayerScrollableArea_h 44 #ifndef PaintLayerScrollableArea_h
45 #define PaintLayerScrollableArea_h 45 #define PaintLayerScrollableArea_h
46 46
47 #include "core/CoreExport.h" 47 #include "core/CoreExport.h"
48 #include "core/layout/LayoutBox.h" 48 #include "core/layout/LayoutBox.h"
49 #include "core/layout/ScrollAnchor.h"
49 #include "core/paint/PaintInvalidationCapableScrollableArea.h" 50 #include "core/paint/PaintInvalidationCapableScrollableArea.h"
50 #include "core/paint/PaintLayerFragment.h" 51 #include "core/paint/PaintLayerFragment.h"
51 #include "platform/heap/Handle.h" 52 #include "platform/heap/Handle.h"
52 53
53 namespace blink { 54 namespace blink {
54 55
55 enum ResizerHitTestType { 56 enum ResizerHitTestType {
56 ResizerForPointer, 57 ResizerForPointer,
57 ResizerForTouch 58 ResizerForTouch
58 }; 59 };
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 327
327 LayoutScrollbarPart* resizer() const override { return m_resizer; } 328 LayoutScrollbarPart* resizer() const override { return m_resizer; }
328 329
329 const IntPoint& cachedOverlayScrollbarOffset() { return m_cachedOverlayScrol lbarOffset; } 330 const IntPoint& cachedOverlayScrollbarOffset() { return m_cachedOverlayScrol lbarOffset; }
330 void setCachedOverlayScrollbarOffset(const IntPoint& offset) { m_cachedOverl ayScrollbarOffset = offset; } 331 void setCachedOverlayScrollbarOffset(const IntPoint& offset) { m_cachedOverl ayScrollbarOffset = offset; }
331 332
332 IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const; 333 IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const;
333 IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const; 334 IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const;
334 335
335 Widget* widget() override; 336 Widget* widget() override;
337 ScrollAnchor& scrollAnchor() { return m_scrollAnchor; }
336 bool isPaintLayerScrollableArea() const override { return true; } 338 bool isPaintLayerScrollableArea() const override { return true; }
337 339
338 DECLARE_VIRTUAL_TRACE(); 340 DECLARE_VIRTUAL_TRACE();
339 341
340 private: 342 private:
341 explicit PaintLayerScrollableArea(PaintLayer&); 343 explicit PaintLayerScrollableArea(PaintLayer&);
342 344
343 bool hasHorizontalOverflow() const; 345 bool hasHorizontalOverflow() const;
344 bool hasVerticalOverflow() const; 346 bool hasVerticalOverflow() const;
345 bool hasScrollableHorizontalOverflow() const; 347 bool hasScrollableHorizontalOverflow() const;
(...skipping 21 matching lines...) Expand all
367 void updateResizerStyle(); 369 void updateResizerStyle();
368 370
369 371
370 void updateScrollableAreaSet(bool hasOverflow); 372 void updateScrollableAreaSet(bool hasOverflow);
371 373
372 void updateCompositingLayersAfterScroll(); 374 void updateCompositingLayersAfterScroll();
373 375
374 // PaintInvalidationCapableScrollableArea 376 // PaintInvalidationCapableScrollableArea
375 LayoutBox& boxForScrollControlPaintInvalidation() const { return box(); } 377 LayoutBox& boxForScrollControlPaintInvalidation() const { return box(); }
376 378
379 bool scrollAnchoringEnabled() const;
380
377 PaintLayer& m_layer; 381 PaintLayer& m_layer;
378 382
379 // Keeps track of whether the layer is currently resizing, so events can cau se resizing to start and stop. 383 // Keeps track of whether the layer is currently resizing, so events can cau se resizing to start and stop.
380 unsigned m_inResizeMode : 1; 384 unsigned m_inResizeMode : 1;
381 unsigned m_scrollsOverflow : 1; 385 unsigned m_scrollsOverflow : 1;
382 386
383 unsigned m_inOverflowRelayout : 1; 387 unsigned m_inOverflowRelayout : 1;
384 388
385 PaintLayer* m_nextTopmostScrollChild; 389 PaintLayer* m_nextTopmostScrollChild;
386 PaintLayer* m_topmostScrollChild; 390 PaintLayer* m_topmostScrollChild;
(...skipping 15 matching lines...) Expand all
402 DoubleSize m_scrollOffset; 406 DoubleSize m_scrollOffset;
403 407
404 IntPoint m_cachedOverlayScrollbarOffset; 408 IntPoint m_cachedOverlayScrollbarOffset;
405 409
406 // LayoutObject to hold our custom scroll corner. 410 // LayoutObject to hold our custom scroll corner.
407 LayoutScrollbarPart* m_scrollCorner; 411 LayoutScrollbarPart* m_scrollCorner;
408 412
409 // LayoutObject to hold our custom resizer. 413 // LayoutObject to hold our custom resizer.
410 LayoutScrollbarPart* m_resizer; 414 LayoutScrollbarPart* m_resizer;
411 415
416 ScrollAnchor m_scrollAnchor;
417
412 #if ENABLE(ASSERT) 418 #if ENABLE(ASSERT)
413 bool m_hasBeenDisposed; 419 bool m_hasBeenDisposed;
414 #endif 420 #endif
415 }; 421 };
416 422
417 DEFINE_TYPE_CASTS(PaintLayerScrollableArea, ScrollableArea, scrollableArea, 423 DEFINE_TYPE_CASTS(PaintLayerScrollableArea, ScrollableArea, scrollableArea,
418 scrollableArea->isPaintLayerScrollableArea(), 424 scrollableArea->isPaintLayerScrollableArea(),
419 scrollableArea.isPaintLayerScrollableArea()); 425 scrollableArea.isPaintLayerScrollableArea());
420 426
421 } // namespace blink 427 } // namespace blink
422 428
423 #endif // LayerScrollableArea_h 429 #endif // LayerScrollableArea_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698