Backout 547de632a3e2 (bug 495912) for mochitest-a11y orange
authorEd Morley <bmo@edmorley.co.uk>
Wed, 29 Feb 2012 18:42:58 +0000
changeset 91267 9622ca7535f80b10a0514963ed7b08e3cf28637a
parent 91266 1e24d9b1f0f41d814c80986879e15cbac5a81567
child 91268 3814bedcc3173a720949443d6070770b76217f32
push id136
push userlsblakk@mozilla.com
push dateFri, 01 Jun 2012 02:39:32 +0000
treeherdermozilla-release@7ebf7352c959 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs495912
milestone13.0a1
backs out547de632a3e2d90302173ccf2104d955a5f0b103
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout 547de632a3e2 (bug 495912) for mochitest-a11y orange
accessible/tests/mochitest/events/Makefile.in
accessible/tests/mochitest/events/test_focus_canvas.html
accessible/tests/mochitest/tree/test_canvas.html
accessible/tests/mochitest/treeupdate/Makefile.in
accessible/tests/mochitest/treeupdate/test_canvas.html
layout/base/nsCSSFrameConstructor.cpp
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsHTMLCanvasFrame.h
layout/style/html.css
layout/style/nsCSSAnonBoxList.h
--- a/accessible/tests/mochitest/events/Makefile.in
+++ b/accessible/tests/mochitest/events/Makefile.in
@@ -60,17 +60,16 @@ include $(topsrcdir)/config/rules.mk
 		test_contextmenu.html \
 		test_docload.html \
 		test_docload.xul \
 		test_dragndrop.html \
 		test_flush.html \
 		test_focus_aria_activedescendant.html \
 		test_focus_autocomplete.xul \
 		test_focus_browserui.xul \
-		test_focus_canvas.html \
 		test_focus_contextmenu.xul \
 		test_focus_controls.html \
 		test_focus_dialog.html \
 		test_focus_doc.html \
 		test_focus_general.html \
 		test_focus_general.xul \
 		test_focus_listcontrols.xul \
 		test_focus_menu.xul \
