Back out d39b5acb8d83 and cf778a07299d (bug 847120) for Windows build bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 10 Mar 2013 22:54:32 -0700
changeset 124355 72952b8e3e811f9e62642f4b20642fd7ba0b405d
parent 124354 f3817c9dc83d3d31afa4a2a09ada2fd99bffb661
child 124356 885607afe05c5aca872d9244b7659fb76a804734
push id24417
push userryanvm@gmail.com
push dateMon, 11 Mar 2013 23:58:07 +0000
treeherdermozilla-central@7433bc4545c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs847120
milestone22.0a1
backs outd39b5acb8d83c05ecead7963d63e1251e927ba1c
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
Back out d39b5acb8d83 and cf778a07299d (bug 847120) for Windows build bustage
content/svg/content/src/Makefile.in
content/svg/content/src/SVGFETileElement.cpp
content/svg/content/src/SVGFETileElement.h
content/svg/content/src/nsSVGFilters.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoClasses.h
dom/interfaces/svg/nsIDOMSVGFilters.idl
dom/webidl/SVGFETileElement.webidl
dom/webidl/WebIDL.mk
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -79,17 +79,16 @@ CPPSRCS		= \
 		SVGDescElement.cpp \
 		SVGElementFactory.cpp \
 		SVGEllipseElement.cpp \
 		SVGFEBlendElement.cpp \
 		SVGFEFloodElement.cpp \
 		SVGFEImageElement.cpp \
 		SVGFEMergeElement.cpp \
 		SVGFEMergeNodeElement.cpp \
-		SVGFETileElement.cpp \
 		SVGFilterElement.cpp \
 		SVGForeignObjectElement.cpp \
 		SVGFragmentIdentifier.cpp \
 		SVGGElement.cpp \
 		SVGGradientElement.cpp \
 		SVGGraphicsElement.cpp \
 		SVGImageElement.cpp \
 		SVGIntegerPairSMILType.cpp \
@@ -176,17 +175,16 @@ EXPORTS_mozilla/dom = \
 	SVGDefsElement.h \
 	SVGDescElement.h \
 	SVGEllipseElement.h \
 	SVGFEBlendElement.h \
 	SVGFEFloodElement.h \
 	SVGFEImageElement.h \
 	SVGFEMergeElement.h \
 	SVGFEMergeNodeElement.h \
-	SVGFETileElement.h \
 	SVGFilterElement.h \
 	SVGForeignObjectElement.h \
 	SVGGElement.h \
 	SVGGradientElement.h \
 	SVGGraphicsElement.h \
 	SVGImageElement.h \
 	SVGLineElement.h \
 	SVGMarkerElement.h \
