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

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

Issue 855803002: Remove attrs sky doesn't support. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/engine/core/rendering/HitTestResult.h ('k') | sky/engine/web/WebViewImpl.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, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 DocumentMarker* marker = m_innerNonSharedNode->document().markers().markerCo ntainingPoint(m_hitTestLocation.point(), DocumentMarker::Grammar); 168 DocumentMarker* marker = m_innerNonSharedNode->document().markers().markerCo ntainingPoint(m_hitTestLocation.point(), DocumentMarker::Grammar);
169 if (!marker) 169 if (!marker)
170 return String(); 170 return String();
171 171
172 if (RenderObject* renderer = m_innerNonSharedNode->renderer()) 172 if (RenderObject* renderer = m_innerNonSharedNode->renderer())
173 dir = renderer->style()->direction(); 173 dir = renderer->style()->direction();
174 return marker->description(); 174 return marker->description();
175 } 175 }
176 176
177 String HitTestResult::title(TextDirection& dir) const
178 {
179 dir = LTR;
180 // Find the title in the nearest enclosing DOM node.
181 // For <area> tags in image maps, walk the tree for the <area>, not the <img > using it.
182 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode-> parentNode()) {
183 if (titleNode->isElementNode()) {
184 String title = toElement(titleNode)->title();
185 if (!title.isNull()) {
186 if (RenderObject* renderer = titleNode->renderer())
187 dir = renderer->style()->direction();
188 return title;
189 }
190 }
191 }
192 return String();
193 }
194
195 const AtomicString& HitTestResult::altDisplayString() const
196 {
197 if (!m_innerNonSharedNode)
198 return nullAtom;
199
200 if (isHTMLImageElement(*m_innerNonSharedNode)) {
201 HTMLImageElement& image = toHTMLImageElement(*m_innerNonSharedNode);
202 return image.getAttribute(HTMLNames::altAttr);
203 }
204
205 return nullAtom;
206 }
207
208 Image* HitTestResult::image() const 177 Image* HitTestResult::image() const
209 { 178 {
210 if (!m_innerNonSharedNode) 179 if (!m_innerNonSharedNode)
211 return 0; 180 return 0;
212 181
213 RenderObject* renderer = m_innerNonSharedNode->renderer(); 182 RenderObject* renderer = m_innerNonSharedNode->renderer();
214 if (renderer && renderer->isImage()) { 183 if (renderer && renderer->isImage()) {
215 RenderImage* image = toRenderImage(renderer); 184 RenderImage* image = toRenderImage(renderer);
216 if (image->cachedImage() && !image->cachedImage()->errorOccurred()) 185 if (image->cachedImage() && !image->cachedImage()->errorOccurred())
217 return image->cachedImage()->imageForRenderer(image); 186 return image->cachedImage()->imageForRenderer(image);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 { 363 {
395 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { 364 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) {
396 if (node->isElementNode()) 365 if (node->isElementNode())
397 return toElement(node); 366 return toElement(node);
398 } 367 }
399 368
400 return 0; 369 return 0;
401 } 370 }
402 371
403 } // namespace blink 372 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/HitTestResult.h ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698