deleted file mode 100644
--- a/accessible/tests/mochitest/events/test_focus_canvas.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<html>
-
-<head>
-  <title>Accessible focus testing in canvas subdom</title>
-
-  <link rel="stylesheet" type="text/css"
-        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-  <script type="application/javascript"
-          src="../common.js"></script>
-  <script type="application/javascript"
-          src="../events.js"></script>
-  <script type="application/javascript"
-          src="../states.js"></script>
-
-  <script type="application/javascript">
-    //gA11yEventDumpToConsole = true;
-
-    var gQueue = null;
-    function doTests()
-    {
-      gQueue = new eventQueue();
-
-      gQueue.push(new synthFocus("button"));
-      gQueue.push(new synthTab("button", new focusChecker("textbox")));
-
-      gQueue.invoke(); // Will call SimpleTest.finish();
-    }
-
-    SimpleTest.waitForExplicitFinish();
-    addA11yLoadEvent(doTests);
-  </script>
-</head>
-
-<body>
-  <a target="_blank"
-     title="Expose content in Canvas element"
-     href="https://bugzilla.mozilla.org/show_bug.cgi?id=495912">
-    Mozilla Bug 495912
-  </a>
-
-  <p id="display"></p>
-  <div id="content" style="display: none"></div>
-  <pre id="test">
-  </pre>
-
-  <canvas>
-    <input id="button" type="button">
-    <input id="textbox">
-  </canvas>
-
-  <div id="eventdump"></div>
-</body>
-</html>
--- a/accessible/tests/mochitest/tree/test_canvas.html
+++ b/accessible/tests/mochitest/tree/test_canvas.html
@@ -12,24 +12,24 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
-    {
-      var tree =
-        { ROLE_CANVAS: [
-          { CHECKBUTTON: [] },
-          { ENTRY: [] }
-        ] };
+    {
+      var accTree = {
+        role: ROLE_CANVAS,
+        children: [
+        ]
+      };
+      testAccessibleTree("canvas", accTree);
 
-      testAccessibleTree("canvas", accTree);
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 <body>
@@ -37,17 +37,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <a target="_blank"
      title="Expose alternative content in Canvas element to ATs"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=495912">Mozilla Bug 495912</a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <canvas id="canvas" tabindex="0"><input type="checkbox"><input></canvas>
+  <canvas id="canvas" tabindex="0">
+    fallback content.
+  </canvas>
 
   <script type="text/javascript">
     var c=document.getElementById("canvas");
     var cxt=c.getContext("2d");
     cxt.fillStyle="#005500";
     cxt.fillRect(0,0,150,75);
   </script>  
 
--- a/accessible/tests/mochitest/treeupdate/Makefile.in
+++ b/accessible/tests/mochitest/treeupdate/Makefile.in
@@ -42,17 +42,16 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir  = accessible/treeupdate
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		test_ariadialog.html \
-		test_canvas.html \
 		test_colorpicker.xul \
 		test_cssoverflow.html \
 		test_contextmenu.xul \
 		test_doc.html \
 		test_gencontent.html \
 		test_list_editabledoc.html \
 		test_list.html \
 		test_menu.xul \
deleted file mode 100644
--- a/accessible/tests/mochitest/treeupdate/test_canvas.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
-  <title>Canvas subdom mutation</title>
-
-  <link rel="stylesheet" type="text/css"
-        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-  <script type="application/javascript"
-          src="../common.js"></script>
-  <script type="application/javascript"
-          src="../role.js"></script>
-  <script type="application/javascript"
-          src="../events.js"></script>
-
-  <script type="application/javascript">
-
-    ////////////////////////////////////////////////////////////////////////////
-    // Invokers
-
-    function addSubtree(aID)
-    {
-      this.node = getNode(aID);
-
-      this.eventSeq = [
-        new invokerChecker(EVENT_SHOW, this.node)
-      ];
-
-      this.invoke = function addSubtree_invoke()
-      {
-        // ensure we start with no subtree
-        testAccessibleTree("canvas", { CANVAS: [] });
-        getNode("dialog").style.display = "block";
-      }
-
-      this.finalCheck = function addSubtree_finalCheck() {
-        testAccessibleTree({ DIALOG: [] }, tree);
-      }
-
-      this.getID = function addSubtree_getID()
-      {
-        return "show canvas subdom";
-      }
-    }
-
-    ////////////////////////////////////////////////////////////////////////////
-    // Test
-
-    //gA11yEventDumpID = "eventdump"; // debug stuff
-    //gA11yEventDumpToConsole = true;
-
-    var gQueue = null;
-
-    function doTest()
-    {
-      gQueue = new eventQueue();
-
-      // make the subdom come alive!
-      gQueue.push(new addSubtree("dialog"));
-
-      gQueue.invoke(); // SimpleTest.finish() will be called in the end
-    }
-
-    SimpleTest.waitForExplicitFinish();
-    addA11yLoadEvent(doTest);
-  </script>
-</head>
-<body>
-
-  <a target="_blank"
-     title="Expose content in Canvas element"
-     href="https://bugzilla.mozilla.org/show_bug.cgi?id=495912">
-    Mozilla Bug 495912
-  </a>
-
-  <p id="display"></p>
-  <div id="content" style="display: none"></div>
-  <pre id="test">
-  </pre>
-
-  <canvas id="canvas">
-    <div id="dialog" role="dialog" style="display: none;">
-    </div>
-  </canvas>
-
-  <div id="eventdump"></div>
-</body>
-</html>
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3535,18 +3535,17 @@ const nsCSSFrameConstructor::FrameConstr
 nsCSSFrameConstructor::FindCanvasData(Element* aElement,
                                       nsStyleContext* aStyleContext)
 {
   if (!aElement->OwnerDoc()->IsScriptEnabled()) {
     return nsnull;
   }
 
   static const FrameConstructionData sCanvasData =
-    FCDATA_WITH_WRAPPING_BLOCK(0, NS_NewHTMLCanvasFrame,
-                               nsCSSAnonBoxes::htmlCanvasContent);
+    SIMPLE_FCDATA(NS_NewHTMLCanvasFrame);
   return &sCanvasData;
 }
 
 nsresult
 nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aItem,
                                                       nsFrameConstructorState& aState,
                                                       nsIFrame* aParentFrame,
                                                       nsFrameItems& aFrameItems)
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -244,34 +244,20 @@ nsHTMLCanvasFrame::Reflow(nsPresContext*
 
   aMetrics.SetOverflowAreasToDesiredBounds();
   FinishAndStoreOverflow(&aMetrics);
 
   if (mRect.width != aMetrics.width || mRect.height != aMetrics.height) {
     Invalidate(nsRect(0, 0, mRect.width, mRect.height));
   }
 
-  // Reflow the single anon block child.
-  nsReflowStatus childStatus;
-  nsSize availSize(aReflowState.ComputedWidth(), NS_UNCONSTRAINEDSIZE);
-  nsIFrame* childFrame = mFrames.FirstChild();
-  NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
-  nsHTMLReflowMetrics childDesiredSize(aMetrics.mFlags);
-  nsHTMLReflowState childReflowState(aPresContext, aReflowState, childFrame,
-                                     availSize);
-  ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowState,
-              0, 0, 0, childStatus, nsnull);
-  FinishReflowChild(childFrame, aPresContext, &childReflowState,
-                    childDesiredSize, 0, 0, 0);
-
   NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
                   ("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
                   aMetrics.width, aMetrics.height));
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
-
   return NS_OK;
 }
 
 // FIXME taken from nsImageFrame, but then had splittable frame stuff
 // removed.  That needs to be fixed.
 nsRect 
 nsHTMLCanvasFrame::GetInnerArea() const
 {
--- a/layout/generic/nsHTMLCanvasFrame.h
+++ b/layout/generic/nsHTMLCanvasFrame.h
@@ -35,37 +35,37 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* rendering object for the HTML <canvas> element */
 
 #ifndef nsHTMLCanvasFrame_h___
 #define nsHTMLCanvasFrame_h___
 
-#include "nsContainerFrame.h"
+#include "nsSplittableFrame.h"
 #include "nsString.h"
 #include "nsAString.h"
 #include "nsIIOService.h"
 #include "Layers.h"
 #include "ImageLayers.h"
 
 class nsPresContext;
 class nsDisplayItem;
 
 nsIFrame* NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
-class nsHTMLCanvasFrame : public nsContainerFrame
+class nsHTMLCanvasFrame : public nsSplittableFrame
 {
 public:
   typedef mozilla::layers::Layer Layer;
   typedef mozilla::layers::LayerManager LayerManager;
 
   NS_DECL_FRAMEARENA_HELPERS
 
-  nsHTMLCanvasFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
+  nsHTMLCanvasFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
 
   NS_IMETHOD Init(nsIContent* aContent,
                   nsIFrame*   aParent,
                   nsIFrame*   aPrevInFlow);
 
   NS_IMETHOD BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                               const nsRect&           aDirtyRect,
                               const nsDisplayListSet& aLists);
@@ -103,21 +103,16 @@ public:
   {
     return nsSplittableFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced));
   }
 
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const;
 #endif
 
