Bug 999964 part 2 - mochitest, reftest for Bug 999964; r=longsonr
authorShigeyuki Tsukihashi <shigeyuki.tsukihashi@going.co.jp>
Thu, 15 May 2014 11:03:49 +0900
changeset 184078 dcbcf74976277493bc36b43f420bd3e897da3fdd
parent 184077 e56e0f49a088640c4f98e9f267b3199e4e248789
child 184079 96f69a915843b1b92e6743a54e872c457c1e81ec
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs999964
milestone32.0a1
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
Bug 999964 part 2 - mochitest, reftest for Bug 999964; r=longsonr
content/svg/content/test/getBBox-method-helper.svg
content/svg/content/test/mochitest.ini
content/svg/content/test/test_getBBox-method.html
layout/reftests/invalidation/reftest.list
new file mode 100644
--- /dev/null
+++ b/content/svg/content/test/getBBox-method-helper.svg
@@ -0,0 +1,299 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"  xmlns:xlink="http://www.w3.org/1999/xlink"
+  viewBox="0 0 500 500" width="500px" height="500px">
+  <defs>
+    <clipPath id="rect01" clip-rule="evenodd" clipPathUnits="objectBoundingBox">
+      <rect x="0" y="0" width="0.5" height="1.0"/>
+    </clipPath>
+    <clipPath id="rect02" clip-rule="evenodd" clipPathUnits="objectBoundingBox">
+      <rect x="0.5" y="0" width="0.5" height="1.0"/>
+    </clipPath>
+    <clipPath id="rect03" clip-rule="evenodd" clipPathUnits="objectBoundingBox">
+      <rect x="0.5" y="0" width="0.5" height="1.0"/>
+    </clipPath>
+    <clipPath id="rect04" clip-rule="evenodd" clipPathUnits="objectBoundingBox">
+      <rect x="0" y="0" width="0.5" height="1.0"/>
+    </clipPath>
+    <clipPath id="rect05" clip-rule="evenodd">
+      <rect x="0" y="60" width="10px" height="23px"/>
+    </clipPath>
+    <clipPath id="rect06" clip-rule="evenodd">
+      <rect x="10" y="60" width="10px" height="23px"/>
+    </clipPath>
+    <clipPath id="rect4" clip-rule="evenodd">
+      <rect x="200" y="200" width="200" height="200"/>
+    </clipPath>
+    <clipPath id="rect-none" clip-rule="evenodd">
+    </clipPath>
+    <clipPath id="rect5" clip-rule="evenodd">
+      <rect x="0" y="0" width="100" height="100"/>
+    </clipPath>
+    <clipPath id="rect6" clip-rule="evenodd">
+      <rect x="150" y="0" width="100" height="100"/>
+    </clipPath>
+    <clipPath id="rect7" clip-rule="evenodd">
+      <rect x="0" y="100" width="100" height="100"/>
+    </clipPath>
+    <clipPath id="rect8" clip-rule="evenodd">
+      <rect x="10" y="10" width="180" height="180"/>
+    </clipPath>
+    <clipPath id="rect9" clip-rule="evenodd">
+      <rect x="100" y="100" width="200" height="200"/>
+    </clipPath>
+
+    <clipPath id="circle1" clip-rule="evenodd">
+      <circle cx="203" cy="203" r="150"/>
+    </clipPath>
+    <clipPath id="circle2" clip-rule="evenodd" clipPathUnits="objectBoundingBox">
+      <circle cx="0.5" cy="0.5" r="0.25"/>
+    </clipPath>
+    <clipPath id="circle3" clip-rule="evenodd">
+      <circle cx="100" cy="100" r="50"/>
+      <circle cx="300" cy="300" r="50"/>
+    </clipPath>
+
+    <clipPath id="circle4" clip-rule="evenodd">
+      <circle cx="50" cy="50" r="50"/>
+    </clipPath>
+    <clipPath id="circle5" clip-rule="evenodd">
+      <circle cx="150" cy="50" r="50"/>
+    </clipPath>
+    <clipPath id="circle6" clip-rule="evenodd">
+      <circle cx="50" cy="200" r="50"/>
+    </clipPath>
+    <clipPath id="circle7" clip-rule="evenodd" clipPathUnits="objectBoundingBox">
+      <circle cx="0.5" cy="0.5" r="0.5"/>
+    </clipPath>
+
+    <clipPath id="circle8" clip-rule="evenodd" clipPathUnits="userSpaceOnUse">
+      <circle cx="110"  cy="20"  r="90"/>
+    </clipPath>
+
+    <clipPath id="circle9" clip-rule="evenodd" clipPathUnits="userSpaceOnUse">
+      <circle cx="290"  cy="20" r="90"/>
+    </clipPath>
+
+    <clipPath id="circle10" clip-rule="evenodd" clipPathUnits="userSpaceOnUse">
+      <circle cx="110" cy="200"  r="90"/>
+    </clipPath>
+
+    <clipPath id="circle11" clip-rule="evenodd">
+      <circle cx="0" cy="0" r="150"/>
+    </clipPath>
+
+    <clipPath id="star" clip-rule="evenodd">
+      <path d="M400,25 L619,703 43,283 757,283 181,703 z" />
+    </clipPath>
+
+    <marker id="m_atr" markerUnits="strokeWidth" markerWidth="3" markerHeight="3" viewBox="0 0 10 10" refX="5" refY="5">
+        <polygon points="0,0 5,5 0,10 10,5" fill="red"/>
+    </marker>
+
+    <switch>
+      <rect id="rect-10" x="20"  y="20"  width="180" height="180" fill="blue"  stroke="cyan" stroke-width="8"/>
+      <rect id="rect-11" x="200" y="20"  width="180" height="180" fill="lightgreen" stroke="none" />
+      <rect id="rect-12" x="20"  y="200" width="180" height="180" fill="darkcyan" stroke="none" />
+    </switch>
+
+    <clipPath id="clipCircle1">
+      <circle id="c1" cx="100" cy="100" r="50"/>
+    </clipPath>
+
+    <clipPath id="clipCircle2">
+      <circle id="c2" cx="150" cy="150" r="50"/>
+    </clipPath>
+
+    <clipPath id="clipPath1">
+      <path id="p1" d="M10 10l100 0 0 100 -100 0ZM50 50l40 0 0 40 -40 0Z" clip-rule="evenodd"/>
+    </clipPath>
+
+    <!-- "If a valid 'clip-path' reference is placed on one of the children of a 'clipPath' element, 
+        then the given child element is clipped by the referenced clipping path before OR'ing the 
+      silhouette of the child element with the silhouettes of the other child elements." -->
+
+    <clipPath id="clipRects1">
+      <rect x="50" y="30" width="25" height="100"/>
+      <rect x="25" y="50" width="10" height="10" clip-path="url(#clipTwoCircles)"/>
+    </clipPath>
+
+    <!-- Test use in a clipPath -->
+    <clipPath id="clipTwoCircles">
+      <use xlink:href="#c1"/>
+      <use xlink:href="#c2"/>
+    </clipPath>
+
+    <clipPath id="clipInClip1">
+      <use xlink:href="#c2" clip-path="url(#clipCircle1)"/>
+      <use xlink:href="#p1"/>
+    </clipPath>
+
+    <clipPath id="clipOnClip1" clip-path="url(#clipCircle1)">
+      <use xlink:href="#c2"/>
+      <use xlink:href="#p1"/>
+    </clipPath>
+
+  </defs>
+
+  <!-- text -->
+  <text id="text1" font-size="20px" font-familiy="monospace" fill="red"  x="0" y="50" clip-path="url('#rect01')">99</text>
+  <text id="text2" font-size="20px" font-familiy="monospace" fill="blue" x="100" y="120" clip-path="url('#rect02')">99</text>
+  <text id="text3" font-size="20px" font-familiy="monospace" clip-path="url('#rect03')" x="0" y="120">
+    <tspan x="0" y="50" fill="red">99</tspan>
+  </text>
+  <text id="text4" font-size="20px" font-familiy="monospace" clip-path="url('#rect04')" x="0" y="120">
+    <tspan x="100" y="120" fill="blue">99</tspan>
+  </text>
+  <text id="text5" font-size="20px" font-familiy="monospace" fill="red"  x="0" y="80" clip-path="url('#rect05')">99</text>
+  <text id="text6" font-size="20px" font-familiy="monospace" fill="blue" x="0" y="80" clip-path="url('#rect06')">99</text>
+
+  <!-- image -->
+  <image id="image1" x="150" y="150" width="200" height="200" preserveApectRatio="none" clip="rect(200,300,300,200)"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+  
+  <image id="image2" x="2"   y="2"   width="200" height="200" clip-path="url('#circle1')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image3" x="205" y="2"   width="200" height="200" clip-path="url('#circle1')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image4" x="2"   y="205" width="200" height="200" clip-path="url('#circle1')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image5" x="205" y="205" width="200" height="200" clip-path="url('#circle1')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image6" x="2"   y="2"   width="200" height="200" clip-path="url('#circle2')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image7" x="205" y="2"   width="200" height="200" clip-path="url('#circle2')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image8" x="2"   y="205" width="200" height="200" clip-path="url('#circle2')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image9" x="205" y="205" width="200" height="200" clip-path="url('#circle2')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image10" x="0" y="0" width="400" height="400" clip-path="url('#rect4')"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image11" x="0" y="0" width="400" height="400" clip-path="url('#rect-none')"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image12" x="25" y="43" width="768" height="768" clip-path="url('#star')" preserveApectRatio="none"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image13" x="0" y="0" width="400" height="400" clip-path="url('#circle3')"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <image id="image14" x="0" y="0" width="400" height="400" clip-path="url('#m_atr')"
+   xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKXRFWHRDcmVhdGlvbiBUaW1lAJCFIDMwIDQgMjAxNCAwOToyODo0MyArMDkwMH73aTcAAAAHdElNRQfeBB4AHhEfV06+AAAACXBIWXMAAB7BAAAewQHDaVRTAAAABGdBTUEAALGPC/xhBQAAABlJREFUeNpjZPj/n4EUwESS6lENoxqGlAYASU8CHux7qQ4AAAAASUVORK5CYII="/>
+
+  <!-- path -->
+  <path id="path1" d="M10,50 L25,100 H110 V50 Q60,0 10,50" stroke="black" stroke-width="8" stroke-miterlimit="1" stroke-linejoin="miter" fill="lightcyan" marker-mid="url(#m_atr)"/>
+  <path id="path2" d="M160,50 L175,100 H260 V50 Q210,0 160,50" stroke="black" stroke-width="8" stroke-linejoin="bevel" fill="lightcyan" marker-mid="url(#m_atr)"/>
+  <path id="path3" d="M10,150 L25,200 H110 V150 Q60,100 10,150" stroke="black" stroke-width="8" stroke-linejoin="round" fill="lightcyan" marker-mid="url(#m_atr)"/>
+  
+
+  <path id="path4" d="M10,50 L25,100 H110 V50 Q60,0 10,50" stroke="black" stroke-width="8" stroke-miterlimit="1" stroke-linejoin="miter" fill="lightcyan"
+    marker-mid="url(#m_atr)" clip-path="url(#circle4)"/>
+
+  <path id="path5" d="M160,50 L175,100 H260 V50 Q210,0 160,50" stroke="black" stroke-width="8" stroke-linejoin="bevel" fill="lightcyan"
+    marker-mid="url(#m_atr)" clip-path="url(#circle5)"/>
+
+  <path id="path6" d="M10,150 L25,200 H110 V150 Q60,100 10,150" stroke="black" stroke-width="8" stroke-linejoin="round" fill="lightcyan"
+    marker-mid="url(#m_atr)" clip-path="url(#circle6)"/>
+
+  <path id="path7" d="M10,50 L25,100 H110 V50 Q60,0 10,50"
+        stroke="black" stroke-width="8" stroke-miterlimit="1" stroke-linejoin="miter" fill="lightcyan"
+        clip-path="url('#rect5')" marker-mid="url(#m_atr)"/>
+
+  <path id="path8" d="M160,50 L175,100 H260 V50 Q210,0 160,50"
+        stroke="black" stroke-width="8" stroke-linejoin="bevel" fill="lightcyan"
+        clip-path="url('#rect6')" marker-mid="url(#m_atr)"/>
+
+  <path id="path9" d="M10,150 L25,200 H110 V150 Q60,100 10,150"
+        stroke="black" stroke-width="8" stroke-linejoin="round" fill="lightcyan"
+        clip-path="url('#rect7')" marker-mid="url(#m_atr)"/>
+
+  <path id="path10" d="M10,50 L25,100 H110 V50 Q60,0 10,50"
+        stroke="black" stroke-width="8" stroke-miterlimit="1" stroke-linejoin="miter" fill="lightcyan"
+        clip-path="url('#circle7')" marker-mid="url(#m_atr)"/>
+
+  <path id="path11" d="M160,50 L175,100 H260 V50 Q210,0 160,50"
+        stroke="black" stroke-width="8" stroke-linejoin="bevel" fill="lightcyan"
+        clip-path="url('#circle7')" marker-mid="url(#m_atr)"/>
+
+  <path id="path12" d="M10,150 L25,200 H110 V150 Q60,100 10,150"
+        stroke="black" stroke-width="8" stroke-linejoin="round" fill="lightcyan"
+        clip-path="url('#circle7')" marker-mid="url(#m_atr)"/>
+
+  <!-- use -->
+  <use id="use1" xlink:href="#rect-10" x="50" y="50" clip-path="url('#circle8')"/>
+  <use id="use2" xlink:href="#rect-11" x="50" y="50" clip-path="url('#circle9')"/>
+  <use id="use3" xlink:href="#rect-12" x="50" y="50" clip-path="url('#circle10')"/>
+  
+  <use id="use4" xlink:href="#rect-10" x="2"   y="2"   width="200" height="200" clip-path="url('#circle11')"/>
+  <use id="use5" xlink:href="#rect-10" x="205" y="2"   width="200" height="200" clip-path="url('#circle11')"/>
+  <use id="use6" xlink:href="#rect-10" x="2"   y="205" width="200" height="200" clip-path="url('#circle11')"/>
+  <use id="use7" xlink:href="#rect-10" x="205" y="205" width="200" height="200" clip-path="url('#circle11')"/>
+
+  <use id="use8" xlink:href="#rect-10" x="50" y="50" clip-path="url('#m_atr')"/>
+
+  <!-- foreignObject -->
+  <foreignObject id="fo1" x="2" y="2" width="200" height="200" clip-path="url('#circle1')" clip="rect(2,102,102,2)">
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+  <foreignObject id="fo2" x="205" y="2" width="200" height="200" clip-path="url('#circle1')" >
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+  <foreignObject id="fo3" x="2" y="205" width="200" height="200" clip-path="url('#circle1')" >
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+  <foreignObject id="fo4" x="205" y="205" width="200" height="200" clip-path="url('#circle1')" clip="rect(2,102,102,2)">
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+  
+  <foreignObject id="fo5" x="250" y="250" width="200" height="200" clip-path="url('#rect8')">
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+
+  <foreignObject id="fo6" x="0" y="0" width="200" height="200" clip-path="url('#rect9')">
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+
+  <foreignObject id="fo7" x="0" y="0" width="200" height="200" clip-path="url('#rect8')">
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+
+  <foreignObject id="fo8" x="0" y="0" width="200" height="200" clip-path="url('#m_atr')">
+    <div xmlns="http://www.w3.org/1999/xhtml" style="background-color:pink;width:100%;height:100%;">
+There are issues of dynamic loading required for tiling. Accroding to 'postpone' attribute of Resource Priorities, the dynamic loading is controlled by positional relation with bounding box of embedded contents and container's viewport. However, each bounding boxes of embedded contents should be whole earth basically when this method is used. (green part on Example) Tiling is impossible unless this situation is changed.
+    </div>
+  </foreignObject>
+
+  <!-- -->
+  <rect id="rect-1" width="200" height="200" fill="blue" clip-path="url(#clipInClip1)"/>
+  <rect id="rect-2" width="200" height="200" fill="blue" clip-path="url(#clipRects1)"/>
+  <rect id="rect-3" width="300" height="300" fill="blue" clip-path="url(#clipOnClip1)"/>
+
+  <g clip-path="url(#clipCircle1)" id="g1">
+    <use xlink:href="#c2" fill="red"/>
+    <use xlink:href="#p1" fill="red" fill-rule="evenodd"/>
+  </g>
+
+</svg>
--- a/content/svg/content/test/mochitest.ini
+++ b/content/svg/content/test/mochitest.ini
@@ -4,16 +4,17 @@ support-files =
   a_href_destination.svg
   a_href_helper_01.svg
   a_href_helper_02_03.svg
   a_href_helper_04.svg
   animated-svg-image-helper.html
   animated-svg-image-helper.svg
   bbox-helper.svg
   bounds-helper.svg
