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

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

Issue 1164563006: Make sure distribution is updated in HitTestResult::title() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if (LayoutObject* layoutObject = m_innerNode->layoutObject()) 234 if (LayoutObject* layoutObject = m_innerNode->layoutObject())
235 dir = layoutObject->style()->direction(); 235 dir = layoutObject->style()->direction();
236 return marker->description(); 236 return marker->description();
237 } 237 }
238 238
239 String HitTestResult::title(TextDirection& dir) const 239 String HitTestResult::title(TextDirection& dir) const
240 { 240 {
241 dir = LTR; 241 dir = LTR;
242 // Find the title in the nearest enclosing DOM node. 242 // Find the title in the nearest enclosing DOM node.
243 // For <area> tags in image maps, walk the tree for the <area>, not the <img > using it. 243 // For <area> tags in image maps, walk the tree for the <area>, not the <img > using it.
244 if (m_innerNode.get())
245 m_innerNode->updateDistribution();
244 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = ComposedTre eTraversal::parent(*titleNode)) { 246 for (Node* titleNode = m_innerNode.get(); titleNode; titleNode = ComposedTre eTraversal::parent(*titleNode)) {
245 if (titleNode->isElementNode()) { 247 if (titleNode->isElementNode()) {
246 String title = toElement(titleNode)->title(); 248 String title = toElement(titleNode)->title();
247 if (!title.isNull()) { 249 if (!title.isNull()) {
248 if (LayoutObject* layoutObject = titleNode->layoutObject()) 250 if (LayoutObject* layoutObject = titleNode->layoutObject())
249 dir = layoutObject->style()->direction(); 251 dir = layoutObject->style()->direction();
250 return title; 252 return title;
251 } 253 }
252 } 254 }
253 } 255 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 else if (isHTMLMapElement(m_innerNode)) 511 else if (isHTMLMapElement(m_innerNode))
510 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); 512 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement();
511 513
512 if (!imageMapImageElement) 514 if (!imageMapImageElement)
513 return m_innerNode.get(); 515 return m_innerNode.get();
514 516
515 return imageMapImageElement; 517 return imageMapImageElement;
516 } 518 }
517 519
518 } // namespace blink 520 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698