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

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

Issue 2386553002: Hit test floats in visual painting order (Closed)
Patch Set: Created 4 years, 2 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/LayoutTests/hittesting/hittest-overlapping-floats.html ('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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 { 3263 {
3264 // If we are in the margins of block elements that are part of a 3264 // If we are in the margins of block elements that are part of a
3265 // continuation we're actually still inside the enclosing element 3265 // continuation we're actually still inside the enclosing element
3266 // that was split. Use the appropriate inner node. 3266 // that was split. Use the appropriate inner node.
3267 return isAnonymousBlockContinuation() ? continuation()->node() : node(); 3267 return isAnonymousBlockContinuation() ? continuation()->node() : node();
3268 } 3268 }
3269 3269
3270 bool LayoutBlockFlow::hitTestChildren(HitTestResult& result, const HitTestLocati on& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hit TestAction) 3270 bool LayoutBlockFlow::hitTestChildren(HitTestResult& result, const HitTestLocati on& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hit TestAction)
3271 { 3271 {
3272 LayoutPoint scrolledOffset(hasOverflowClip() ? accumulatedOffset - scrolledC ontentOffset() : accumulatedOffset); 3272 LayoutPoint scrolledOffset(hasOverflowClip() ? accumulatedOffset - scrolledC ontentOffset() : accumulatedOffset);
3273
3274 if (hitTestAction == HitTestFloat && hitTestFloats(result, locationInContain er, scrolledOffset))
3275 return true;
3276
3273 if (childrenInline()) { 3277 if (childrenInline()) {
3274 if (m_lineBoxes.hitTest(LineLayoutBoxModel(this), result, locationInCont ainer, scrolledOffset, hitTestAction)) { 3278 if (m_lineBoxes.hitTest(LineLayoutBoxModel(this), result, locationInCont ainer, scrolledOffset, hitTestAction)) {
3275 updateHitTestResult(result, flipForWritingMode(toLayoutPoint(locatio nInContainer.point() - accumulatedOffset))); 3279 updateHitTestResult(result, flipForWritingMode(toLayoutPoint(locatio nInContainer.point() - accumulatedOffset)));
3276 return true; 3280 return true;
3277 } 3281 }
3278 } else if (LayoutBlock::hitTestChildren(result, locationInContainer, accumul atedOffset, hitTestAction)) { 3282 } else if (LayoutBlock::hitTestChildren(result, locationInContainer, accumul atedOffset, hitTestAction)) {
3279 return true; 3283 return true;
3280 } 3284 }
3281 3285
3282 if (hitTestAction == HitTestFloat && hitTestFloats(result, locationInContain er, scrolledOffset))
3283 return true;
3284
3285 return false; 3286 return false;
3286 } 3287 }
3287 3288
3288 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, const HitTestLocation & locationInContainer, const LayoutPoint& accumulatedOffset) 3289 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, const HitTestLocation & locationInContainer, const LayoutPoint& accumulatedOffset)
3289 { 3290 {
3290 if (!m_floatingObjects) 3291 if (!m_floatingObjects)
3291 return false; 3292 return false;
3292 3293
3293 LayoutPoint adjustedLocation = accumulatedOffset; 3294 LayoutPoint adjustedLocation = accumulatedOffset;
3294 if (isLayoutView()) { 3295 if (isLayoutView()) {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3777 3778
3778 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 3779 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
3779 } 3780 }
3780 3781
3781 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval idationReason) const 3782 void LayoutBlockFlow::invalidateDisplayItemClients(PaintInvalidationReason inval idationReason) const
3782 { 3783 {
3783 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe ason); 3784 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(invalidationRe ason);
3784 } 3785 }
3785 3786
3786 } // namespace blink 3787 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/hittesting/hittest-overlapping-floats.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698