+  getBBox-method-helper.svg
   dataTypes-helper.svg
   fragments-helper.svg
   getCTM-helper.svg
   getSubStringLength-helper.svg
   matrixUtils.js
   MutationEventChecker.js
   pointer-events.js
   scientific-helper.svg
@@ -29,16 +30,17 @@ support-files =
 [test_a_href_02.xhtml]
 [test_animLengthObjectIdentity.xhtml]
 [test_animLengthReadonly.xhtml]
 [test_animLengthUnits.xhtml]
 [test_bbox-with-invalid-viewBox.xhtml]
 [test_bbox.xhtml]
 [test_bounds.html]
 [test_bug872812.html]
+[test_getBBox-method.html]
 [test_dataTypes.html]
 [test_dataTypesModEvents.html]
 [test_fragments.html]
 [test_getCTM.html]
 [test_getElementById.xhtml]
 [test_getSubStringLength.xhtml]
 [test_hasFeature.xhtml]
 [test_lang.xhtml]
new file mode 100644
--- /dev/null
+++ b/content/svg/content/test/test_getBBox-method.html
@@ -0,0 +1,249 @@
+<!DOCTYPE HTML>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=999964
+-->
+<head>
+  <meta charset="utf-8"/>
+  <title>Test case for Bug 999964</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=999964">Mozilla Bug 999964</a>
+<p id="display"></p>
+<div id="content" style="display: none"></div>
+
+<iframe id="svg" src="getBBox-method-helper.svg"></iframe>
+
+<pre id="test">
+<script class="testbody" type="application/javascript">
+
+  /** Test case for Bug 999964 **/
+
+SimpleTest.waitForExplicitFinish();
+
+function run()
+{
+  var flag = SpecialPowers.getBoolPref("svg.new-getBBox.enabled");
+  if (!flag) {
+    ok(!flag, "skip test for bug999964.");
+    SimpleTest.finish();
+    return;
+  }
+
+  var doc = $("svg").contentDocument;
+
+  function isFuzzy(a, b, error, name)
+  {
+    ok(!(Math.abs(a - b) > error), name, "got " + a + ", expected " + b + " (within " + error + ")");
+  }
+
+  function getBBox(id, opt) {
+    return doc.getElementById(id).getBBox(opt);
+  }
+
+  function checkBBox(id, opt, x, y, width, height, error) {
+    var bbox = getBBox(id, opt);
+    isFuzzy(bbox.x, x, error, id + ".getBBox().x");
+    isFuzzy(bbox.y, y, error, id + ".getBBox().y");
+    isFuzzy(bbox.width, width, error, id + ".getBBox().width");
+    isFuzzy(bbox.height, height, error, id + ".getBBox().height");
+  }
+
+  function compareBBox1(id1, id2) {
+    var bbox1 = getBBox(id1);
+    var bbox2 = getBBox(id2);
+    is(bbox1.x, bbox2.x, id1 + ".getBBox().x");
+    is(bbox1.y, bbox2.y, id1 + ".getBBox().y");
+    isFuzzy(bbox1.width, bbox2.width, 0.0002, id1 + ".getBBox().width");
+    isFuzzy(bbox1.height, bbox2.height, 0.0001, id1 + ".getBBox().height");
+  }
+
+  function compareBBox2(id1, id2) {
+    // without 'x'
+    var bbox1 = getBBox(id1);
+    var bbox2 = getBBox(id2);
+    is(bbox1.y, bbox2.y, id1 + ".getBBox().y");
+    isFuzzy(bbox1.width, bbox2.width, 0.0002, id1 + ".getBBox().width");
+    isFuzzy(bbox1.height, bbox2.height, 0.0001, id1 + ".getBBox().height");
+  }
+
+  var opt = { fill: true, stroke: true, markers: true, clipped: true };
+
+  // <text>
+  // fill
+  opt = { fill: true, stroke: false, markers: false, clipped: false };
+  compareBBox1("text1","text3");
+  compareBBox1("text2","text4");
+  compareBBox1("text5","text6");
+  // all
+  opt = { fill: true, stroke: true, markers: true, clipped: true };
+  compareBBox2("text1","text3");
+  compareBBox2("text2","text4");
+  compareBBox2("text5","text6");
+  // clipped
+  opt = { fill: false, stroke: false, markers: false, clipped: true };
+  compareBBox2("text1","text3");
+  compareBBox2("text2","text4");
+  compareBBox2("text5","text6");
+
+  // <image>
+  opt = { fill: true, stroke: true, markers: true, clipped: true };
+  checkBBox("image1", opt, 250, 250, 100, 100);
+  checkBBox("image2", opt, 53, 53, 149, 149);
+  checkBBox("image3", opt, 205, 53, 148, 149);
+  checkBBox("image4", opt, 53, 205, 149, 148);
+  checkBBox("image5", opt, 205, 205, 148, 148);
+  checkBBox("image6", opt, 52, 52, 100, 100);
+  checkBBox("image7", opt, 255, 52, 100, 100);
+  checkBBox("image8", opt, 52, 255, 100, 100);
+  checkBBox("image9", opt, 255, 255, 100, 100);
+  checkBBox("image10", opt, 200, 200, 200, 200);
+  checkBBox("image11", opt, 0, 0, 0, 0);
+  checkBBox("image12", opt, 43, 43, 714, 660);
+  checkBBox("image13", opt, 50, 50, 300, 300);
+  checkBBox("image14", opt, 0, 0, 0, 0);
+
+  opt = { fill: true, stroke: false, markers: false, clipped: false };
+  checkBBox("image1", opt, 150,150,200,200, 0);
+  checkBBox("image2", opt, 2,2,200,200, 0);
+  checkBBox("image3", opt, 205,2,200,200, 0);
+  checkBBox("image4", opt, 2,205,200,200, 0);
+  checkBBox("image5", opt, 205,205,200,200, 0);
+  checkBBox("image6", opt, 2,2,200,200, 0);
+  checkBBox("image7", opt, 205,2,200,200, 0);
+  checkBBox("image8", opt, 2,205,200,200, 0);
+  checkBBox("image9", opt, 205,205,200,200, 0);
+  checkBBox("image10", opt, 0,0,400,400, 0);
+  checkBBox("image11", opt, 0,0,400,400, 0);
+  checkBBox("image12", opt, 25,43,768,768, 0);
+  checkBBox("image13", opt, 0,0,400,400, 0);
+  
+  // <path>
+  opt = { fill: true, stroke: true, markers: true, clipped: true };
+  checkBBox("path1", opt, 2,17,120,95, 0);
+  checkBBox("path2", opt, 156,21,116,91, 0);
+  checkBBox("path3", opt, 6,121,116,91, 0);
+  checkBBox("path4", opt, 2,17,98,83, 0);
+  checkBBox("path5", opt, 156,21,44,79, 0);
+  checkBBox("path6", opt, 6,150,94,62, 0);
+  checkBBox("path7", opt, 2,17,98,83, 0);
+  checkBBox("path8", opt, 156,21,94,79, 0);
+  checkBBox("path9", opt, 6,121,94,79, 0);
+  checkBBox("path10", opt, 10,25,100,75, 0);
+  checkBBox("path11", opt, 160,25,100,75, 0);
+  checkBBox("path12", opt, 10,125,100,75, 0);
+
+  opt = { fill: true, stroke: false, markers: false, clipped: true };
+  checkBBox("path1", opt, 10,25,100,75, 0);
+  checkBBox("path2", opt, 160,25,100,75, 0);
+  checkBBox("path3", opt, 10,125,100,75, 0);
+  checkBBox("path4", opt, 10,25,90,75, 0);
+  checkBBox("path5", opt, 160,25,40,75, 0);
+  checkBBox("path6", opt, 10,150,90,50, 0);
+  checkBBox("path7", opt, 10,25,90,75, 0);
+  checkBBox("path8", opt, 160,25,90,75, 0);
+  checkBBox("path9", opt, 10,125,90,75, 0);
+  checkBBox("path10", opt, 10,25,100,75, 0);
+  checkBBox("path11", opt, 160,25,100,75, 0);
+  checkBBox("path12", opt, 10,125,100,75, 0);
+
+  opt = { fill: true, stroke: false, markers: false, clipped: false };
+  checkBBox("path1", opt, 10,25,100,75, 0);
+  checkBBox("path2", opt, 160,25,100,75, 0);
+  checkBBox("path3", opt, 10,125,100,75, 0);
+  checkBBox("path4", opt, 10,25,100,75, 0);
+  checkBBox("path5", opt, 160,25,100,75, 0);
+  checkBBox("path6", opt, 10,125,100,75, 0);
+  checkBBox("path7", opt, 10,25,100,75, 0);
+  checkBBox("path8", opt, 160,25,100,75, 0);
+  checkBBox("path9", opt, 10,125,100,75, 0);
+  checkBBox("path10", opt, 10,25,100,75, 0);
+  checkBBox("path11", opt, 160,25,100,75, 0);
+  checkBBox("path12", opt, 10,125,100,75, 0);
+
+  opt = { fill: false, stroke: true, markers: false, clipped: false };
+  checkBBox("path1", opt, 2,17,116,91, 0);
+  checkBBox("path2", opt, 156,21,108,83, 0);
+  checkBBox("path3", opt, 6,121,108,83, 0);
+  checkBBox("path4", opt, 2,17,116,91, 0);
+  checkBBox("path5", opt, 156,21,108,83, 0);
+  checkBBox("path6", opt, 6,121,108,83, 0);
+  checkBBox("path7", opt, 2,17,116,91, 0);
+  checkBBox("path8", opt, 156,21,108,83, 0);
+  checkBBox("path9", opt, 6,121,108,83, 0);
+  checkBBox("path10", opt, 2,17,116,91, 0);
+  checkBBox("path11", opt, 156,21,108,83, 0);
+  checkBBox("path12", opt, 6,121,108,83, 0);
+
+  opt = { fill: false, stroke: false, markers: true, clipped: false };
+  checkBBox("path1", opt, 10,25,112,87, 0);
+  checkBBox("path2", opt, 160,25,112,87, 0);
+  checkBBox("path3", opt, 10,125,112,87, 0);
+  checkBBox("path4", opt, 10,25,112,87, 0);
+  checkBBox("path5", opt, 160,25,112,87, 0);
+  checkBBox("path6", opt, 10,125,112,87, 0);
+  checkBBox("path7", opt, 10,25,112,87, 0);
+  checkBBox("path8", opt, 160,25,112,87, 0);
+  checkBBox("path9", opt, 10,125,112,87, 0);
+  checkBBox("path10", opt, 10,25,112,87, 0);
+  checkBBox("path11", opt, 160,25,112,87, 0);
+  checkBBox("path12", opt, 10,125,112,87, 0);
+
+  // <use>
+  opt = { fill: true, stroke: false, markers: false, clipped: false };
+  checkBBox("use1", opt, 70,70,180,180, 0);
+  checkBBox("use2", opt, 250,70,180,180, 0);
+  checkBBox("use3", opt, 70,250,180,180, 0);
+  checkBBox("use4", opt, 22,22,180,180, 0);
+  checkBBox("use5", opt, 225,22,180,180, 0);
+  checkBBox("use6", opt, 22,225,180,180, 0);
+  checkBBox("use7", opt, 225,225,180,180, 0);
+
+  opt = { fill: true, stroke: true, markers: true, clipped: true };
+  checkBBox("use1", opt, 70,66,180,94, 0);
+  checkBBox("use2", opt, 250,70,180,90, 0);
+  checkBBox("use3", opt, 70,250,180,90, 0);
+  checkBBox("use4", opt, 18,18,134,134, 0);
+  checkBBox("use5", opt, 221,18,134,134, 0);
+  checkBBox("use6", opt, 18,221,134,134, 0);
+  checkBBox("use7", opt, 221,221,134,134, 0);
+  checkBBox("use8", opt, 0,0,0,0, 0);
+
+  // <foreignObject>
+  opt = { fill: true, stroke: false, markers: false, clipped: false };
+  checkBBox("fo1", opt, 2,2,200,200, 0);
+  checkBBox("fo2", opt, 205,2,200,200, 0);
+  checkBBox("fo3", opt, 2,205,200,200, 0);
+  checkBBox("fo4", opt, 205,205,200,200, 0);
+  checkBBox("fo5", opt, 250,250,200,200, 0);
+  checkBBox("fo6", opt, 0,0,200,200, 0);
+  checkBBox("fo7", opt, 0,0,200,200, 0);
+
+  opt = { fill: true, stroke: true, markers: true, clipped: true };
+  checkBBox("fo1", opt, 53,53,51,51, 0);
+  checkBBox("fo2", opt, 205,53,148,149, 0);
+  checkBBox("fo3", opt, 53,205,149,148, 0);
+  checkBBox("fo4", opt, 207,207,100,100, 0);
+  checkBBox("fo5", opt, 0,0,0,0, 0);
+  checkBBox("fo6", opt, 100,100,100,100, 0);
+  checkBBox("fo7", opt, 10,10,180,180, 0);
+  checkBBox("fo8", opt, 0,0,0,0, 0);
+
+  // from http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObjectApproved/masking-path-07-b.html
+  opt = { fill: true, stroke: true, markers: true, clipped: true };
+  checkBBox("rect-1", opt, 10,10,140,140, 0);
+  checkBBox("rect-2", opt, 50,30,25,100, 0);
+  checkBBox("rect-3", opt, 50,50,100,100, 0);
+  checkBBox("g1", opt, 50,50,100,100, 0);
+
+  SimpleTest.finish();
+}
+
+window.addEventListener("load", run, false);
+
+</script>
+</pre>
+</body>
+</html>
--- a/layout/reftests/invalidation/reftest.list
+++ b/layout/reftests/invalidation/reftest.list
@@ -16,29 +16,29 @@ pref(layout.animated-image-layers.enable
 == filter-userspace-offset.svg?offsetContainer=use&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=flood-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=matrix-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=flood-userSpace-at100 filter-userspace-offset.svg
-== filter-userspace-offset.svg?offsetContainer=use&filter=flood-userSpace-atZero filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=use&filter=flood-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=flood-userSpace-atZero filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=flood-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-userSpace-at100 filter-userspace-offset.svg
-== filter-userspace-offset.svg?offsetContainer=use&filter=matrix-userSpace-atZero filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=use&filter=matrix-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&filter=matrix-userSpace-atZero filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&filter=matrix-userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=use&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&mask=boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&mask=userSpace-at100 filter-userspace-offset.svg
-== filter-userspace-offset.svg?offsetContainer=use&mask=userSpace-atZero filter-userspace-offset.svg
+== filter-userspace-offset.svg?offsetContainer=use&mask=userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=innerSVG&mask=userSpace-atZero filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=foreignObject&mask=userSpace-at100 filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-boundingBox filter-userspace-offset.svg
 == filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-userSpace-at100 filter-userspace-offset.svg
 == scroll-inactive-layers.html scroll-inactive-layers.html
 == scroll-inactive-layers-2.html scroll-inactive-layers-2.html
 != inactive-layertree-visible-region-1.html about:blank
 != inactive-layertree-visible-region-2.html about:blank