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

Side by Side Diff: third_party/WebKit/WebCore/page/AccessibilityRenderObject.cpp

Issue 6315: Allow HAVE_ACCESSIBILITY to be turned off at build time (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « third_party/WebKit/JavaScriptCore/wtf/Platform.h ('k') | webkit/port/page/AXObjectCacheMac.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) 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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 1582
1583 // if the rectangle spans lines and contains multiple text chars, use the ra nge's bounding box intead 1583 // if the rectangle spans lines and contains multiple text chars, use the ra nge's bounding box intead
1584 if (rect1.bottom() != rect2.bottom()) { 1584 if (rect1.bottom() != rect2.bottom()) {
1585 RefPtr<Range> dataRange = makeRange(range.start, range.end); 1585 RefPtr<Range> dataRange = makeRange(range.start, range.end);
1586 IntRect boundingBox = dataRange->boundingBox(); 1586 IntRect boundingBox = dataRange->boundingBox();
1587 String rangeString = plainText(dataRange.get()); 1587 String rangeString = plainText(dataRange.get());
1588 if (rangeString.length() > 1 && !boundingBox.isEmpty()) 1588 if (rangeString.length() > 1 && !boundingBox.isEmpty())
1589 ourrect = boundingBox; 1589 ourrect = boundingBox;
1590 } 1590 }
1591 1591
1592 #if PLATFORM(MAC) 1592 #if PLATFORM(MAC) && HAVE(ACCESSIBILITY)
1593 return m_renderer->document()->view()->contentsToScreen(ourrect); 1593 return m_renderer->document()->view()->contentsToScreen(ourrect);
1594 #else 1594 #else
1595 return ourrect; 1595 return ourrect;
1596 #endif 1596 #endif
1597 } 1597 }
1598 1598
1599 void AccessibilityRenderObject::setSelectedVisiblePositionRange(const VisiblePos itionRange& range) const 1599 void AccessibilityRenderObject::setSelectedVisiblePositionRange(const VisiblePos itionRange& range) const
1600 { 1600 {
1601 if (range.start.isNull() || range.end.isNull()) 1601 if (range.start.isNull() || range.end.isNull())
1602 return; 1602 return;
(...skipping 12 matching lines...) Expand all
1615 { 1615 {
1616 // convert absolute point to view coordinates 1616 // convert absolute point to view coordinates
1617 FrameView* frameView = m_renderer->document()->topDocument()->renderer()->vi ew()->frameView(); 1617 FrameView* frameView = m_renderer->document()->topDocument()->renderer()->vi ew()->frameView();
1618 RenderObject* renderer = topRenderer(); 1618 RenderObject* renderer = topRenderer();
1619 Node* innerNode = 0; 1619 Node* innerNode = 0;
1620 1620
1621 // locate the node containing the point 1621 // locate the node containing the point
1622 IntPoint pointResult; 1622 IntPoint pointResult;
1623 while (1) { 1623 while (1) {
1624 IntPoint ourpoint; 1624 IntPoint ourpoint;
1625 #if PLATFORM(MAC) 1625 #if PLATFORM(MAC) && HAVE(ACCESSIBILITY)
1626 ourpoint = frameView->screenToContents(point); 1626 ourpoint = frameView->screenToContents(point);
1627 #else 1627 #else
1628 ourpoint = point; 1628 ourpoint = point;
1629 #endif 1629 #endif
1630 HitTestRequest request(true, true); 1630 HitTestRequest request(true, true);
1631 HitTestResult result(ourpoint); 1631 HitTestResult result(ourpoint);
1632 renderer->layer()->hitTest(request, result); 1632 renderer->layer()->hitTest(request, result);
1633 innerNode = result.innerNode(); 1633 innerNode = result.innerNode();
1634 if (!innerNode || !innerNode->renderer()) 1634 if (!innerNode || !innerNode->renderer())
1635 return VisiblePosition(); 1635 return VisiblePosition();
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2281 case LinkRole: 2281 case LinkRole:
2282 case WebCoreLinkRole: 2282 case WebCoreLinkRole:
2283 return linkAction; 2283 return linkAction;
2284 default: 2284 default:
2285 return noAction; 2285 return noAction;
2286 } 2286 }
2287 } 2287 }
2288 2288
2289 2289
2290 } // namespace WebCore 2290 } // namespace WebCore
OLDNEW
« no previous file with comments | « third_party/WebKit/JavaScriptCore/wtf/Platform.h ('k') | webkit/port/page/AXObjectCacheMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698