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

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

Issue 462073003: Handle empty title attribute tooltips. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « LayoutTests/fast/html/a-tooltip-null-expected.txt ('k') | no next file » | 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 String HitTestResult::title(TextDirection& dir) const 227 String HitTestResult::title(TextDirection& dir) const
228 { 228 {
229 dir = LTR; 229 dir = LTR;
230 // Find the title in the nearest enclosing DOM node. 230 // Find the title in the nearest enclosing DOM node.
231 // For <area> tags in image maps, walk the tree for the <area>, not the <img > using it. 231 // For <area> tags in image maps, walk the tree for the <area>, not the <img > using it.
232 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode-> parentNode()) { 232 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = titleNode-> parentNode()) {
233 if (titleNode->isElementNode()) { 233 if (titleNode->isElementNode()) {
234 String title = toElement(titleNode)->title(); 234 String title = toElement(titleNode)->title();
235 if (!title.isEmpty()) { 235 if (!title.isNull()) {
236 if (RenderObject* renderer = titleNode->renderer()) 236 if (RenderObject* renderer = titleNode->renderer())
237 dir = renderer->style()->direction(); 237 dir = renderer->style()->direction();
238 return title; 238 return title;
239 } 239 }
240 } 240 }
241 } 241 }
242 return String(); 242 return String();
243 } 243 }
244 244
245 const AtomicString& HitTestResult::altDisplayString() const 245 const AtomicString& HitTestResult::altDisplayString() const
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 { 477 {
478 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { 478 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) {
479 if (node->isElementNode()) 479 if (node->isElementNode())
480 return toElement(node); 480 return toElement(node);
481 } 481 }
482 482
483 return 0; 483 return 0;
484 } 484 }
485 485
486 } // namespace blink 486 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/html/a-tooltip-null-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698