deleted file mode 100644
--- a/content/svg/content/src/SVGFETileElement.cpp
+++ /dev/null
@@ -1,441 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/SVGFETileElement.h"
-#include "mozilla/dom/SVGFETileElementBinding.h"
-#include "nsSVGFilterInstance.h"
-#include "gfxUtils.h"
-
-NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FETile)
-
-namespace mozilla {
-namespace dom {
-
-JSObject*
-SVGFETileElement::WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
-{
-  return SVGFETileElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
-}
-
-nsSVGElement::StringInfo SVGFETileElement::sStringInfo[2] =
-{
-  { &nsGkAtoms::result, kNameSpaceID_None, true },
-  { &nsGkAtoms::in, kNameSpaceID_None, true }
-};
-
-//----------------------------------------------------------------------
-// nsISupports methods
-
-NS_IMPL_ADDREF_INHERITED(SVGFETileElement,SVGFETileElementBase)
-NS_IMPL_RELEASE_INHERITED(SVGFETileElement,SVGFETileElementBase)
-
-NS_INTERFACE_TABLE_HEAD(SVGFETileElement)
-  NS_NODE_INTERFACE_TABLE3(SVGFETileElement, nsIDOMNode, nsIDOMElement,
-                           nsIDOMSVGElement)
-NS_INTERFACE_MAP_END_INHERITING(SVGFETileElementBase)
-
-//----------------------------------------------------------------------
-// nsIDOMNode methods
-
-
-NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFETileElement)
-
-already_AddRefed<nsIDOMSVGAnimatedString>
-SVGFETileElement::In1()
-{
-  return mStringAttributes[IN1].ToDOMAnimatedString(this);
-}
-
-void
-SVGFETileElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
-{
-  aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this));
-}
-
-nsIntRect
-SVGFETileElement::ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
-        const nsSVGFilterInstance& aInstance)
-{
-  return GetMaxRect();
-}
-
-void
-SVGFETileElement::ComputeNeededSourceBBoxes(const nsIntRect& aTargetBBox,
-          nsTArray<nsIntRect>& aSourceBBoxes, const nsSVGFilterInstance& aInstance)
-{
-  // Just assume we need the entire source bounding box, so do nothing.
-}
-
-nsIntRect
-SVGFETileElement::ComputeChangeBBox(const nsTArray<nsIntRect>& aSourceChangeBoxes,
-                                    const nsSVGFilterInstance& aInstance)
-{
-  return GetMaxRect();
-}
-
-//----------------------------------------------------------------------
-// nsSVGElement methods
-
-/*
- * This function computes the size of partial match on either side of the tile.
- * eg: If we are talking about the X-axis direction, then it computes, the 
- * size of the tile that would be copied to the lesser X-axis side (usually
- * left), the higher X-axis side (usualy right) and the centre.
- * This is needed because often, the tile doesn't exactly align to the target
- * region and is partially copied on the edges. This function computes the
- * dimensions of the partially copied regions in one axis.
- *
- * OUTPUT:
- * aLesserSidePartialMatchSize: The size of the partial match on the lesser
- *                              side of the axis being considered.
- *                              eg: for X-axis, usually left side and
- *                                  for Y-axis, usually top
- * aHigherSidePartialMatchSize: The size of the partial match on the higher
- *                              side of the axis being considered.
- *                              eg: for X-axis, usually right side and
- *                                  for Y-axis, usually bottom
- * aCentreSize: The size of the target area where the tile is copied in full.
- *              This lies between the lesser and higher side partial matches.
- *              (the partially matched areas may be of zero width)
- *
- * INPUT:
- * aLesserTargetExtent: Edge of the target area on the axis being considered
- *                      on the lesser side. (eg: usually left on the X-axis)
- * aTargetSize: Size of the target area on the axis being considered (eg:
- *              usually width for X-axis)
- * aLesserTileExtent: Edge of the tile on the axis being considered on the
- *                    lesser side.
- * aTileSize: Size of the tile on the axis being considered.
- */
-static inline void
-ComputePartialTileExtents(int32_t *aLesserSidePartialMatchSize,
-                          int32_t *aHigherSidePartialMatchSize,
-                          int32_t *aCentreSize,
-                          int32_t aLesserTargetExtent,
-                          int32_t aTargetSize,
-                          int32_t aLesserTileExtent,
-                          int32_t aTileSize)
-{
-  int32_t targetExtentMost = aLesserTargetExtent + aTargetSize;
-  int32_t tileExtentMost = aLesserTileExtent + aTileSize;
-
-  int32_t lesserSidePartialMatchSize;
-  if (aLesserTileExtent < aLesserTargetExtent) {
-    lesserSidePartialMatchSize = tileExtentMost - aLesserTargetExtent;
-  } else {
-    lesserSidePartialMatchSize = (aLesserTileExtent - aLesserTargetExtent) %
-                                    aTileSize;
-  }
-
-  int32_t higherSidePartialMatchSize;
-  if (lesserSidePartialMatchSize > aTargetSize) {
-    lesserSidePartialMatchSize = aTargetSize;
-    higherSidePartialMatchSize = 0;
-  } else if (tileExtentMost > targetExtentMost) {
-      higherSidePartialMatchSize = targetExtentMost - aLesserTileExtent;
-  } else {
-    higherSidePartialMatchSize = (targetExtentMost - tileExtentMost) %
-                                    aTileSize;
-  }
-
-  if (lesserSidePartialMatchSize + higherSidePartialMatchSize >
-        aTargetSize) {
-    higherSidePartialMatchSize = aTargetSize - lesserSidePartialMatchSize;
-  }
-
-  /*
-   * To understand the conditon below, let us consider the X-Axis:
-   * Lesser side is left and the Higher side is right.
-   * This implies:
-   * aTargetSize is rect.width.
-   * lesserSidePartialMatchSize would mean leftPartialTileWidth.
-   * higherSidePartialMatchSize would mean rightPartialTileWidth.
-   *
-   * leftPartialTileWidth == rect.width only happens when the tile entirely
-   * overlaps with the target area in the X-axis and exceeds its bounds by at
-   * least one pixel on the lower X-Axis side.
-   *
-   * leftPartialTileWidth + rightPartialTileWidth == rect.width only happens
-   * when the tile overlaps the target area in such a way that the edge of the
-   * tile on the higher X-Axis side cuts through the target area and there is no
-   * space for a complete tile in the X-Axis in the target area on either side
-   * of that edge. In this scenario, centre will be of zero width and the
-   * partial widths on left and right will add up to the width of the rect. In
-   * case the tile is bigger than the rect in the X-axis, it will get clipped
-   * and remain equal to rect.width.
-   *
-   * Therefore, those two conditions are separate cases which lead to centre
-   * being of zero width.
-   *
-   * The condition below is the same logic as above expressed independent of
-   * the axis in consideration.
-   */
-
-  int32_t centreSize;
-  if (lesserSidePartialMatchSize == aTargetSize ||
-        lesserSidePartialMatchSize + higherSidePartialMatchSize ==
-        aTargetSize) {
-    centreSize = 0;
-  } else {
-    centreSize = aTargetSize -
-                   (lesserSidePartialMatchSize + higherSidePartialMatchSize);
-  }
-
-  *aLesserSidePartialMatchSize = lesserSidePartialMatchSize;
-  *aHigherSidePartialMatchSize = higherSidePartialMatchSize;
-  *aCentreSize = centreSize;
-}
-
-static inline void
-TilePixels(uint8_t *aTargetData,
-           const uint8_t *aSourceData,
-           const nsIntRect &targetRegion,
-           const nsIntRect &aTile,
-           uint32_t aStride)
-{
-  if (targetRegion.IsEmpty()) {
-    return;
-  }
-
-  uint32_t tileRowCopyMemSize = aTile.width * 4;
-  uint32_t numTimesToCopyTileRows = targetRegion.width / aTile.width;
-
-  uint8_t *targetFirstRowOffset = aTargetData + 4 * targetRegion.x;
-  const uint8_t *tileFirstRowOffset = aSourceData + 4 * aTile.x;
-
-  int32_t tileYOffset = 0;
-  for (int32_t targetY = targetRegion.y;
-       targetY < targetRegion.YMost();
-       ++targetY) {
-    uint8_t *targetRowOffset = targetFirstRowOffset + aStride * targetY;
-    const uint8_t *tileRowOffset = tileFirstRowOffset +
-                                             aStride * (aTile.y + tileYOffset);
-
-    for (uint32_t i = 0; i < numTimesToCopyTileRows; ++i) {
-      memcpy(targetRowOffset + i * tileRowCopyMemSize,
-             tileRowOffset,
-             tileRowCopyMemSize);
-    }
-
-    tileYOffset = (tileYOffset + 1) % aTile.height;
-  }
-}
-
-nsresult
-SVGFETileElement::Filter(nsSVGFilterInstance *instance,
-                         const nsTArray<const Image*>& aSources,
-                         const Image* aTarget,
-                         const nsIntRect& rect)
-{
-  // XXX This code depends on the surface rect containing the filter
-  // primitive subregion. ComputeTargetBBox, ComputeNeededSourceBBoxes
-  // and ComputeChangeBBox are all pessimal, so that will normally be OK,
-  // but nothing clips mFilterPrimitiveSubregion so this should be changed.
-
-  nsIntRect tile;
-  bool res = gfxUtils::GfxRectToIntRect(aSources[0]->mFilterPrimitiveSubregion,
-                                        &tile);
-
-  NS_ENSURE_TRUE(res, NS_ERROR_FAILURE); // asserts on failure (not 
-  if (tile.IsEmpty())
-    return NS_OK;
-
-  const nsIntRect &surfaceRect = instance->GetSurfaceRect();
-  if (!tile.Intersects(surfaceRect)) {
-    // nothing to draw
-    return NS_OK;
-  }
-
-  // clip tile
-  tile = tile.Intersect(surfaceRect);
-
-  // Get it into surface space
-  tile -= surfaceRect.TopLeft();
-
-  uint8_t* sourceData = aSources[0]->mImage->Data();
-  uint8_t* targetData = aTarget->mImage->Data();
-  uint32_t stride = aTarget->mImage->Stride();
-
-  /*
-   * priority: left before right before centre
-   *             and
-   *           top before bottom before centre
-   *
-   * eg: If we have a target area which is 1.5 times the width of a tile,
-   *     then, based on alignment, we get:
-   *       'left and right'
-   *         or
-   *       'left and centre'
-   *
-   */
-
-  int32_t leftPartialTileWidth;
-  int32_t rightPartialTileWidth;
-  int32_t centreWidth;
-  ComputePartialTileExtents(&leftPartialTileWidth,
-                            &rightPartialTileWidth,
-                            &centreWidth,
-                            rect.x,
-                            rect.width,
-                            tile.x,
-                            tile.width);
-
-  int32_t topPartialTileHeight;
-  int32_t bottomPartialTileHeight;
-  int32_t centreHeight;
-  ComputePartialTileExtents(&topPartialTileHeight,
-                            &bottomPartialTileHeight,
-                            &centreHeight,
-                            rect.y,
-                            rect.height,
-                            tile.y,
-                            tile.height);
-
-  /* We have nine regions of the target area which have to be tiled differetly:
-   *
-   * Top Left,    Top Middle,    Top Right,
-   * Left Middle, Centre,        Right Middle,
-   * Bottom Left, Bottom Middle, Bottom Right
-   *
-   * + Centre is tiled by repeating the tiled image in full.
-   * + Top Left, Top Middle and Top Right:
-   *     Some of the rows from the top of the tile will be clipped here.
-   * + Bottom Left, Bottom Middle and Bottom Right:
-   *     Some of the rows from the bottom of the tile will be clipped here.
-   * + Top Left, Left Middle and Bottom left:
-   *     Some of the columns from the Left of the tile will be clipped here.
-   * + Top Right, Right Middle and Bottom Right:
-   *     Some of the columns from the right of the tile will be clipped here.
-   *
-   * If the sizes and positions of the target and tile are such that the tile
-   * aligns exactly on any (or all) of the edges, then some (or all) of the
-   * regions above (except Centre) will be zero sized.
-   */
-
-  nsIntRect targetRects[] = {
-    // Top Left
-    nsIntRect(rect.x, rect.y, leftPartialTileWidth, topPartialTileHeight),
-    // Top Middle
-    nsIntRect(rect.x + leftPartialTileWidth,
-              rect.y,
-              centreWidth,
-              topPartialTileHeight),
-    // Top Right
-    nsIntRect(rect.XMost() - rightPartialTileWidth,
-              rect.y,
-              rightPartialTileWidth,
-              topPartialTileHeight),
-    // Left Middle
-    nsIntRect(rect.x,
-              rect.y + topPartialTileHeight,
-              leftPartialTileWidth,
-              centreHeight),
-    // Centre
-    nsIntRect(rect.x + leftPartialTileWidth,
-              rect.y + topPartialTileHeight,
-              centreWidth,
-              centreHeight),
-    // Right Middle
-    nsIntRect(rect.XMost() - rightPartialTileWidth,
-              rect.y + topPartialTileHeight,
-              rightPartialTileWidth,
-              centreHeight),
-    // Bottom Left
-    nsIntRect(rect.x,
-              rect.YMost() - bottomPartialTileHeight,
-              leftPartialTileWidth,
-              bottomPartialTileHeight),
-    // Bottom Middle
-    nsIntRect(rect.x + leftPartialTileWidth,
-              rect.YMost() - bottomPartialTileHeight,
-              centreWidth,
-              bottomPartialTileHeight),
-    // Bottom Right
-    nsIntRect(rect.XMost() - rightPartialTileWidth,
-              rect.YMost() - bottomPartialTileHeight,
-              rightPartialTileWidth,
-              bottomPartialTileHeight)
-  };
-
-  nsIntRect tileRects[] = {
-    // Top Left
-    nsIntRect(tile.XMost() - leftPartialTileWidth,
-              tile.YMost() - topPartialTileHeight,
-              leftPartialTileWidth,
-              topPartialTileHeight),
-    // Top Middle
-    nsIntRect(tile.x,
-              tile.YMost() - topPartialTileHeight,
-              tile.width,
-              topPartialTileHeight),
-    // Top Right
-    nsIntRect(tile.x,
-              tile.YMost() - topPartialTileHeight,
-              rightPartialTileWidth,
-              topPartialTileHeight),
-    // Left Middle
-    nsIntRect(tile.XMost() - leftPartialTileWidth,
-              tile.y,
-              leftPartialTileWidth,
-              tile.height),
-    // Centre
-    nsIntRect(tile.x,
-              tile.y,
-              tile.width,
-              tile.height),
-    // Right Middle
-    nsIntRect(tile.x,
-              tile.y,
-              rightPartialTileWidth,
-              tile.height),
-    // Bottom Left
-    nsIntRect(tile.XMost() - leftPartialTileWidth,
-              tile.y,
-              leftPartialTileWidth,
-              bottomPartialTileHeight),
-    // Bottom Middle
-    nsIntRect(tile.x,
-              tile.y,
-              tile.width,
-              bottomPartialTileHeight),
-    // Bottom Right
-    nsIntRect(tile.x,
-              tile.y,
-              rightPartialTileWidth,
-              bottomPartialTileHeight)
-  };
-
-  for (uint32_t i = 0; i < ArrayLength(targetRects); ++i) {
-    TilePixels(targetData,
-               sourceData,
-               targetRects[i],
-               tileRects[i],
-               stride);
-  }
-
-  return NS_OK;
-}
-
-bool
-SVGFETileElement::AttributeAffectsRendering(int32_t aNameSpaceID,
-                                            nsIAtom* aAttribute) const
-{
-  return SVGFETileElementBase::AttributeAffectsRendering(aNameSpaceID,
-                                                         aAttribute) ||
-           (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::in);
-}
-
-//----------------------------------------------------------------------
-// nsSVGElement methods
-
-nsSVGElement::StringAttributesInfo
-SVGFETileElement::GetStringInfo()
-{
-  return StringAttributesInfo(mStringAttributes, sStringInfo,
-                              ArrayLength(sStringInfo));
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/content/svg/content/src/SVGFETileElement.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_SVGFETileElement_h
-#define mozilla_dom_SVGFETileElement_h
-
-#include "nsSVGFilters.h"
-
-nsresult NS_NewSVGFETileElement(nsIContent **aResult,
-                                already_AddRefed<nsINodeInfo> aNodeInfo);
-
-namespace mozilla {
-namespace dom {
-
-typedef nsSVGFE SVGFETileElementBase;
-
-class SVGFETileElement : public SVGFETileElementBase,
-                         public nsIDOMSVGElement
-{
-  friend nsresult (::NS_NewSVGFETileElement(nsIContent **aResult,
-                                            already_AddRefed<nsINodeInfo> aNodeInfo));
-protected:
-  SVGFETileElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-    : SVGFETileElementBase(aNodeInfo)
-  {
-    SetIsDOMBinding();
-  }
-  virtual JSObject* WrapNode(JSContext *cx, JSObject *scope, bool *triedToWrap) MOZ_OVERRIDE;
-
-public:
-  virtual bool SubregionIsUnionOfRegions() { return false; }
-
-  // interfaces:
-  NS_DECL_ISUPPORTS_INHERITED
-
-  virtual nsresult Filter(nsSVGFilterInstance* aInstance,
-                          const nsTArray<const Image*>& aSources,
-                          const Image* aTarget,
-                          const nsIntRect& aDataRect);
-  virtual bool AttributeAffectsRendering(
-          int32_t aNameSpaceID, nsIAtom* aAttribute) const;
-  virtual nsSVGString& GetResultImageName() { return mStringAttributes[RESULT]; }
-  virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources);
-  virtual nsIntRect ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
-          const nsSVGFilterInstance& aInstance);
-  virtual void ComputeNeededSourceBBoxes(const nsIntRect& aTargetBBox,
-          nsTArray<nsIntRect>& aSourceBBoxes, const nsSVGFilterInstance& aInstance);
-  virtual nsIntRect ComputeChangeBBox(const nsTArray<nsIntRect>& aSourceChangeBoxes,
-          const nsSVGFilterInstance& aInstance);
-
-  NS_FORWARD_NSIDOMSVGELEMENT(SVGFETileElementBase::)
-
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-
-  // WebIDL
-  already_AddRefed<nsIDOMSVGAnimatedString> In1();
-
-protected:
-  virtual StringAttributesInfo GetStringInfo();
-
-  enum { RESULT, IN1 };
-  nsSVGString mStringAttributes[2];
-  static StringInfo sStringInfo[2];
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_SVGFETileElement_h
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -2187,16 +2187,509 @@ nsSVGFEOffsetElement::GetNumberInfo()
 
 nsSVGElement::StringAttributesInfo
 nsSVGFEOffsetElement::GetStringInfo()
 {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
 
+//---------------------Tile------------------------
+
+typedef nsSVGFE nsSVGFETileElementBase;
+
+class nsSVGFETileElement : public nsSVGFETileElementBase,
+                           public nsIDOMSVGFETileElement
+{
+  friend nsresult NS_NewSVGFETileElement(nsIContent **aResult,
+                                         already_AddRefed<nsINodeInfo> aNodeInfo);
+protected:
+  nsSVGFETileElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : nsSVGFETileElementBase(aNodeInfo) {}
+
+public:
+  virtual bool SubregionIsUnionOfRegions() { return false; }
+
+  // interfaces:
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // FE Base
+  NS_FORWARD_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES(nsSVGFETileElementBase::)
+
+  virtual nsresult Filter(nsSVGFilterInstance* aInstance,
+                          const nsTArray<const Image*>& aSources,
+                          const Image* aTarget,
+                          const nsIntRect& aDataRect);
+  virtual bool AttributeAffectsRendering(
+          int32_t aNameSpaceID, nsIAtom* aAttribute) const;
+  virtual nsSVGString& GetResultImageName() { return mStringAttributes[RESULT]; }
+  virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources);
+  virtual nsIntRect ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
+          const nsSVGFilterInstance& aInstance);
+  virtual void ComputeNeededSourceBBoxes(const nsIntRect& aTargetBBox,
+          nsTArray<nsIntRect>& aSourceBBoxes, const nsSVGFilterInstance& aInstance);
+  virtual nsIntRect ComputeChangeBBox(const nsTArray<nsIntRect>& aSourceChangeBoxes,
+          const nsSVGFilterInstance& aInstance);
+
+  // Tile
+  NS_DECL_NSIDOMSVGFETILEELEMENT
+
+  NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFETileElementBase::)
+
+  NS_FORWARD_NSIDOMNODE_TO_NSINODE
+  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
+
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+
+  virtual nsXPCClassInfo* GetClassInfo();
+
+  virtual nsIDOMNode* AsDOMNode() { return this; }
+protected:
+  virtual StringAttributesInfo GetStringInfo();
+  
+  enum { RESULT, IN1 };
+  nsSVGString mStringAttributes[2];
+  static StringInfo sStringInfo[2];
+};
+
+nsSVGElement::StringInfo nsSVGFETileElement::sStringInfo[2] =
+{
+  { &nsGkAtoms::result, kNameSpaceID_None, true },
+  { &nsGkAtoms::in, kNameSpaceID_None, true }
+};
+
+NS_IMPL_NS_NEW_SVG_ELEMENT(FETile)
+
+//----------------------------------------------------------------------
+// nsISupports methods
+
+NS_IMPL_ADDREF_INHERITED(nsSVGFETileElement,nsSVGFETileElementBase)
+NS_IMPL_RELEASE_INHERITED(nsSVGFETileElement,nsSVGFETileElementBase)
+
+DOMCI_NODE_DATA(SVGFETileElement, nsSVGFETileElement)
+
+NS_INTERFACE_TABLE_HEAD(nsSVGFETileElement)
+  NS_NODE_INTERFACE_TABLE5(nsSVGFETileElement, nsIDOMNode, nsIDOMElement,
+                           nsIDOMSVGElement,
+                           nsIDOMSVGFilterPrimitiveStandardAttributes,
+                           nsIDOMSVGFETileElement)
+  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFETileElement)
+NS_INTERFACE_MAP_END_INHERITING(nsSVGFETileElementBase)
+
+//----------------------------------------------------------------------
+// nsIDOMNode methods
+
+
+NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFETileElement)
+
+
+//----------------------------------------------------------------------
+// nsSVGFETileElement methods
+
+/* readonly attribute nsIDOMSVGAnimatedString in1; */
+NS_IMETHODIMP nsSVGFETileElement::GetIn1(nsIDOMSVGAnimatedString * *aIn)
+{
+  return mStringAttributes[IN1].ToDOMAnimatedString(aIn, this);
+}
+
+void
+nsSVGFETileElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources)
+{
+  aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this));
+}
+
+nsIntRect
+nsSVGFETileElement::ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
+        const nsSVGFilterInstance& aInstance)
+{
+  return GetMaxRect();
+}
+
+void
+nsSVGFETileElement::ComputeNeededSourceBBoxes(const nsIntRect& aTargetBBox,
+          nsTArray<nsIntRect>& aSourceBBoxes, const nsSVGFilterInstance& aInstance)
+{
+  // Just assume we need the entire source bounding box, so do nothing.
+}
+
+nsIntRect
+nsSVGFETileElement::ComputeChangeBBox(const nsTArray<nsIntRect>& aSourceChangeBoxes,
+                                      const nsSVGFilterInstance& aInstance)
+{
+  return GetMaxRect();
+}
+
+static int32_t WrapInterval(int32_t aVal, int32_t aMax)
+{
+  aVal = aVal % aMax;
+  return aVal < 0 ? aMax + aVal : aVal;
+}
+
+//----------------------------------------------------------------------
+// nsSVGElement methods
+
+/*
+ * This function computes the size of partial match on either side of the tile.
+ * eg: If we are talking about the X-axis direction, then it computes, the 
+ * size of the tile that would be copied to the lesser X-axis side (usually
+ * left), the higher X-axis side (usualy right) and the centre.
+ * This is needed because often, the tile doesn't exactly align to the target
+ * region and is partially copied on the edges. This function computes the
+ * dimensions of the partially copied regions in one axis.
+ *
+ * OUTPUT:
+ * aLesserSidePartialMatchSize: The size of the partial match on the lesser
+ *                              side of the axis being considered.
+ *                              eg: for X-axis, usually left side and
+ *                                  for Y-axis, usually top
+ * aHigherSidePartialMatchSize: The size of the partial match on the higher
+ *                              side of the axis being considered.
+ *                              eg: for X-axis, usually right side and
+ *                                  for Y-axis, usually bottom
+ * aCentreSize: The size of the target area where the tile is copied in full.
+ *              This lies between the lesser and higher side partial matches.
+ *              (the partially matched areas may be of zero width)
+ *
+ * INPUT:
+ * aLesserTargetExtent: Edge of the target area on the axis being considered
+ *                      on the lesser side. (eg: usually left on the X-axis)
+ * aTargetSize: Size of the target area on the axis being considered (eg:
+ *              usually width for X-axis)
+ * aLesserTileExtent: Edge of the tile on the axis being considered on the
+ *                    lesser side.
+ * aTileSize: Size of the tile on the axis being considered.
+ */
+static inline void
+ComputePartialTileExtents(int32_t *aLesserSidePartialMatchSize,
+                          int32_t *aHigherSidePartialMatchSize,
+                          int32_t *aCentreSize,
+                          int32_t aLesserTargetExtent,
+                          int32_t aTargetSize,
+                          int32_t aLesserTileExtent,
+                          int32_t aTileSize)
+{
+  int32_t targetExtentMost = aLesserTargetExtent + aTargetSize;
+  int32_t tileExtentMost = aLesserTileExtent + aTileSize;
+
+  int32_t lesserSidePartialMatchSize;
+  if (aLesserTileExtent < aLesserTargetExtent) {
+    lesserSidePartialMatchSize = tileExtentMost - aLesserTargetExtent;
+  } else {
+    lesserSidePartialMatchSize = (aLesserTileExtent - aLesserTargetExtent) %
+                                    aTileSize;
+  }
+
+  int32_t higherSidePartialMatchSize;
+  if (lesserSidePartialMatchSize > aTargetSize) {
+    lesserSidePartialMatchSize = aTargetSize;
+    higherSidePartialMatchSize = 0;
+  } else if (tileExtentMost > targetExtentMost) {
+      higherSidePartialMatchSize = targetExtentMost - aLesserTileExtent;
+  } else {
+    higherSidePartialMatchSize = (targetExtentMost - tileExtentMost) %
+                                    aTileSize;
+  }
+
+  if (lesserSidePartialMatchSize + higherSidePartialMatchSize >
+        aTargetSize) {
+    higherSidePartialMatchSize = aTargetSize - lesserSidePartialMatchSize;
+  }
+
+  /*
+   * To understand the conditon below, let us consider the X-Axis:
+   * Lesser side is left and the Higher side is right.
+   * This implies:
+   * aTargetSize is rect.width.
+   * lesserSidePartialMatchSize would mean leftPartialTileWidth.
+   * higherSidePartialMatchSize would mean rightPartialTileWidth.
+   *
+   * leftPartialTileWidth == rect.width only happens when the tile entirely
+   * overlaps with the target area in the X-axis and exceeds its bounds by at
+   * least one pixel on the lower X-Axis side.
+   *
+   * leftPartialTileWidth + rightPartialTileWidth == rect.width only happens
+   * when the tile overlaps the target area in such a way that the edge of the
+   * tile on the higher X-Axis side cuts through the target area and there is no
+   * space for a complete tile in the X-Axis in the target area on either side
+   * of that edge. In this scenario, centre will be of zero width and the
+   * partial widths on left and right will add up to the width of the rect. In
+   * case the tile is bigger than the rect in the X-axis, it will get clipped
+   * and remain equal to rect.width.
+   *
+   * Therefore, those two conditions are separate cases which lead to centre
+   * being of zero width.
+   *
+   * The condition below is the same logic as above expressed independent of
+   * the axis in consideration.
+   */
+
+  int32_t centreSize;
+  if (lesserSidePartialMatchSize == aTargetSize ||
+        lesserSidePartialMatchSize + higherSidePartialMatchSize ==
+        aTargetSize) {
+    centreSize = 0;
+  } else {
+    centreSize = aTargetSize -
+                   (lesserSidePartialMatchSize + higherSidePartialMatchSize);
+  }
+
+  *aLesserSidePartialMatchSize = lesserSidePartialMatchSize;
+  *aHigherSidePartialMatchSize = higherSidePartialMatchSize;
+  *aCentreSize = centreSize;
+}
+
+static inline void
+TilePixels(uint8_t *aTargetData,
+           const uint8_t *aSourceData,
+           const nsIntRect &targetRegion,
+           const nsIntRect &aTile,
+           uint32_t aStride)
+{
+  if (targetRegion.IsEmpty()) {
+    return;
+  }
+
+  uint32_t tileRowCopyMemSize = aTile.width * 4;
+  uint32_t numTimesToCopyTileRows = targetRegion.width / aTile.width;
+
+  uint8_t *targetFirstRowOffset = aTargetData + 4 * targetRegion.x;
+  const uint8_t *tileFirstRowOffset = aSourceData + 4 * aTile.x;
+
+  int32_t tileYOffset = 0;
+  for (int32_t targetY = targetRegion.y;
+       targetY < targetRegion.YMost();
+       ++targetY) {
+    uint8_t *targetRowOffset = targetFirstRowOffset + aStride * targetY;
+    const uint8_t *tileRowOffset = tileFirstRowOffset +
+                                             aStride * (aTile.y + tileYOffset);
+
+    for (uint32_t i = 0; i < numTimesToCopyTileRows; ++i) {
+      memcpy(targetRowOffset + i * tileRowCopyMemSize,
+             tileRowOffset,
+             tileRowCopyMemSize);
+    }
+
+    tileYOffset = (tileYOffset + 1) % aTile.height;
+  }
+}
+
+nsresult
+nsSVGFETileElement::Filter(nsSVGFilterInstance *instance,
+                           const nsTArray<const Image*>& aSources,
+                           const Image* aTarget,
+                           const nsIntRect& rect)
+{
+  // XXX This code depends on the surface rect containing the filter
+  // primitive subregion. ComputeTargetBBox, ComputeNeededSourceBBoxes
+  // and ComputeChangeBBox are all pessimal, so that will normally be OK,
+  // but nothing clips mFilterPrimitiveSubregion so this should be changed.
+
+  nsIntRect tile;
+  bool res = gfxUtils::GfxRectToIntRect(aSources[0]->mFilterPrimitiveSubregion,
+                                        &tile);
+
+  NS_ENSURE_TRUE(res, NS_ERROR_FAILURE); // asserts on failure (not 
+  if (tile.IsEmpty())
+    return NS_OK;
+
+  const nsIntRect &surfaceRect = instance->GetSurfaceRect();
+  if (!tile.Intersects(surfaceRect)) {
+    // nothing to draw
+    return NS_OK;
+  }
+
+  // clip tile
+  tile = tile.Intersect(surfaceRect);
+
+  // Get it into surface space
+  tile -= surfaceRect.TopLeft();
+
+  uint8_t* sourceData = aSources[0]->mImage->Data();
+  uint8_t* targetData = aTarget->mImage->Data();
+  uint32_t stride = aTarget->mImage->Stride();
+
+  /*
+   * priority: left before right before centre
+   *             and
+   *           top before bottom before centre
+   *
+   * eg: If we have a target area which is 1.5 times the width of a tile,
+   *     then, based on alignment, we get:
+   *       'left and right'
+   *         or
+   *       'left and centre'
+   *
+   */
+
+  int32_t leftPartialTileWidth;
+  int32_t rightPartialTileWidth;
+  int32_t centreWidth;
+  ComputePartialTileExtents(&leftPartialTileWidth,
+                            &rightPartialTileWidth,
+                            &centreWidth,
+                            rect.x,
+                            rect.width,
+                            tile.x,
+                            tile.width);
+
+  int32_t topPartialTileHeight;
+  int32_t bottomPartialTileHeight;
+  int32_t centreHeight;
+  ComputePartialTileExtents(&topPartialTileHeight,
+                            &bottomPartialTileHeight,
+                            &centreHeight,
+                            rect.y,
+                            rect.height,
+                            tile.y,
+                            tile.height);
+
+  /* We have nine regions of the target area which have to be tiled differetly:
+   *
+   * Top Left,    Top Middle,    Top Right,
+   * Left Middle, Centre,        Right Middle,
+   * Bottom Left, Bottom Middle, Bottom Right
+   *
+   * + Centre is tiled by repeating the tiled image in full.
+   * + Top Left, Top Middle and Top Right:
+   *     Some of the rows from the top of the tile will be clipped here.
+   * + Bottom Left, Bottom Middle and Bottom Right:
+   *     Some of the rows from the bottom of the tile will be clipped here.
+   * + Top Left, Left Middle and Bottom left:
+   *     Some of the columns from the Left of the tile will be clipped here.
+   * + Top Right, Right Middle and Bottom Right:
+   *     Some of the columns from the right of the tile will be clipped here.
+   *
+   * If the sizes and positions of the target and tile are such that the tile
+   * aligns exactly on any (or all) of the edges, then some (or all) of the
+   * regions above (except Centre) will be zero sized.
+   */
+
+  nsIntRect targetRects[] = {
+    // Top Left
+    nsIntRect(rect.x, rect.y, leftPartialTileWidth, topPartialTileHeight),
+    // Top Middle
+    nsIntRect(rect.x + leftPartialTileWidth,
+              rect.y,
+              centreWidth,
+              topPartialTileHeight),
+    // Top Right
+    nsIntRect(rect.XMost() - rightPartialTileWidth,
+              rect.y,
+              rightPartialTileWidth,
+              topPartialTileHeight),
+    // Left Middle
+    nsIntRect(rect.x,
+              rect.y + topPartialTileHeight,
+              leftPartialTileWidth,
+              centreHeight),
+    // Centre
+    nsIntRect(rect.x + leftPartialTileWidth,
+              rect.y + topPartialTileHeight,
+              centreWidth,
+              centreHeight),
+    // Right Middle
+    nsIntRect(rect.XMost() - rightPartialTileWidth,
+              rect.y + topPartialTileHeight,
+              rightPartialTileWidth,
+              centreHeight),
+    // Bottom Left
+    nsIntRect(rect.x,
+              rect.YMost() - bottomPartialTileHeight,
+              leftPartialTileWidth,
+              bottomPartialTileHeight),
+    // Bottom Middle
+    nsIntRect(rect.x + leftPartialTileWidth,
+              rect.YMost() - bottomPartialTileHeight,
+              centreWidth,
+              bottomPartialTileHeight),
+    // Bottom Right
+    nsIntRect(rect.XMost() - rightPartialTileWidth,
+              rect.YMost() - bottomPartialTileHeight,
+              rightPartialTileWidth,
+              bottomPartialTileHeight)
+  };
+
+  nsIntRect tileRects[] = {
+    // Top Left
+    nsIntRect(tile.XMost() - leftPartialTileWidth,
+              tile.YMost() - topPartialTileHeight,
+              leftPartialTileWidth,
+              topPartialTileHeight),
+    // Top Middle
+    nsIntRect(tile.x,
+              tile.YMost() - topPartialTileHeight,
+              tile.width,
+              topPartialTileHeight),
+    // Top Right
+    nsIntRect(tile.x,
+              tile.YMost() - topPartialTileHeight,
+              rightPartialTileWidth,
+              topPartialTileHeight),
+    // Left Middle
+    nsIntRect(tile.XMost() - leftPartialTileWidth,
+              tile.y,
+              leftPartialTileWidth,
+              tile.height),
+    // Centre
+    nsIntRect(tile.x,
+              tile.y,
+              tile.width,
+              tile.height),
+    // Right Middle
+    nsIntRect(tile.x,
+              tile.y,
+              rightPartialTileWidth,
+              tile.height),
+    // Bottom Left
+    nsIntRect(tile.XMost() - leftPartialTileWidth,
+              tile.y,
+              leftPartialTileWidth,
+              bottomPartialTileHeight),
+    // Bottom Middle
+    nsIntRect(tile.x,
+              tile.y,
+              tile.width,
+              bottomPartialTileHeight),
+    // Bottom Right
+    nsIntRect(tile.x,
+              tile.y,
+              rightPartialTileWidth,
+              bottomPartialTileHeight)
+  };
+
+  for (uint32_t i = 0; i < ArrayLength(targetRects); ++i) {
+    TilePixels(targetData,
+               sourceData,
+               targetRects[i],
+               tileRects[i],
+               stride);
+  }
+
+  return NS_OK;
+}
+
+bool
+nsSVGFETileElement::AttributeAffectsRendering(int32_t aNameSpaceID,
+                                              nsIAtom* aAttribute) const
+{
+  return nsSVGFETileElementBase::AttributeAffectsRendering(aNameSpaceID, 
+                                                           aAttribute) ||
+           (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::in);
+}
+
+//----------------------------------------------------------------------
+// nsSVGElement methods
+
+nsSVGElement::StringAttributesInfo
+nsSVGFETileElement::GetStringInfo()
+{
+  return StringAttributesInfo(mStringAttributes, sStringInfo,
+                              ArrayLength(sStringInfo));
+}
+
 //---------------------Turbulence------------------------
 
 typedef nsSVGFE nsSVGFETurbulenceElementBase;
 
 class nsSVGFETurbulenceElement : public nsSVGFETurbulenceElementBase,
                                  public nsIDOMSVGFETurbulenceElement
 {
   friend nsresult NS_NewSVGFETurbulenceElement(nsIContent **aResult,
@@ -3331,22 +3824,16 @@ nsSVGFEConvolveMatrixElement::ComputeCha
 }
 
 static int32_t BoundInterval(int32_t aVal, int32_t aMax)
 {
   aVal = std::max(aVal, 0);
   return std::min(aVal, aMax - 1);
 }
 
-static int32_t WrapInterval(int32_t aVal, int32_t aMax)
-{
-  aVal = aVal % aMax;
-  return aVal < 0 ? aMax + aVal : aVal;
-}
-
 static void
 ConvolvePixel(const uint8_t *aSourceData,
               uint8_t *aTargetData,
               int32_t aWidth, int32_t aHeight,
               int32_t aStride,
               int32_t aX, int32_t aY,
               uint16_t aEdgeMode,
               const float *aKernel,
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -837,16 +837,18 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(SVGFEOffsetElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFEPointLightElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFESpecularLightingElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFESpotLightElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
+  NS_DEFINE_CLASSINFO_DATA(SVGFETileElement, nsElementSH,
+                           ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(SVGFETurbulenceElement, nsElementSH,
                            ELEMENT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA_WITH_NAME(SVGUnknownElement, SVGElement, nsElementSH,
                                      ELEMENT_SCRIPTABLE_FLAGS)
 
   // other SVG classes
   NS_DEFINE_CLASSINFO_DATA(SVGAnimatedEnumeration, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -2327,16 +2329,22 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGFESpotLightElement, nsIDOMSVGFESpotLightElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFESpotLightElement)
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
+  DOM_CLASSINFO_MAP_BEGIN(SVGFETileElement, nsIDOMSVGFETileElement)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFETileElement)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
+    DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
+  DOM_CLASSINFO_MAP_END
+
   DOM_CLASSINFO_MAP_BEGIN(SVGFETurbulenceElement, nsIDOMSVGFETurbulenceElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFETurbulenceElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(SVGUnknownElement, nsIDOMSVGElement)
     DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -129,16 +129,17 @@ DOMCI_CLASS(SVGFEDiffuseLightingElement)
 DOMCI_CLASS(SVGFEDisplacementMapElement)
 DOMCI_CLASS(SVGFEDistantLightElement)
 DOMCI_CLASS(SVGFEGaussianBlurElement)
 DOMCI_CLASS(SVGFEMorphologyElement)
 DOMCI_CLASS(SVGFEOffsetElement)
 DOMCI_CLASS(SVGFEPointLightElement)
 DOMCI_CLASS(SVGFESpecularLightingElement)
 DOMCI_CLASS(SVGFESpotLightElement)
+DOMCI_CLASS(SVGFETileElement)
 DOMCI_CLASS(SVGFETurbulenceElement)
 DOMCI_CLASS(SVGUnknownElement)
 
 // other SVG classes
 DOMCI_CLASS(SVGAnimatedEnumeration)
 DOMCI_CLASS(SVGAnimatedInteger)
 DOMCI_CLASS(SVGAnimatedNumber)
 DOMCI_CLASS(SVGAnimatedRect)
--- a/dom/interfaces/svg/nsIDOMSVGFilters.idl
+++ b/dom/interfaces/svg/nsIDOMSVGFilters.idl
@@ -120,16 +120,22 @@ interface nsIDOMSVGFEGaussianBlurElement
 
 [scriptable, uuid(aebe14bf-c98d-4d29-afc5-a1f27813d78d)]
 interface nsIDOMSVGFEOffsetElement : nsIDOMSVGFilterPrimitiveStandardAttributes { 
     readonly attribute nsIDOMSVGAnimatedString in1;
     readonly attribute nsIDOMSVGAnimatedNumber dx;
     readonly attribute nsIDOMSVGAnimatedNumber dy;
 };
 
+[scriptable, uuid(5c7c7ad9-1829-43c4-87b3-1e64c4f51f7a)]
+interface nsIDOMSVGFETileElement : nsIDOMSVGFilterPrimitiveStandardAttributes
+{
+    readonly attribute nsIDOMSVGAnimatedString in1;
+};
+
 [scriptable, uuid(d60f68fc-179f-430d-ab0d-ff868db7d548)]
 interface nsIDOMSVGFETurbulenceElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
     // Turbulence Types
     const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN      = 0;
     const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
     const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE   = 2;
     // Stitch Options
deleted file mode 100644
--- a/dom/webidl/SVGFETileElement.webidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * http://www.w3.org/TR/SVG2/
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-interface SVGAnimatedString;
-
-interface SVGFETileElement : SVGElement {
-  readonly attribute SVGAnimatedString in1;
-};
-
-SVGFETileElement implements SVGFilterPrimitiveStandardAttributes;
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -166,17 +166,16 @@ webidl_files = \
   SVGFEFloodElement.webidl \
   SVGFEFuncAElement.webidl \
   SVGFEFuncBElement.webidl \
   SVGFEFuncGElement.webidl \
   SVGFEFuncRElement.webidl \
   SVGFEImageElement.webidl \
   SVGFEMergeElement.webidl \
   SVGFEMergeNodeElement.webidl \
-  SVGFETileElement.webidl \
   SVGFitToViewBox.webidl \
   SVGForeignObjectElement.webidl \
   SVGGElement.webidl \
   SVGGradientElement.webidl \
   SVGGraphicsElement.webidl \
   SVGImageElement.webidl \
   SVGLengthList.webidl \
   SVGLinearGradientElement.webidl \