~ubuntu-branches/ubuntu/jaunty/xulrunner-1.9/jaunty

« back to all changes in this revision

Viewing changes to mozilla/accessible/src/base/nsAccessibilityService.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin, Sasa Bodiroza, Fabien Tassin, Alexander Sack
  • Date: 2008-09-02 11:54:00 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080902115400-yfy26crvszpalvg5
Tags: 1.9.0.2+build3+nobinonly-0ubuntu1
[ Sasa Bodiroza ]
* In debian/rules:
  - Set 644 chmod to png files (LP: #252793) [Patch by Paolo Naldini]

[ Fabien Tassin ]
* improve create-build-system.sh to detect build-tree directory
  when embedded tarball is used. Fix un-escaped variables.
  Create build-system.tar.gz in the debian directory to prevent
  cdbs to check and unpack it during the build
  - update debian/create-build-system.sh
* Fix variables when an embedded tarball is used
  - update debian/rules
* Fix buffer overflow in realpath() at runtime and drop -U_FORTIFY_SOURCE
  from CPPFLAGS (LP: #263014)
  - add debian/patches/bz412610_att335369_realpath_overflow.patch
  - update debian/patches/series

[ Alexander Sack <asac@jwsdot.com> ]
* introduce preferred plugins by mime-type experimental feature;
  you can now set a pref to explicitly select a plugin to serve a particilar
  mime-type; patch contains further documentation.
  - add debian/patches/bzXXX_plugin_for_mimetype_pref.patch
  - update debian/patches/series
* drop patches applied upstream
  - drop bz120380_att326044.patch (fixed by bz442629)
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
1328
1328
  }
1329
1329
#endif
1330
1330
 
1331
 
  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
1332
 
  if (content && content->Tag() == nsAccessibilityAtoms::map) {
1333
 
    // Don't walk into maps, they take up no space.
1334
 
    // The nsHTMLAreaAccessible's they contain are attached as
1335
 
    // children of the appropriate nsHTMLImageAccessible.
1336
 
    *aIsHidden = PR_TRUE;
1337
 
    return NS_OK;
1338
 
  }
1339
 
 
1340
1331
  // Check to see if we already have an accessible for this
1341
1332
  // node in the cache
1342
1333
  nsCOMPtr<nsIAccessNode> accessNode;
1344
1335
 
1345
1336
  nsCOMPtr<nsIAccessible> newAcc;
1346
1337
  if (accessNode) {
1347
 
    // Retrieved from cache
1348
 
    // QI might not succeed if it's a node that's not accessible
 
1338
    // Retrieved from cache. QI might not succeed if it's a node that's not
 
1339
    // accessible. In this case try to create new accessible because one and
 
1340
    // the same DOM node may be accessible or not in time (for example,
 
1341
    // when it is visible or hidden).
1349
1342
    newAcc = do_QueryInterface(accessNode);
1350
 
    NS_IF_ADDREF(*aAccessible = newAcc);
1351
 
    return NS_OK;
 
1343
    if (newAcc) {
 
1344
      NS_ADDREF(*aAccessible = newAcc);
 
1345
      return NS_OK;
 
1346
    }
1352
1347
  }
1353
1348
 
 
1349
  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 
1350
 
1354
1351
  // No cache entry, so we must create the accessible
1355
1352
  // Check to see if hidden first
1356
1353
  nsCOMPtr<nsIDocument> nodeIsDoc;
1461
1458
    return InitAccessible(newAcc, aAccessible, nsnull);
1462
1459
  }
1463
1460
 
 
1461
  PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
 
1462
  if (isHTML && content->Tag() == nsAccessibilityAtoms::map) {
 
1463
    // Create hyper text accessible for HTML map if it is used to group links
 
1464
    // (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
 
1465
    // map doesn't have 'name' attribute (or has empty name attribute) then we
 
1466
    // suppose it is used for links grouping. Otherwise we think it is used in
 
1467
    // conjuction with HTML image element and in this case we don't create any
 
1468
    // accessible for it and don't walk into it. The accessibles for HTML area
 
1469
    // (nsHTMLAreaAccessible) the map contains are attached as children of the
 
1470
    // appropriate accessible for HTML image (nsHTMLImageAccessible).
 
1471
    nsAutoString name;
 
1472
    content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::name, name);
 
1473
    if (!name.IsEmpty()) {
 
1474
      *aIsHidden = PR_TRUE;
 
1475
      return NS_OK;
 
1476
    }
 
1477
    
 
1478
    nsresult rv = CreateHyperTextAccessible(frame, getter_AddRefs(newAcc));
 
1479
    NS_ENSURE_SUCCESS(rv, rv);
 
1480
  }
 
1481
 
1464
1482
  nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(aNode);
1465
1483
  if (roleMapEntry && !nsCRT::strcmp(roleMapEntry->roleString, "presentation") &&
1466
1484
      !content->IsFocusable()) { // For presentation only
1474
1492
  // say what kind of accessible to create.
1475
1493
  nsresult rv = GetAccessibleByType(aNode, getter_AddRefs(newAcc));
1476
1494
  NS_ENSURE_SUCCESS(rv, rv);
1477
 
  
1478
 
  PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
 
1495
 
1479
1496
  if (!newAcc && !isHTML) {
1480
1497
    if (content->GetNameSpaceID() == kNameSpaceID_SVG &&
1481
1498
             content->Tag() == nsAccessibilityAtoms::svg) {