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

Side by Side Diff: Source/core/layout/LayoutObject.cpp

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 inside = nodeAtPoint(result, locationInContainer, accumulatedOffset, HitTestChildBlockBackgrounds); 2651 inside = nodeAtPoint(result, locationInContainer, accumulatedOffset, HitTestChildBlockBackgrounds);
2652 } 2652 }
2653 2653
2654 // See if the mouse is inside us but not any of our descendants 2654 // See if the mouse is inside us but not any of our descendants
2655 if (hitTestFilter != HitTestDescendants && !inside) 2655 if (hitTestFilter != HitTestDescendants && !inside)
2656 inside = nodeAtPoint(result, locationInContainer, accumulatedOffset, Hit TestBlockBackground); 2656 inside = nodeAtPoint(result, locationInContainer, accumulatedOffset, Hit TestBlockBackground);
2657 2657
2658 return inside; 2658 return inside;
2659 } 2659 }
2660 2660
2661 void LayoutObject::updateHitTestResult(HitTestResult& result, const LayoutPoint& point) 2661 void LayoutObject::updateHitTestResult(HitTestResult& result, const LayoutPoint& point, const LayoutRect& rect)
2662 { 2662 {
2663 if (result.innerNode()) 2663 if (result.innerNode())
2664 return; 2664 return;
2665 2665
2666 result.intersectValidityRect(rect);
2666 Node* node = this->node(); 2667 Node* node = this->node();
2667 2668
2668 // If we hit the anonymous layoutObjects inside generated content we should 2669 // If we hit the anonymous layoutObjects inside generated content we should
2669 // actually hit the generated content so walk up to the PseudoElement. 2670 // actually hit the generated content so walk up to the PseudoElement.
2670 if (!node && parent() && parent()->isBeforeOrAfterContent()) { 2671 if (!node && parent() && parent()->isBeforeOrAfterContent()) {
2671 for (LayoutObject* layoutObject = parent(); layoutObject && !node; layou tObject = layoutObject->parent()) 2672 for (LayoutObject* layoutObject = parent(); layoutObject && !node; layou tObject = layoutObject->parent())
2672 node = layoutObject->node(); 2673 node = layoutObject->node();
2673 } 2674 }
2674 2675
2675 if (node) 2676 if (node)
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
3295 const blink::LayoutObject* root = object1; 3296 const blink::LayoutObject* root = object1;
3296 while (root->parent()) 3297 while (root->parent())
3297 root = root->parent(); 3298 root = root->parent();
3298 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3299 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3299 } else { 3300 } else {
3300 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3301 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3301 } 3302 }
3302 } 3303 }
3303 3304
3304 #endif 3305 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698