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

Side by Side Diff: third_party/WebKit/Source/web/WebAXObject.cpp

Issue 2047873002: Add interface to get relative bounding box rect of AX objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback from aboxhall, add aria-owns test Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/input/EventHandler.h" 42 #include "core/input/EventHandler.h"
43 #include "core/style/ComputedStyle.h" 43 #include "core/style/ComputedStyle.h"
44 #include "core/page/Page.h" 44 #include "core/page/Page.h"
45 #include "modules/accessibility/AXObject.h" 45 #include "modules/accessibility/AXObject.h"
46 #include "modules/accessibility/AXObjectCacheImpl.h" 46 #include "modules/accessibility/AXObjectCacheImpl.h"
47 #include "modules/accessibility/AXTable.h" 47 #include "modules/accessibility/AXTable.h"
48 #include "modules/accessibility/AXTableCell.h" 48 #include "modules/accessibility/AXTableCell.h"
49 #include "modules/accessibility/AXTableColumn.h" 49 #include "modules/accessibility/AXTableColumn.h"
50 #include "modules/accessibility/AXTableRow.h" 50 #include "modules/accessibility/AXTableRow.h"
51 #include "platform/PlatformKeyboardEvent.h" 51 #include "platform/PlatformKeyboardEvent.h"
52 #include "public/platform/WebFloatRect.h"
52 #include "public/platform/WebPoint.h" 53 #include "public/platform/WebPoint.h"
53 #include "public/platform/WebRect.h" 54 #include "public/platform/WebRect.h"
54 #include "public/platform/WebString.h" 55 #include "public/platform/WebString.h"
55 #include "public/platform/WebURL.h" 56 #include "public/platform/WebURL.h"
56 #include "public/web/WebDocument.h" 57 #include "public/web/WebDocument.h"
57 #include "public/web/WebElement.h" 58 #include "public/web/WebElement.h"
58 #include "public/web/WebNode.h" 59 #include "public/web/WebNode.h"
59 #include "web/WebLocalFrameImpl.h" 60 #include "web/WebLocalFrameImpl.h"
60 #include "web/WebViewImpl.h" 61 #include "web/WebViewImpl.h"
61 #include "wtf/text/StringBuilder.h" 62 #include "wtf/text/StringBuilder.h"
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 } 1521 }
1521 1522
1522 void WebAXObject::setScrollOffset(const WebPoint& offset) const 1523 void WebAXObject::setScrollOffset(const WebPoint& offset) const
1523 { 1524 {
1524 if (isDetached()) 1525 if (isDetached())
1525 return; 1526 return;
1526 1527
1527 m_private->setScrollOffset(offset); 1528 m_private->setScrollOffset(offset);
1528 } 1529 }
1529 1530
1531 void WebAXObject::getRelativeBounds(WebAXObject& offsetContainer, WebFloatRect& boundsInContainer, SkMatrix44& containerTransform) const
1532 {
1533 if (isDetached())
1534 return;
1535
1536 #if DCHECK_IS_ON()
1537 DCHECK(isLayoutClean(m_private->getDocument()));
1538 #endif
1539
1540 AXObject* container = nullptr;
1541 FloatRect bounds;
1542 m_private->getRelativeBounds(&container, bounds, containerTransform);
1543 offsetContainer = WebAXObject(container);
1544 boundsInContainer = WebFloatRect(bounds);
1545 }
1546
1530 void WebAXObject::scrollToMakeVisible() const 1547 void WebAXObject::scrollToMakeVisible() const
1531 { 1548 {
1532 if (!isDetached()) 1549 if (!isDetached())
1533 m_private->scrollToMakeVisible(); 1550 m_private->scrollToMakeVisible();
1534 } 1551 }
1535 1552
1536 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const 1553 void WebAXObject::scrollToMakeVisibleWithSubFocus(const WebRect& subfocus) const
1537 { 1554 {
1538 if (!isDetached()) 1555 if (!isDetached())
1539 m_private->scrollToMakeVisibleWithSubFocus(subfocus); 1556 m_private->scrollToMakeVisibleWithSubFocus(subfocus);
(...skipping 23 matching lines...) Expand all
1563 m_private = object; 1580 m_private = object;
1564 return *this; 1581 return *this;
1565 } 1582 }
1566 1583
1567 WebAXObject::operator AXObject*() const 1584 WebAXObject::operator AXObject*() const
1568 { 1585 {
1569 return m_private.get(); 1586 return m_private.get();
1570 } 1587 }
1571 1588
1572 } // namespace blink 1589 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXObject.cpp ('k') | third_party/WebKit/public/web/WebAXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698