merge for back out of changeset f3fcd36fcbd1 (bug 119061) for linux orange.
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Thu, 11 Jun 2009 16:57:40 -0700
changeset 29104 68035339a3f0baf91d9f81bccf54f7afc019a921
parent 29102 04040160e7daf6e203728a4b81cc53fc2b4e82c7 (current diff)
parent 29103 06027b3d50d99bb1d03ed761fb8c6e99597b718f (diff)
child 29105 497fe6fed36e0c799a466f269e214dbc3df4326e
push id7421
push usersdwilsh@shawnwilsher.com
push dateThu, 11 Jun 2009 23:58:06 +0000
treeherderautoland@68035339a3f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs119061
milestone1.9.2a1pre
merge for back out of changeset f3fcd36fcbd1 (bug 119061) for linux orange.
content/svg/content/test/test_moveUnderMouse.xhtml
layout/reftests/svg/dynamic-move-under-mouse.svg
--- a/content/svg/content/test/Makefile.in
+++ b/content/svg/content/test/Makefile.in
@@ -57,13 +57,12 @@ include $(topsrcdir)/config/rules.mk
 		scientific-helper.svg \
 		test_switch.xhtml \
 		switch-helper.svg \
 		test_text.html \
 		text-helper.svg \
 		test_valueLeaks.xhtml \
 		viewport-helper.svg \
 		test_viewport.html \
-		test_moveUnderMouse.xhtml \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
deleted file mode 100644
--- a/content/svg/content/test/test_moveUnderMouse.xhtml
+++ /dev/null
@@ -1,97 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <title>Test :hover styling when an element is moved under the mouse</title>
-  <!--
-    From https://bugzilla.mozilla.org/show_bug.cgi?id=119061
-
-    This test checks whether an element to which the :hover pseudo class
-    applies is correctly restyled when it moves under the mouse pointer.
-    Note this is different to having the pointer move over the element.
-  -->
-  <script type="text/javascript" src="/MochiKit/packed.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-  <style type="text/css">
-
-#target:hover { fill: lime; }
-
-  </style>
-  <script type="text/javascript">//<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function synthesizeMouseEvent(type,                // string
-                              x,                   // float
-                              y,                   // float
-                              button,              // long
-                              clickCount,          // long
-                              modifiers,           // long
-                              ignoreWindowBounds)  // boolean
-{
-  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-
-  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-        .getInterface(Components.interfaces.nsIDOMWindowUtils)
-        .sendMouseEvent(type, x, y, button, clickCount, modifiers, ignoreWindowBounds);
-}
-
-function check_mousemove(event)
-{
-  if (event.clientX != x || event.clientY != y) {
-    document.getElementById('message2').setAttribute('display','block');
-  }
-}
-
-document.addEventListener('mousemove', check_mousemove, false);
-
-var x, y;
-
-function run_test()
-{
-  var topLeft = document.getElementById('svg').getBoundingClientRect();
-  x = topLeft.left + 50;
-  y = topLeft.top + 90;
-  try {
-    synthesizeMouseEvent('mousemove', x, y, 0, 0, 0, false);
-  } catch(e) {
-    document.getElementById('message1').setAttribute('display','block');
-  }
-  document.getElementById('g').removeAttribute('display');
-
-  setTimeout(finish_test, 500);
-}
-
-function finish_test()
-{
-  var target = document.getElementById('target');
-  var color = document.defaultView.getComputedStyle(target, '').getPropertyValue('fill');
-
-  ok(color == 'rgb(0, 255, 0)', 'Expected "rgb(0, 255, 0)", got "' + color + '"');
-
-  SimpleTest.finish();
-}
-
-  //]]></script>
-</head>
-<body onload="run_test()">
-<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="500" height="500">
-  <rect width="100%" height="100%" fill="red"/>
-  <g id="g" display="none">
-    <rect width="100%" height="100%" fill="lime"/>
-    <rect id="target" width="100" height="500" fill="red"/>
-  </g>
-  <text id="message1" display="none" x="10" y="40">
-    You user-agent does not have the necessary support for synthesizing mouse events.
-  </text>
-  <text id="message2" display="none" x="10" y="80">
-    You moved your mouse! That can cause this test to appear to fail.
-  </text>
-</svg>
-<p id="display">
-</p>
-<div id="content">
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/svg/dynamic-move-under-mouse.svg
+++ /dev/null
@@ -1,71 +0,0 @@
-<!--
-     Any copyright is dedicated to the Public Domain.
-     http://creativecommons.org/licenses/publicdomain/
--->
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="reftest-wait">
-  <title>Test :hover styling when an element is moved under the mouse</title>
-  <!--
-    From https://bugzilla.mozilla.org/show_bug.cgi?id=119061
-
-    This test checks whether an element to which the :hover pseudo class
-    applies is correctly restyled when it moves under the mouse pointer.
-    Note this is different to having the pointer move over the element.
-  -->
-  <style type="text/css">
-
-#target:hover { fill: lime; }
-
-  </style>
-  <script type="text/javascript">//<![CDATA[
-
-function synthesizeMouseEvent(type,                // string
-                              x,                   // float
-                              y,                   // float
-                              button,              // long
-                              clickCount,          // long
-                              modifiers,           // long
-                              ignoreWindowBounds)  // boolean
-{
-  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-
-  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-        .getInterface(Components.interfaces.nsIDOMWindowUtils)
-        .sendMouseEvent(type, x, y, button, clickCount, modifiers, ignoreWindowBounds);
-}
-
-function check_mousemove(event)
-{
-  if (event.clientX != 51 || event.clientY != 51) {
-    document.getElementById('message2').setAttribute('display','block');
-  }
-}
-
-document.addEventListener('mousemove', check_mousemove, false);
-
-function run_test()
-{
-  try {
-    synthesizeMouseEvent('mousemove', 51, 51, 0, 0, 0, false);
-  } catch(e) {
-    document.getElementById('message1').setAttribute('display','block');
-  }
-  document.getElementById('g').removeAttribute('display');
-  document.documentElement.removeAttribute('class');
-}
-
-document.addEventListener("MozReftestInvalidate", run_test, false);
-setTimeout(run_test, 1000); // for manual testing
-
-  //]]></script>
-  <rect width="100%" height="100%" fill="red"/>
-  <g id="g" display="none">
-    <rect width="100%" height="100%" fill="lime"/>
-    <rect id="target" width="100" height="100" fill="red"/>
-  </g>
-  <text id="message1" display="none" x="10" y="40">
-    You user-agent does not have the necessary support for synthesizing mouse events.
-  </text>
-  <text id="message2" display="none" x="10" y="80">
-    You moved your mouse! That can cause this test to appear to fail.
-  </text>
-</svg>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -25,17 +25,16 @@ include moz-only/reftest.list
 == dynamic-clipPath-01.svg pass.svg
 == dynamic-feFlood-01.svg pass.svg
 == dynamic-feImage-01.svg pass.svg
 == dynamic-filter-contents-01.svg dynamic-filter-contents-01-ref.svg
 == dynamic-gradient-contents-01.svg pass.svg
 == dynamic-link-style-01.svg pass.svg
 == dynamic-marker-01.svg pass.svg
 == dynamic-mask-contents-01.svg pass.svg
