~ubuntu-branches/ubuntu/precise/xulrunner-1.9/precise

« back to all changes in this revision

Viewing changes to mozilla/accessible/src/base/nsAccessible.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:
2045
2045
{
2046
2046
  NS_ENSURE_ARG_POINTER(aAttributes);  // In/out param. Created if necessary.
2047
2047
  
 
2048
  if (IsDefunct())
 
2049
    return NS_ERROR_FAILURE;
 
2050
 
2048
2051
  nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
2049
2052
  if (!content) {
2050
2053
    return NS_ERROR_FAILURE;
3064
3067
 
3065
3068
void nsAccessible::DoCommandCallback(nsITimer *aTimer, void *aClosure)
3066
3069
{
3067
 
  NS_ASSERTION(gDoCommandTimer, "How did we get here if there was no gDoCommandTimer?");
 
3070
  NS_ASSERTION(gDoCommandTimer,
 
3071
               "How did we get here if there was no gDoCommandTimer?");
3068
3072
  NS_RELEASE(gDoCommandTimer);
3069
3073
 
3070
 
  nsIContent *content = reinterpret_cast<nsIContent*>(aClosure);
3071
 
  nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(content));
3072
 
  if (xulElement) {
3073
 
    xulElement->Click();
3074
 
  }
3075
 
  else {
3076
 
    nsIDocument *doc = content->GetDocument();
3077
 
    if (!doc) {
3078
 
      return;
3079
 
    }
3080
 
    nsCOMPtr<nsIPresShell> presShell = doc->GetPrimaryShell();
3081
 
    nsPIDOMWindow *outerWindow = doc->GetWindow();
3082
 
    if (presShell && outerWindow) {
3083
 
      nsAutoPopupStatePusher popupStatePusher(outerWindow, openAllowed);
3084
 
 
3085
 
      nsMouseEvent downEvent(PR_TRUE, NS_MOUSE_BUTTON_DOWN, nsnull,
3086
 
                             nsMouseEvent::eSynthesized);
3087
 
      nsMouseEvent upEvent(PR_TRUE, NS_MOUSE_BUTTON_UP, nsnull,
3088
 
                           nsMouseEvent::eSynthesized);
3089
 
      nsMouseEvent clickEvent(PR_TRUE, NS_MOUSE_CLICK, nsnull,
3090
 
                              nsMouseEvent::eSynthesized);
3091
 
 
3092
 
      nsEventStatus eventStatus = nsEventStatus_eIgnore;
3093
 
      content->DispatchDOMEvent(&downEvent, nsnull,
3094
 
                                 presShell->GetPresContext(), &eventStatus);
3095
 
      content->DispatchDOMEvent(&upEvent, nsnull,
3096
 
                                 presShell->GetPresContext(), &eventStatus);
3097
 
      content->DispatchDOMEvent(&clickEvent, nsnull,
3098
 
                                 presShell->GetPresContext(), &eventStatus);
3099
 
    }
3100
 
  }
 
3074
  nsCOMPtr<nsIContent> content =
 
3075
    reinterpret_cast<nsIContent*>(aClosure);
 
3076
 
 
3077
  nsIDocument *doc = content->GetDocument();
 
3078
  if (!doc)
 
3079
    return;
 
3080
 
 
3081
  nsCOMPtr<nsIPresShell> presShell = doc->GetPrimaryShell();
 
3082
 
 
3083
  // Scroll into view.
 
3084
  presShell->ScrollContentIntoView(content, NS_PRESSHELL_SCROLL_ANYWHERE,
 
3085
                                   NS_PRESSHELL_SCROLL_ANYWHERE);
 
3086
 
 
3087
  // Fire mouse down and mouse up events.
 
3088
  PRBool res = nsAccUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, presShell,
 
3089
                                              content);
 
3090
  if (!res)
 
3091
    return;
 
3092
 
 
3093
  nsAccUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, presShell, content);
3101
3094
}
3102
3095
 
3103
3096
/*