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

Side by Side Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 924273003: Remove HitTestAction. (Closed) Base URL: git@github.com:domokit/mojo.git@hittestfilter
Patch Set: Created 5 years, 10 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 | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderParagraph.h » ('j') | 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) 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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 borderImage->removeClient(this); 1667 borderImage->removeClient(this);
1668 } 1668 }
1669 delete this; 1669 delete this;
1670 } 1670 }
1671 1671
1672 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&) 1672 PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&)
1673 { 1673 {
1674 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); 1674 return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM);
1675 } 1675 }
1676 1676
1677 // FIXME(sky): Change the callers to use nodeAtPoint direclty and remove this fu nction.
1678 // Or, rename nodeAtPoint to hitTest?
1677 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffse t) 1679 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffse t)
1678 { 1680 {
1679 // First test the foreground layer (lines and inlines). 1681 return nodeAtPoint(request, result, locationInContainer, accumulatedOffset);
1680 bool inside = nodeAtPoint(request, result, locationInContainer, accumulatedO ffset, HitTestForeground);
1681 // See if the mouse is inside us but not any of our descendants
1682 if (!inside)
1683 inside = nodeAtPoint(request, result, locationInContainer, accumulatedOf fset, HitTestBlockBackground);
1684 return inside;
1685 } 1682 }
1686 1683
1687 void RenderObject::updateHitTestResult(HitTestResult& result, const LayoutPoint& point) 1684 void RenderObject::updateHitTestResult(HitTestResult& result, const LayoutPoint& point)
1688 { 1685 {
1689 if (result.innerNode()) 1686 if (result.innerNode())
1690 return; 1687 return;
1691 1688
1692 Node* node = this->node(); 1689 Node* node = this->node();
1693 1690
1694 if (node) { 1691 if (node) {
1695 result.setInnerNode(node); 1692 result.setInnerNode(node);
1696 if (!result.innerNonSharedNode()) 1693 if (!result.innerNonSharedNode())
1697 result.setInnerNonSharedNode(node); 1694 result.setInnerNonSharedNode(node);
1698 result.setLocalPoint(point); 1695 result.setLocalPoint(point);
1699 } 1696 }
1700 } 1697 }
1701 1698
1702 bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitT estLocation& /*locationInContainer*/, const LayoutPoint& /*accumulatedOffset*/, HitTestAction) 1699 bool RenderObject::nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitT estLocation& /*locationInContainer*/, const LayoutPoint& /*accumulatedOffset*/)
1703 { 1700 {
1704 return false; 1701 return false;
1705 } 1702 }
1706 1703
1707 void RenderObject::scheduleRelayout() 1704 void RenderObject::scheduleRelayout()
1708 { 1705 {
1709 if (isRenderView()) { 1706 if (isRenderView()) {
1710 FrameView* view = toRenderView(this)->frameView(); 1707 FrameView* view = toRenderView(this)->frameView();
1711 if (view) 1708 if (view)
1712 view->scheduleRelayout(); 1709 view->scheduleRelayout();
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 1927
1931 bool RenderObject::canUpdateSelectionOnRootLineBoxes() 1928 bool RenderObject::canUpdateSelectionOnRootLineBoxes()
1932 { 1929 {
1933 if (needsLayout()) 1930 if (needsLayout())
1934 return false; 1931 return false;
1935 1932
1936 RenderBlock* containingBlock = this->containingBlock(); 1933 RenderBlock* containingBlock = this->containingBlock();
1937 return containingBlock ? !containingBlock->needsLayout() : false; 1934 return containingBlock ? !containingBlock->needsLayout() : false;
1938 } 1935 }
1939 1936
1940 bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint&, HitTestAction) 1937 bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint&)
1941 { 1938 {
1942 ASSERT_NOT_REACHED(); 1939 ASSERT_NOT_REACHED();
1943 return false; 1940 return false;
1944 } 1941 }
1945 1942
1946 bool RenderObject::isRelayoutBoundaryForInspector() const 1943 bool RenderObject::isRelayoutBoundaryForInspector() const
1947 { 1944 {
1948 return objectIsRelayoutBoundary(this); 1945 return objectIsRelayoutBoundary(this);
1949 } 1946 }
1950 1947
(...skipping 27 matching lines...) Expand all
1978 { 1975 {
1979 if (object1) { 1976 if (object1) {
1980 const blink::RenderObject* root = object1; 1977 const blink::RenderObject* root = object1;
1981 while (root->parent()) 1978 while (root->parent())
1982 root = root->parent(); 1979 root = root->parent();
1983 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 1980 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
1984 } 1981 }
1985 } 1982 }
1986 1983
1987 #endif 1984 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderParagraph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698