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

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

Issue 1630793002: Stop hit testing culled inlines when a match is found (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simpler approach, but duplicated code Created 4 years, 11 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, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 if (!locationInContainer.intersects(border)) 1039 if (!locationInContainer.intersects(border))
1040 return false; 1040 return false;
1041 } 1041 }
1042 1042
1043 // Now check ourselves. 1043 // Now check ourselves.
1044 LayoutRect rect = InlineFlowBoxPainter(*this).frameRectClampedToLineTopAndBo ttomIfNeeded(); 1044 LayoutRect rect = InlineFlowBoxPainter(*this).frameRectClampedToLineTopAndBo ttomIfNeeded();
1045 1045
1046 flipForWritingMode(rect); 1046 flipForWritingMode(rect);
1047 rect.moveBy(accumulatedOffset); 1047 rect.moveBy(accumulatedOffset);
1048 1048
1049 // Pixel snap hit testing. 1049 // Pixel snap hit testing.
1050 rect = LayoutRect(pixelSnappedIntRect(rect)); 1050 rect = LayoutRect(pixelSnappedIntRect(rect));
1051 if (visibleToHitTestRequest(result.hitTestRequest()) && locationInContainer. intersects(rect)) { 1051 if (visibleToHitTestRequest(result.hitTestRequest()) && locationInContainer. intersects(rect)) {
1052 lineLayoutItem().updateHitTestResult(result, flipForWritingMode(location InContainer.point() - toLayoutSize(accumulatedOffset))); // Don't add in m_topLe ft here, we want coords in the containing block's space. 1052 lineLayoutItem().updateHitTestResult(result, flipForWritingMode(location InContainer.point() - toLayoutSize(accumulatedOffset))); // Don't add in m_topLe ft here, we want coords in the containing block's space.
1053 if (!result.addNodeToListBasedTestResult(lineLayoutItem().node(), locati onInContainer, rect)) 1053 if (result.addNodeToListBasedTestResult(lineLayoutItem().node(), locatio nInContainer, rect) == StopHitTesting)
1054 return true; 1054 return true;
1055 } 1055 }
1056 1056
1057 return false; 1057 return false;
1058 } 1058 }
1059 1059
1060 void InlineFlowBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf fset, LayoutUnit lineTop, LayoutUnit lineBottom) const 1060 void InlineFlowBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf fset, LayoutUnit lineTop, LayoutUnit lineBottom) const
1061 { 1061 {
1062 InlineFlowBoxPainter(*this).paint(paintInfo, paintOffset, lineTop, lineBotto m); 1062 InlineFlowBoxPainter(*this).paint(paintInfo, paintOffset, lineTop, lineBotto m);
1063 } 1063 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 ASSERT(child->prevOnLine() == prev); 1312 ASSERT(child->prevOnLine() == prev);
1313 prev = child; 1313 prev = child;
1314 } 1314 }
1315 ASSERT(prev == m_lastChild); 1315 ASSERT(prev == m_lastChild);
1316 #endif 1316 #endif
1317 } 1317 }
1318 1318
1319 #endif 1319 #endif
1320 1320
1321 } // namespace blink 1321 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698