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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.h

Issue 1930183002: Refactor scroll updates during flexbox layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@rtl-scroll-origin
Patch Set: Fix layout invalidation reason 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 int inlineBlockBaseline(LineDirectionMode) const override; 328 int inlineBlockBaseline(LineDirectionMode) const override;
329 329
330 // This function disables the 'overflow' check in inlineBlockBaseline. 330 // This function disables the 'overflow' check in inlineBlockBaseline.
331 // For 'inline-block', CSS says that the baseline is the bottom margin edge 331 // For 'inline-block', CSS says that the baseline is the bottom margin edge
332 // if 'overflow' is not visible. But some descendant classes want to ignore 332 // if 'overflow' is not visible. But some descendant classes want to ignore
333 // this condition. 333 // this condition.
334 virtual bool shouldIgnoreOverflowPropertyForInlineBlockBaseline() const { re turn false; } 334 virtual bool shouldIgnoreOverflowPropertyForInlineBlockBaseline() const { re turn false; }
335 335
336 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; 336 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override;
337 337
338 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be
339 // called. This function is used when a flexbox is laying out its
340 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(),
341 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo()
342 // is called the same number of times.
343 // finishDelayUpdateScrollInfo returns true when it marked something for lay out.
344 // It will also return a map of saved scroll positions that the caller shoul d restore
345 // on the given scrollable areas after performing the layout.
346 // This can be necessary because Flexbox's multi-pass layout can lose the sc roll position.
347 // TODO(cbiesinger): This is a temporary hack. The right solution is to dela y the scroll
348 // clamping that currently happens in PaintLayerScrollableArea::updateAfterL ayout to only
349 // happen after all layout is done, i.e. during updateLayerPositionsAfterLay out. However,
350 // that currently fails a layout test. To fix this bug in time for M50, we u se this temporary
351 // hack. The real fix is tracked in crbug.com/600036
352 typedef PersistentHeapHashMap<Member<PaintLayerScrollableArea>, DoublePoint> ScrollPositionMap;
353 static void startDelayUpdateScrollInfo();
354 static bool finishDelayUpdateScrollInfo(SubtreeLayoutScope*, ScrollPositionM ap*);
355
356 void updateAfterLayout(); 338 void updateAfterLayout();
357 339
358 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e; 340 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e;
359 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 341 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
360 void updateFromStyle() override; 342 void updateFromStyle() override;
361 343
362 // Returns true if non-visible overflow should be respected. Otherwise hasOv erflowClip() will be 344 // Returns true if non-visible overflow should be respected. Otherwise hasOv erflowClip() will be
363 // false and we won't create scrollable area for this object even if overflo w is non-visible. 345 // false and we won't create scrollable area for this object even if overflo w is non-visible.
364 virtual bool allowsOverflowClip() const; 346 virtual bool allowsOverflowClip() const;
365 347
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // FIXME: This is temporary as we move code that accesses block flow 500 // FIXME: This is temporary as we move code that accesses block flow
519 // member variables out of LayoutBlock and into LayoutBlockFlow. 501 // member variables out of LayoutBlock and into LayoutBlockFlow.
520 friend class LayoutBlockFlow; 502 friend class LayoutBlockFlow;
521 }; 503 };
522 504
523 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 505 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
524 506
525 } // namespace blink 507 } // namespace blink
526 508
527 #endif // LayoutBlock_h 509 #endif // LayoutBlock_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698