-  // Inserted child content gets its frames parented by our child block
-  virtual nsIFrame* GetContentInsertionFrame() {
-    return GetFirstPrincipalChild()->GetContentInsertionFrame();
-  }
-
 protected:
   virtual ~nsHTMLCanvasFrame();
 
   nscoord GetContinuationOffset(nscoord* aWidth = 0) const;
 
   nsMargin mBorderPadding;
 };
 
--- a/layout/style/html.css
+++ b/layout/style/html.css
@@ -745,22 +745,16 @@ video:not([controls]) > xul|videocontrol
 audio:not([controls]) > xul|videocontrols {
   visibility: hidden;
 }
 
 audio:not([controls]) {
   display: none;
 }
 
-*|*::-moz-html-canvas-content {
-  display: block !important;
-  /* we want to be an absolute and fixed container */
-  -moz-transform: translate(0) !important;
-}
-
 /* emulation of non-standard HTML <marquee> tag */
 marquee {
   width: -moz-available;
   display: inline-block;
   vertical-align: text-bottom;
   text-align: start;
   -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal');
 }
--- a/layout/style/nsCSSAnonBoxList.h
+++ b/layout/style/nsCSSAnonBoxList.h
@@ -67,17 +67,16 @@ CSS_ANON_BOX(mozLineFrame, ":-moz-line-f
 
 CSS_ANON_BOX(buttonContent, ":-moz-button-content")
 CSS_ANON_BOX(mozButtonLabel, ":-moz-buttonlabel")
 CSS_ANON_BOX(cellContent, ":-moz-cell-content")
 CSS_ANON_BOX(dropDownList, ":-moz-dropdown-list")
 CSS_ANON_BOX(fieldsetContent, ":-moz-fieldset-content")
 CSS_ANON_BOX(framesetBlank, ":-moz-frameset-blank")
 CSS_ANON_BOX(mozDisplayComboboxControlFrame, ":-moz-display-comboboxcontrol-frame")
-CSS_ANON_BOX(htmlCanvasContent, ":-moz-html-canvas-content")
 
 CSS_ANON_BOX(inlineTable, ":-moz-inline-table")
 CSS_ANON_BOX(table, ":-moz-table")
 CSS_ANON_BOX(tableCell, ":-moz-table-cell")
 CSS_ANON_BOX(tableColGroup, ":-moz-table-column-group")
 CSS_ANON_BOX(tableCol, ":-moz-table-column")
 CSS_ANON_BOX(tableOuter, ":-moz-table-outer")
 CSS_ANON_BOX(tableRowGroup, ":-moz-table-row-group")