-skip == dynamic-move-under-mouse.svg pass.svg # disabled for now - needs privileges
 == dynamic-pattern-01.svg pass.svg
 == dynamic-pattern-02.svg pass.svg
 == dynamic-pattern-contents-01.svg pass.svg
 == dynamic-pattern-contents-02.svg pass.svg
 == dynamic-rect-01.svg dynamic-rect-01-ref.svg
 == dynamic-rect-02.svg dynamic-rect-02-ref.svg
 == dynamic-rect-03.svg dynamic-rect-03-ref.svg
 == dynamic-rect-04.xhtml pass.svg
--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
@@ -48,17 +48,16 @@
 #include "nsIContentViewer.h"
 #include "nsIDocShell.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMWindowInternal.h"
 #include "nsPIDOMWindow.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsSVGMatrix.h"
-#include "nsIViewManager.h"
 
 class nsSVGMutationObserver : public nsStubMutationObserver
 {
 public:
   // nsIMutationObserver interface
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
 
   // nsISupports interface:
@@ -623,35 +622,27 @@ nsSVGOuterSVGFrame::GetType() const
 }
 
 //----------------------------------------------------------------------
 // nsSVGOuterSVGFrame methods:
 
 void
 nsSVGOuterSVGFrame::InvalidateCoveredRegion(nsIFrame *aFrame)
 {
-  // Make sure elements styled by :hover get updated if they've moved under or
-  // out from under the mouse:
-  PresContext()->PresShell()->GetViewManager()->SynthesizeMouseMove(PR_FALSE);
-
   nsISVGChildFrame *svgFrame = do_QueryFrame(aFrame);
   if (!svgFrame)
     return;
 
   nsRect rect = nsSVGUtils::FindFilterInvalidation(aFrame, svgFrame->GetCoveredRegion());
   Invalidate(rect);
 }
 
 PRBool
 nsSVGOuterSVGFrame::UpdateAndInvalidateCoveredRegion(nsIFrame *aFrame)
 {
-  // Make sure elements styled by :hover get updated if they've moved under or
-  // out from under the mouse:
-  PresContext()->PresShell()->GetViewManager()->SynthesizeMouseMove(PR_FALSE);
-
   nsISVGChildFrame *svgFrame = do_QueryFrame(aFrame);
   if (!svgFrame)
     return PR_FALSE;
 
   nsRect oldRegion = svgFrame->GetCoveredRegion();
   Invalidate(nsSVGUtils::FindFilterInvalidation(aFrame, oldRegion));
   svgFrame->UpdateCoveredRegion();
   nsRect newRegion = svgFrame->GetCoveredRegion();