Commit 503e4970 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[LayoutNG] Bugfix: Can't hit NG scrollbars

Bug: 841587
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I5454aa1fd7f48e4034b4379f5cd97ba17961c777
Reviewed-on: https://chromium-review.googlesource.com/1066929
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560227}
parent 6f18d6ec
...@@ -452,6 +452,11 @@ class CORE_EXPORT LayoutBlock : public LayoutBox { ...@@ -452,6 +452,11 @@ class CORE_EXPORT LayoutBlock : public LayoutBox {
bool NeedsPreferredWidthsRecalculation() const override; bool NeedsPreferredWidthsRecalculation() const override;
bool IsInSelfHitTestingPhase(HitTestAction hit_test_action) const final {
return hit_test_action == kHitTestBlockBackground ||
hit_test_action == kHitTestChildBlockBackground;
}
private: private:
LayoutObjectChildList* VirtualChildren() final { return Children(); } LayoutObjectChildList* VirtualChildren() final { return Children(); }
const LayoutObjectChildList* VirtualChildren() const final { const LayoutObjectChildList* VirtualChildren() const final {
...@@ -468,11 +473,6 @@ class CORE_EXPORT LayoutBlock : public LayoutBox { ...@@ -468,11 +473,6 @@ class CORE_EXPORT LayoutBlock : public LayoutBox {
// Returns true if the positioned movement-only layout succeeded. // Returns true if the positioned movement-only layout succeeded.
bool TryLayoutDoingPositionedMovementOnly(); bool TryLayoutDoingPositionedMovementOnly();
bool IsInSelfHitTestingPhase(HitTestAction hit_test_action) const final {
return hit_test_action == kHitTestBlockBackground ||
hit_test_action == kHitTestChildBlockBackground;
}
bool IsPointInOverflowControl(HitTestResult&, bool IsPointInOverflowControl(HitTestResult&,
const LayoutPoint& location_in_container, const LayoutPoint& location_in_container,
const LayoutPoint& accumulated_offset) const; const LayoutPoint& accumulated_offset) const;
......
...@@ -250,6 +250,10 @@ bool LayoutNGMixin<Base>::NodeAtPoint( ...@@ -250,6 +250,10 @@ bool LayoutNGMixin<Base>::NodeAtPoint(
if (!location_in_container.Intersects(overflow_box)) if (!location_in_container.Intersects(overflow_box))
return false; return false;
} }
if (Base::IsInSelfHitTestingPhase(action) && Base::HasOverflowClip() &&
Base::HitTestOverflowControl(result, location_in_container,
adjusted_location))
return true;
return NGBlockFlowPainter(*this).NodeAtPoint(result, location_in_container, return NGBlockFlowPainter(*this).NodeAtPoint(result, location_in_container,
accumulated_offset, accumulated_offset,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment