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

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

Issue 1956033002: Move hit testing of lines and floats to LayoutBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/, SubtreeLayoutScope&); 321 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/, SubtreeLayoutScope&);
322 bool updateLogicalWidthAndColumnWidth() override; 322 bool updateLogicalWidthAndColumnWidth() override;
323 323
324 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); 324 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft);
325 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); 325 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop);
326 void determineLogicalLeftPositionForChild(LayoutBox& child); 326 void determineLogicalLeftPositionForChild(LayoutBox& child);
327 327
328 PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationState &) override; 328 PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationState &) override;
329 329
330 bool hitTestChildren(HitTestResult&, const HitTestLocation& locationInContai ner, const LayoutPoint& accumulatedOffset, HitTestAction) override;
331
330 private: 332 private:
331 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S ubtreeLayoutScope&); 333 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S ubtreeLayoutScope&);
332 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU nit beforeEdge, LayoutUnit afterEdge); 334 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU nit beforeEdge, LayoutUnit afterEdge);
333 335
334 void markDescendantsWithFloatsForLayoutIfNeeded(LayoutBlockFlow& child, Layo utUnit newLogicalTop, LayoutUnit previousFloatLogicalBottom); 336 void markDescendantsWithFloatsForLayoutIfNeeded(LayoutBlockFlow& child, Layo utUnit newLogicalTop, LayoutUnit previousFloatLogicalBottom);
335 bool positionAndLayoutOnceIfNeeded(LayoutBox& child, LayoutUnit newLogicalTo p, BlockChildrenLayoutInfo&); 337 bool positionAndLayoutOnceIfNeeded(LayoutBox& child, LayoutUnit newLogicalTo p, BlockChildrenLayoutInfo&);
336 338
337 // Handle breaking policy before the child, and insert a forced break in fro nt of it if needed. 339 // Handle breaking policy before the child, and insert a forced break in fro nt of it if needed.
338 // Returns true if a forced break was inserted. 340 // Returns true if a forced break was inserted.
339 bool insertForcedBreakBeforeChildIfNeeded(LayoutBox& child, BlockChildrenLay outInfo&); 341 bool insertForcedBreakBeforeChildIfNeeded(LayoutBox& child, BlockChildrenLay outInfo&);
(...skipping 10 matching lines...) Expand all
350 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos); 352 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos);
351 353
352 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF loatLogicalBottom() > logicalHeight(); } 354 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF loatLogicalBottom() > logicalHeight(); }
353 bool hasOverhangingFloat(LayoutBox*); 355 bool hasOverhangingFloat(LayoutBox*);
354 void addIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, LayoutUni t yoffset); 356 void addIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, LayoutUni t yoffset);
355 void addOverhangingFloats(LayoutBlockFlow* child, bool makeChildPaintOtherFl oats); 357 void addOverhangingFloats(LayoutBlockFlow* child, bool makeChildPaintOtherFl oats);
356 bool isOverhangingFloat(const FloatingObject& floatObject) const { return lo gicalBottomForFloat(floatObject) > logicalHeight(); } 358 bool isOverhangingFloat(const FloatingObject& floatObject) const { return lo gicalBottomForFloat(floatObject) > logicalHeight(); }
357 359
358 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F loatLeftRight) const; 360 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F loatLeftRight) const;
359 361
360 bool hitTestFloats(HitTestResult&, const HitTestLocation& locationInContaine r, const LayoutPoint& accumulatedOffset) final; 362 bool hitTestFloats(HitTestResult&, const HitTestLocation& locationInContaine r, const LayoutPoint& accumulatedOffset);
361 363
362 void invalidatePaintForOverhangingFloats(bool paintAllDescendants) final; 364 void invalidatePaintForOverhangingFloats(bool paintAllDescendants) final;
363 void invalidatePaintForOverflow() final; 365 void invalidatePaintForOverflow() final;
364 void paintFloats(const PaintInfo&, const LayoutPoint&) const final; 366 void paintFloats(const PaintInfo&, const LayoutPoint&) const final;
365 virtual void clipOutFloatingObjects(const LayoutBlock*, ClipScope&, const La youtPoint&, const LayoutSize&) const; 367 virtual void clipOutFloatingObjects(const LayoutBlock*, ClipScope&, const La youtPoint&, const LayoutSize&) const;
366 void clearFloats(EClear); 368 void clearFloats(EClear);
367 369
368 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const; 370 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const;
369 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f ixedOffset, LayoutUnit logicalHeight) const; 371 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f ixedOffset, LayoutUnit logicalHeight) const;
370 372
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 622
621 // END METHODS DEFINED IN LayoutBlockFlowLine 623 // END METHODS DEFINED IN LayoutBlockFlowLine
622 624
623 }; 625 };
624 626
625 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); 627 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow());
626 628
627 } // namespace blink 629 } // namespace blink
628 630
629 #endif // LayoutBlockFlow_h 631 #endif // LayoutBlockFlow_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698