OLD | NEW |
---|---|
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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1006 lineLayoutItem().updateHitTestResult(result, locationInContainer.poi nt() - toLayoutSize(accumulatedOffset)); | 1006 lineLayoutItem().updateHitTestResult(result, locationInContainer.poi nt() - toLayoutSize(accumulatedOffset)); |
1007 return true; | 1007 return true; |
1008 } | 1008 } |
1009 | 1009 |
1010 // If the current inline box's layout object and the previous inline box 's layout object are same, | 1010 // If the current inline box's layout object and the previous inline box 's layout object are same, |
1011 // we should yield the hit-test to the previous inline box. | 1011 // we should yield the hit-test to the previous inline box. |
1012 if (prev && curr->lineLayoutItem() == prev->lineLayoutItem()) | 1012 if (prev && curr->lineLayoutItem() == prev->lineLayoutItem()) |
1013 continue; | 1013 continue; |
1014 | 1014 |
1015 // If a parent of the current inline box is a culled inline, | 1015 // If a parent of the current inline box is a culled inline, |
1016 // we hit test it before we move the previous inline box. | 1016 // we hit test it before we move the previous inline box. |
Xianzhu
2016/01/14 21:45:25
Can you also update the comments which seem inaccu
nolan.robin.cao
2016/01/15 03:25:33
Yes, it's not consistent with comments inside the
Xianzhu
2016/01/15 05:09:41
This sgtm.
| |
1017 LineLayoutItem currLayoutItem = curr->lineLayoutItem(); | 1017 LineLayoutItem currLayoutItem = curr->lineLayoutItem(); |
1018 while (true) { | 1018 while (true) { |
1019 // If the previous inline box is not a descendant of a current inlin e's parent, | 1019 // If the previous inline box is not a descendant of a current inlin e's parent, |
1020 // the parent is a culled inline and we hit test it. | 1020 // the parent is a culled inline and we hit test it. |
1021 // Otherwise, move to the previous inline box because we hit test fi rst all | 1021 // Otherwise, move to the previous inline box because we hit test fi rst all |
1022 // candidate inline boxes under the parent to take a pre-order tree traversal in reverse. | 1022 // candidate inline boxes under the parent to take a pre-order tree traversal in reverse. |
1023 bool hasSibling = currLayoutItem.previousSibling() || currLayoutItem .nextSibling(); | 1023 bool hasSibling = currLayoutItem.previousSibling() || currLayoutItem .nextSibling(); |
1024 LineLayoutItem culledParent = currLayoutItem.parent(); | 1024 LineLayoutItem culledParent = currLayoutItem.parent(); |
1025 ASSERT(culledParent); | 1025 ASSERT(culledParent); |
1026 | 1026 |
1027 if (culledParent == lineLayoutItem() || (hasSibling && prev && prev- >lineLayoutItem().isDescendantOf(culledParent))) | 1027 if (culledParent == lineLayoutItem() || (hasSibling && prev && prev- >lineLayoutItem().isDescendantOf(culledParent) && !(prev->boxModelObject() && pr ev->boxModelObject().hasSelfPaintingLayer()))) |
Xianzhu
2016/01/14 21:45:25
I think this is to workaround the 'continue' at li
nolan.robin.cao
2016/01/15 03:25:33
Good point!
| |
1028 break; | 1028 break; |
1029 | 1029 |
1030 if (culledParent.isLayoutInline() && LineLayoutInline(culledParent). hitTestCulledInline(result, locationInContainer, accumulatedOffset)) | 1030 if (culledParent.isLayoutInline() && LineLayoutInline(culledParent). hitTestCulledInline(result, locationInContainer, accumulatedOffset)) |
1031 return true; | 1031 return true; |
1032 | 1032 |
1033 currLayoutItem = culledParent; | 1033 currLayoutItem = culledParent; |
1034 } | 1034 } |
1035 } | 1035 } |
1036 | 1036 |
1037 if (lineLayoutItem().style()->hasBorderRadius()) { | 1037 if (lineLayoutItem().style()->hasBorderRadius()) { |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1314 ASSERT(child->prevOnLine() == prev); | 1314 ASSERT(child->prevOnLine() == prev); |
1315 prev = child; | 1315 prev = child; |
1316 } | 1316 } |
1317 ASSERT(prev == m_lastChild); | 1317 ASSERT(prev == m_lastChild); |
1318 #endif | 1318 #endif |
1319 } | 1319 } |
1320 | 1320 |
1321 #endif | 1321 #endif |
1322 | 1322 |
1323 } // namespace blink | 1323 } // namespace blink |
OLD | NEW |