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

Side by Side Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 248963002: Making LayoutUnit conversions to Int types explicit in core/accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@patch3
Patch Set: Created 6 years, 8 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 | « Source/core/accessibility/AXObject.cpp ('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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 IntPoint AXRenderObject::clickPoint() 1244 IntPoint AXRenderObject::clickPoint()
1245 { 1245 {
1246 // Headings are usually much wider than their textual content. If the mid po int is used, often it can be wrong. 1246 // Headings are usually much wider than their textual content. If the mid po int is used, often it can be wrong.
1247 if (isHeading() && children().size() == 1) 1247 if (isHeading() && children().size() == 1)
1248 return children()[0]->clickPoint(); 1248 return children()[0]->clickPoint();
1249 1249
1250 // use the default position unless this is an editable web area, in which ca se we use the selection bounds. 1250 // use the default position unless this is an editable web area, in which ca se we use the selection bounds.
1251 if (!isWebArea() || isReadOnly()) 1251 if (!isWebArea() || isReadOnly())
1252 return AXObject::clickPoint(); 1252 return AXObject::clickPoint();
1253 1253
1254 LayoutRect bounds = elementRect(); 1254 IntRect bounds = pixelSnappedIntRect(elementRect());
1255 return IntPoint(bounds.x() + (bounds.width() / 2), bounds.y() - (bounds.heig ht() / 2)); 1255 return IntPoint(bounds.x() + (bounds.width() / 2), bounds.y() - (bounds.heig ht() / 2));
1256 } 1256 }
1257 1257
1258 // 1258 //
1259 // Hit testing. 1259 // Hit testing.
1260 // 1260 //
1261 1261
1262 AXObject* AXRenderObject::accessibilityHitTest(const IntPoint& point) const 1262 AXObject* AXRenderObject::accessibilityHitTest(const IntPoint& point) const
1263 { 1263 {
1264 if (!m_renderer || !m_renderer->hasLayer()) 1264 if (!m_renderer || !m_renderer->hasLayer())
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 if (label && label->renderer()) { 2307 if (label && label->renderer()) {
2308 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2308 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2309 result.unite(labelRect); 2309 result.unite(labelRect);
2310 } 2310 }
2311 } 2311 }
2312 2312
2313 return result; 2313 return result;
2314 } 2314 }
2315 2315
2316 } // namespace WebCore 2316 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698