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

Side by Side Diff: Source/core/rendering/HitTestResult.h

Issue 457013002: Avoid absoluteImageURL() creating data URLs for canvas by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix failing copyImageAt unit test Created 6 years, 4 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 | « no previous file | Source/core/rendering/HitTestResult.cpp » ('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) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void setIsFirstLetter(bool b) { m_isFirstLetter = b; } 99 void setIsFirstLetter(bool b) { m_isFirstLetter = b; }
100 void setIsOverWidget(bool b) { m_isOverWidget = b; } 100 void setIsOverWidget(bool b) { m_isOverWidget = b; }
101 101
102 bool isSelected() const; 102 bool isSelected() const;
103 String spellingToolTip(TextDirection&) const; 103 String spellingToolTip(TextDirection&) const;
104 String title(TextDirection&) const; 104 String title(TextDirection&) const;
105 const AtomicString& altDisplayString() const; 105 const AtomicString& altDisplayString() const;
106 Image* image() const; 106 Image* image() const;
107 IntRect imageRect() const; 107 IntRect imageRect() const;
108 KURL absoluteImageURL() const; 108 KURL absoluteImageURL() const;
109 // This variant of absoluteImageURL will also convert <canvas> elements
110 // to huge image data URLs (very expensive).
111 KURL absoluteImageURLIncludingCanvasDataURL() const;
109 KURL absoluteMediaURL() const; 112 KURL absoluteMediaURL() const;
110 KURL absoluteLinkURL() const; 113 KURL absoluteLinkURL() const;
111 String textContent() const; 114 String textContent() const;
112 bool isLiveLink() const; 115 bool isLiveLink() const;
113 bool isMisspelled() const; 116 bool isMisspelled() const;
114 bool isContentEditable() const; 117 bool isContentEditable() const;
115 118
116 bool isOverLink() const; 119 bool isOverLink() const;
117 // Returns true if it is rect-based hit test and needs to continue until the rect is fully 120 // Returns true if it is rect-based hit test and needs to continue until the rect is fully
118 // enclosed by the boundaries of a node. 121 // enclosed by the boundaries of a node.
119 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes tLocation& pointInContainer, const LayoutRect& = LayoutRect()); 122 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes tLocation& pointInContainer, const LayoutRect& = LayoutRect());
120 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes tLocation& pointInContainer, const FloatRect&); 123 bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTes tLocation& pointInContainer, const FloatRect&);
121 void append(const HitTestResult&); 124 void append(const HitTestResult&);
122 125
123 // If m_rectBasedTestResult is 0 then set it to a new NodeSet. Return *m_rec tBasedTestResult. Lazy allocation makes 126 // If m_rectBasedTestResult is 0 then set it to a new NodeSet. Return *m_rec tBasedTestResult. Lazy allocation makes
124 // sense because the NodeSet is seldom necessary, and it's somewhat expensiv e to allocate and initialize. This method does 127 // sense because the NodeSet is seldom necessary, and it's somewhat expensiv e to allocate and initialize. This method does
125 // the same thing as mutableRectBasedTestResult(), but here the return value is const. 128 // the same thing as mutableRectBasedTestResult(), but here the return value is const.
126 const NodeSet& rectBasedTestResult() const; 129 const NodeSet& rectBasedTestResult() const;
127 130
128 // Collapse the rect-based test result into a single target at the specified location. 131 // Collapse the rect-based test result into a single target at the specified location.
129 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv edPointInMainFrame); 132 void resolveRectBasedTest(Node* resolvedInnerNode, const LayoutPoint& resolv edPointInMainFrame);
130 133
131 // FIXME: Remove this. 134 // FIXME: Remove this.
132 Node* targetNode() const { return innerNode(); } 135 Node* targetNode() const { return innerNode(); }
133 136
134 private: 137 private:
138 KURL absoluteImageURLInternal(bool allowCanvas) const;
135 NodeSet& mutableRectBasedTestResult(); // See above. 139 NodeSet& mutableRectBasedTestResult(); // See above.
136 HTMLMediaElement* mediaElement() const; 140 HTMLMediaElement* mediaElement() const;
137 141
138 HitTestLocation m_hitTestLocation; 142 HitTestLocation m_hitTestLocation;
139 143
140 RefPtrWillBeMember<Node> m_innerNode; 144 RefPtrWillBeMember<Node> m_innerNode;
141 RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode; 145 RefPtrWillBeMember<Node> m_innerPossiblyPseudoNode;
142 RefPtrWillBeMember<Node> m_innerNonSharedNode; 146 RefPtrWillBeMember<Node> m_innerNonSharedNode;
143 // FIXME: Nothing changes this to a value different from m_hitTestLocation! 147 // FIXME: Nothing changes this to a value different from m_hitTestLocation!
144 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr ame coordinates. 148 LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode fr ame coordinates.
145 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne rNonSharedNode's renderer. Allows us to efficiently 149 LayoutPoint m_localPoint; // A point in the local coordinate space of m_inne rNonSharedNode's renderer. Allows us to efficiently
146 // determine where inside the renderer we hit on s ubsequent operations. 150 // determine where inside the renderer we hit on s ubsequent operations.
147 RefPtrWillBeMember<Element> m_innerURLElement; 151 RefPtrWillBeMember<Element> m_innerURLElement;
148 RefPtr<Scrollbar> m_scrollbar; 152 RefPtr<Scrollbar> m_scrollbar;
149 bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example). 153 bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example).
150 bool m_isFirstLetter; 154 bool m_isFirstLetter;
151 155
152 mutable OwnPtrWillBeMember<NodeSet> m_rectBasedTestResult; 156 mutable OwnPtrWillBeMember<NodeSet> m_rectBasedTestResult;
153 }; 157 };
154 158
155 } // namespace blink 159 } // namespace blink
156 160
157 #endif // HitTestResult_h 161 #endif // HitTestResult_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/HitTestResult.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698