bug 768243 r=tbsaunde a=akeybl
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 04 Dec 2012 18:31:46 -0500
changeset 82092 105b76710102d6025f689384d4587573f296ef7e
parent 82091 bed4b9ab05a2dbe1580e8550b48bc6c9b5376152
child 82093 45d7f91719da28b2d0fde306416bf4764790df0b
push id343
push usertrev.saunders@gmail.com
push dateWed, 05 Dec 2012 01:40:17 +0000
reviewerstbsaunde, akeybl
bugs768243
milestone10.0.11esrpre
bug 768243 r=tbsaunde a=akeybl
accessible/src/base/nsDocAccessible.cpp
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -1871,16 +1871,33 @@ nsDocAccessible::UpdateTreeInternal(nsAc
 {
   PRUint32 updateFlags = eAccessible;
 
   nsINode* node = aChild->GetNode();
   if (aIsInsert) {
     // Create accessible tree for shown accessible.
     CacheChildrenInSubtree(aChild);
 
+    // XXX: since select change insertion point of option contained by optgroup
+    // then we need to have special processing for them (bug 690417).
+    if (!aIsInsert && aChildNode->IsHTML(nsGkAtoms::optgroup) &&
+        aContainer->GetContent()->IsHTML(nsGkAtoms::select)) {
+      for (nsIContent* optContent = aChildNode->GetFirstChild(); optContent;
+           optContent = optContent->GetNextSibling()) {
+        if (optContent->IsHTML(nsGkAtoms::option)) {
+          Accessible* option = GetAccessible(optContent);
+          if (option) {
+            NS_ASSERTION(option->Parent() == aContainer,
+                         "Not expected hierarchy on HTML select!");
+            if (option->Parent() == aContainer)
+              updateFlags |= UpdateTreeInternal(option, aIsInsert, reorderEvent);
+          }
+        }
+      }
+    }
   } else {
     // Fire menupopup end event before hide event if a menu goes away.
 
     // XXX: We don't look into children of hidden subtree to find hiding
     // menupopup (as we did prior bug 570275) because we don't do that when
     // menu is showing (and that's impossible until bug 606924 is fixed).
     // Nevertheless we should do this at least because layout coalesces
     // the changes before our processing and we may miss some menupopup