Backed out 14 changesets (bug 1543359) for causing build bustages. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Fri, 26 Jul 2019 07:39:11 +0300
changeset 484814 8da7c093ea3ac57d7edcc3e975e8057eebd8cb42
parent 484813 87c99ef858131b4ae906f33428e2929d3c8432b2
child 484815 fa6792c1c2e829922793c141f26287e11a1f8c9a
push id113783
push usershindli@mozilla.com
push dateFri, 26 Jul 2019 16:31:06 +0000
treeherdermozilla-inbound@a6fa09658817 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1543359
milestone70.0a1
backs out87c99ef858131b4ae906f33428e2929d3c8432b2
cd0afc5758ba2a42729ff0565d3453bde1a46704
101ac87ff017ae104eec981d2cfd2106ed3b466b
348e748e345136bdec1e58c69cb2e418ed393533
d9e937f5caf447b181e5e06a60aa06fc232e93bd
2f4eb65015527ac455fd3fc0d67ede7498555dff
0d316ef8c668e221f848d31b2925fe1429411ae5
bf238b58c694c5d3d2eb3a71123d433fb7a6a71c
496f206d03d6105bbcdc4b215f0546866b5fe939
7c3a1f23baa87d7d634e9f80e40da5453dc05200
90fff717198bcd58d786ee8849aa7e548260b446
b2ce591ca3984b716f5995ddb3e645c071acb981
a63968f077e3bd10a17469edc22f8e734a564f7b
ca660ab1e0c169d8956e2c1a8a271203eaea5e8e
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
Backed out 14 changesets (bug 1543359) for causing build bustages. CLOSED TREE Backed out changeset 87c99ef85813 (bug 1543359) Backed out changeset cd0afc5758ba (bug 1543359) Backed out changeset 101ac87ff017 (bug 1543359) Backed out changeset 348e748e3451 (bug 1543359) Backed out changeset d9e937f5caf4 (bug 1543359) Backed out changeset 2f4eb6501552 (bug 1543359) Backed out changeset 0d316ef8c668 (bug 1543359) Backed out changeset bf238b58c694 (bug 1543359) Backed out changeset 496f206d03d6 (bug 1543359) Backed out changeset 7c3a1f23baa8 (bug 1543359) Backed out changeset 90fff717198b (bug 1543359) Backed out changeset b2ce591ca398 (bug 1543359) Backed out changeset a63968f077e3 (bug 1543359) Backed out changeset ca660ab1e0c1 (bug 1543359)
dom/media/MediaData.cpp
dom/media/MediaData.h
dom/media/MediaInfo.h
dom/media/VideoOutput.h
dom/media/VideoSegment.cpp
dom/media/VideoUtils.h
dom/media/gmp/ChromiumCDMParent.cpp
dom/media/gtest/YUVBufferGenerator.cpp
dom/media/ipc/MediaIPCUtils.h
dom/media/mediasink/VideoSink.cpp
dom/media/platforms/agnostic/AOMDecoder.cpp
dom/media/platforms/agnostic/BlankDecoderModule.cpp
dom/media/platforms/agnostic/DAV1DDecoder.cpp
dom/media/platforms/agnostic/TheoraDecoder.cpp
dom/media/platforms/agnostic/VPXDecoder.cpp
dom/media/platforms/agnostic/VPXDecoder.h
dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
dom/media/platforms/apple/AppleVTDecoder.cpp
dom/media/platforms/apple/AppleVTDecoder.h
dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
dom/media/platforms/omx/OmxDataDecoder.cpp
dom/media/platforms/wmf/DXVA2Manager.cpp
dom/media/platforms/wmf/DXVA2Manager.h
dom/media/platforms/wmf/WMFUtils.cpp
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
dom/media/platforms/wmf/WMFVideoMFTManager.h
dom/media/platforms/wrappers/MediaChangeMonitor.cpp
dom/media/webrtc/MediaEngineDefault.cpp
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
gfx/2d/MacIOSurface.cpp
gfx/2d/MacIOSurface.h
gfx/2d/Types.h
gfx/gl/GLBlitHelper.cpp
gfx/gl/SharedSurfaceANGLE.cpp
gfx/gl/SharedSurfaceD3D11Interop.cpp
gfx/ipc/GfxMessageUtils.h
gfx/layers/BufferTexture.cpp
gfx/layers/BufferTexture.h
gfx/layers/D3D11ShareHandleImage.cpp
gfx/layers/D3D11ShareHandleImage.h
gfx/layers/D3D11YCbCrImage.cpp
gfx/layers/D3D11YCbCrImage.h
gfx/layers/D3D9SurfaceImage.cpp
gfx/layers/Effects.h
gfx/layers/ImageContainer.cpp
gfx/layers/ImageContainer.h
gfx/layers/ImageDataSerializer.cpp
gfx/layers/ImageDataSerializer.h
gfx/layers/MacIOSurfaceHelpers.cpp
gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
gfx/layers/client/ImageClient.cpp
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/client/TextureClientRecycleAllocator.cpp
gfx/layers/composite/GPUVideoTextureHost.cpp
gfx/layers/composite/GPUVideoTextureHost.h
gfx/layers/composite/TextureHost.cpp
gfx/layers/composite/TextureHost.h
gfx/layers/d3d11/TextureD3D11.cpp
gfx/layers/d3d11/TextureD3D11.h
gfx/layers/ipc/LayersSurfaces.ipdlh
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
gfx/layers/wr/WebRenderTextureHost.cpp
gfx/layers/wr/WebRenderTextureHost.h
gfx/tests/gtest/TestTextures.cpp
gfx/tests/gtest/TextureHelper.h
gfx/webrender_bindings/WebRenderAPI.cpp
gfx/webrender_bindings/WebRenderAPI.h
gfx/webrender_bindings/WebRenderTypes.h
gfx/webrender_bindings/src/bindings.rs
gfx/wr/examples/yuv.rs
gfx/wr/webrender/src/batch.rs
gfx/wr/webrender/src/display_list_flattener.rs
gfx/wr/webrender/src/prim_store/image.rs
gfx/wr/webrender_api/src/display_item.rs
gfx/wr/webrender_api/src/display_list.rs
gfx/wr/wrench/src/yaml_frame_reader.rs
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -303,19 +303,16 @@ PlanarYCbCrData ConstructPlanarYCbCrData
 bool VideoData::SetVideoDataToImage(PlanarYCbCrImage* aVideoImage,
                                     const VideoInfo& aInfo,
                                     const YCbCrBuffer& aBuffer,
                                     const IntRect& aPicture, bool aCopyData) {
   if (!aVideoImage) {
     return false;
   }
 
-  MOZ_ASSERT(aBuffer.mYUVColorSpace != gfx::YUVColorSpace::UNKNOWN,
-             "We must know the colorframe at this point");
-
   PlanarYCbCrData data = ConstructPlanarYCbCrData(aInfo, aBuffer, aPicture);
 
   aVideoImage->SetDelayedConversion(true);
   if (aCopyData) {
     return aVideoImage->CopyData(data);
   } else {
     return aVideoImage->AdoptData(data);
   }
@@ -334,19 +331,16 @@ already_AddRefed<VideoData> VideoData::C
                                       aTimecode, aInfo.mDisplay, 0));
     return v.forget();
   }
 
   if (!ValidateBufferAndPicture(aBuffer, aPicture)) {
     return nullptr;
   }
 
-  MOZ_ASSERT(aBuffer.mYUVColorSpace != gfx::YUVColorSpace::UNKNOWN,
-             "We must know the colorframe at this point");
-
   RefPtr<VideoData> v(new VideoData(aOffset, aTime, aDuration, aKeyframe,
                                     aTimecode, aInfo.mDisplay, 0));
 
   // Currently our decoder only knows how to output to ImageFormat::PLANAR_YCBCR
   // format.
 #if XP_WIN
   // We disable this code path on Windows version earlier of Windows 8 due to
   // intermittent crashes with old drivers. See bug 1405110.
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -417,17 +417,16 @@ class PlanarYCbCrImage;
 class VideoInfo;
 
 // Holds a decoded video frame, in YCbCr format. These are queued in the reader.
 class VideoData : public MediaData {
  public:
   typedef gfx::IntRect IntRect;
   typedef gfx::IntSize IntSize;
   typedef gfx::ColorDepth ColorDepth;
-  typedef gfx::ColorRange ColorRange;
   typedef gfx::YUVColorSpace YUVColorSpace;
   typedef layers::ImageContainer ImageContainer;
   typedef layers::Image Image;
   typedef layers::PlanarYCbCrImage PlanarYCbCrImage;
 
   static const Type sType = Type::VIDEO_DATA;
   static const char* sTypeName;
 
@@ -441,19 +440,18 @@ class VideoData : public MediaData {
       uint32_t mWidth;
       uint32_t mHeight;
       uint32_t mStride;
       uint32_t mOffset;
       uint32_t mSkip;
     };
 
     Plane mPlanes[3];
-    YUVColorSpace mYUVColorSpace = YUVColorSpace::UNKNOWN;
+    YUVColorSpace mYUVColorSpace = YUVColorSpace::BT601;
     ColorDepth mColorDepth = ColorDepth::COLOR_8;
-    ColorRange mColorRange = ColorRange::LIMITED;
   };
 
   class Listener {
    public:
     virtual void OnSentToCompositor() = 0;
     virtual ~Listener() {}
   };
 
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -246,17 +246,17 @@ class VideoInfo : public TrackInfo {
 
   // Should be 8, 10 or 12. Default value is 8.
   gfx::ColorDepth mColorDepth = gfx::ColorDepth::COLOR_8;
 
   gfx::YUVColorSpace mColorSpace = gfx::YUVColorSpace::UNKNOWN;
 
   // True indicates no restriction on Y, U, V values (otherwise 16-235 for 8
   // bits etc)
-  gfx::ColorRange mColorRange = gfx::ColorRange::LIMITED;
+  bool mFullRange = false;
 
  private:
   // mImage may be cropped; currently only used with the WebM container.
   // A negative width or height indicate that no cropping is to occur.
   gfx::IntRect mImageRect;
 
   // Indicates whether or not frames may contain alpha information.
   bool mAlphaPresent = false;
--- a/dom/media/VideoOutput.h
+++ b/dom/media/VideoOutput.h
@@ -20,21 +20,16 @@ static bool SetImageToBlackPixel(PlanarY
   uint8_t blackPixel[] = {0x10, 0x80, 0x80};
 
   PlanarYCbCrData data;
   data.mYChannel = blackPixel;
   data.mCbChannel = blackPixel + 1;
   data.mCrChannel = blackPixel + 2;
   data.mYStride = data.mCbCrStride = 1;
   data.mPicSize = data.mYSize = data.mCbCrSize = gfx::IntSize(1, 1);
-  data.mYUVColorSpace = gfx::YUVColorSpace::BT601;
-  // This could be made FULL once bug 1568745 is complete. A black pixel being
-  // 0x00, 0x80, 0x80
-  data.mColorRange = gfx::ColorRange::LIMITED;
-
   return aImage->CopyData(data);
 }
 
 class VideoOutput : public DirectMediaStreamTrackListener {
  protected:
   virtual ~VideoOutput() = default;
 
   void DropPastFrames() {
--- a/dom/media/VideoSegment.cpp
+++ b/dom/media/VideoSegment.cpp
@@ -3,17 +3,16 @@
  * 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 "VideoSegment.h"
 
 #include "gfx2DGlue.h"
 #include "ImageContainer.h"
 #include "Layers.h"
-#include "VideoUtils.h"
 #include "mozilla/UniquePtr.h"
 
 namespace mozilla {
 
 using namespace layers;
 
 VideoFrame::VideoFrame(already_AddRefed<Image> aImage,
                        const gfx::IntSize& aIntrinsicSize)
@@ -72,20 +71,16 @@ already_AddRefed<Image> VideoFrame::Crea
   data.mCbCrStride = (int32_t)(aSize.width * chromaBpp / 8.0);
   data.mCbChannel = frame.get() + aSize.height * data.mYStride;
   data.mCrChannel = data.mCbChannel + aSize.height * data.mCbCrStride / 2;
   data.mCbCrSize = gfx::IntSize(aSize.width / 2, aSize.height / 2);
   data.mPicX = 0;
   data.mPicY = 0;
   data.mPicSize = gfx::IntSize(aSize.width, aSize.height);
   data.mStereoMode = StereoMode::MONO;
-  data.mYUVColorSpace = gfx::YUVColorSpace::BT601;
-  // This could be made FULL once bug 1568745 is complete. A black pixel being
-  // 0x00, 0x80, 0x80
-  data.mColorRange = gfx::ColorRange::LIMITED;
 
   // Copies data, so we can free data.
   if (!image->CopyData(data)) {
     return nullptr;
   }
 
   return image.forget();
 }
--- a/dom/media/VideoUtils.h
+++ b/dom/media/VideoUtils.h
@@ -7,17 +7,16 @@
 #ifndef VideoUtils_h
 #define VideoUtils_h
 
 #include "AudioSampleFormat.h"
 #include "MediaInfo.h"
 #include "TimeUnits.h"
 #include "VideoLimits.h"
 #include "mozilla/gfx/Point.h"  // for gfx::IntSize
-#include "mozilla/gfx/Types.h"
 #include "mozilla/AbstractThread.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/SharedThreadPool.h"
 #include "mozilla/UniquePtr.h"
@@ -546,16 +545,11 @@ inline void AppendStringIfNotEmpty(nsACS
     aDest.Append(aSrc);
   }
 }
 
 // Returns true if we're running on a cellular connection; 2G, 3G, etc.
 // Main thread only.
 bool OnCellularConnection();
 
-inline gfx::YUVColorSpace DefaultColorSpace(const gfx::IntSize& aSize) {
-  return aSize.height < 720 ? gfx::YUVColorSpace::BT601
-                            : gfx::YUVColorSpace::BT709;
-}
-
 }  // end namespace mozilla
 
 #endif
--- a/dom/media/gmp/ChromiumCDMParent.cpp
+++ b/dom/media/gmp/ChromiumCDMParent.cpp
@@ -764,21 +764,16 @@ already_AddRefed<VideoData> ChromiumCDMP
 
   b.mPlanes[2].mData = aData.Elements();
   b.mPlanes[2].mWidth = (aFrame.mImageWidth() + 1) / 2;
   b.mPlanes[2].mHeight = (aFrame.mImageHeight() + 1) / 2;
   b.mPlanes[2].mStride = aFrame.mVPlane().mStride();
   b.mPlanes[2].mOffset = aFrame.mVPlane().mPlaneOffset();
   b.mPlanes[2].mSkip = 0;
 
-  // We unfortunately can't know which colorspace the video is using at this
-  // stage.
-  b.mYUVColorSpace =
-      DefaultColorSpace({aFrame.mImageWidth(), aFrame.mImageHeight()});
-
   gfx::IntRect pictureRegion(0, 0, aFrame.mImageWidth(), aFrame.mImageHeight());
   RefPtr<VideoData> v = VideoData::CreateAndCopyData(
       mVideoInfo, mImageContainer, mLastStreamOffset,
       media::TimeUnit::FromMicroseconds(aFrame.mTimestamp()),
       media::TimeUnit::FromMicroseconds(aFrame.mDuration()), b, false,
       media::TimeUnit::FromMicroseconds(-1), pictureRegion);
 
   return v.forget();
--- a/dom/media/gtest/YUVBufferGenerator.cpp
+++ b/dom/media/gtest/YUVBufferGenerator.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "YUVBufferGenerator.h"
 
-#include "VideoUtils.h"
-
 using namespace mozilla::layers;
 using namespace mozilla;
 
 void YUVBufferGenerator::Init(const mozilla::gfx::IntSize& aSize) {
   mImageSize = aSize;
 
   int yPlaneLen = aSize.width * aSize.height;
   int cbcrPlaneLen = (yPlaneLen + 1) / 2;
@@ -71,18 +69,16 @@ Image* YUVBufferGenerator::CreateI420Ima
   data.mCbChannel = cb;
   data.mCbSkip = 0;
 
   // CrCb plane vectors.
   data.mCbCrStride = halfWidth;
   data.mCbCrSize.width = halfWidth;
   data.mCbCrSize.height = halfHeight;
 
-  data.mYUVColorSpace = DefaultColorSpace(data.mYSize);
-
   image->CopyData(data);
   return image;
 }
 
 Image* YUVBufferGenerator::CreateNV12Image() {
   NVImage* image = new NVImage();
   PlanarYCbCrData data;
   data.mPicSize = mImageSize;
@@ -145,13 +141,11 @@ Image* YUVBufferGenerator::CreateNV21Ima
   data.mCbChannel = cb;
   data.mCbSkip = 1;
 
   // 4:2:0.
   data.mCbCrStride = mImageSize.width;
   data.mCbCrSize.width = halfWidth;
   data.mCbCrSize.height = halfHeight;
 
-  data.mYUVColorSpace = DefaultColorSpace(data.mYSize);
-
   image->SetData(data);
   return image;
 }
--- a/dom/media/ipc/MediaIPCUtils.h
+++ b/dom/media/ipc/MediaIPCUtils.h
@@ -26,17 +26,17 @@ struct ParamTraits<mozilla::VideoInfo> {
     WriteParam(aMsg, aParam.mStereoMode);
     WriteParam(aMsg, aParam.mImage);
     WriteParam(aMsg, aParam.ImageRect());
     WriteParam(aMsg, *aParam.mCodecSpecificConfig);
     WriteParam(aMsg, *aParam.mExtraData);
     WriteParam(aMsg, aParam.mRotation);
     WriteParam(aMsg, aParam.mColorDepth);
     WriteParam(aMsg, aParam.mColorSpace);
-    WriteParam(aMsg, aParam.mColorRange);
+    WriteParam(aMsg, aParam.mFullRange);
     WriteParam(aMsg, aParam.HasAlpha());
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter,
                    paramType* aResult) {
     mozilla::gfx::IntRect imageRect;
     bool alphaPresent;
     if (ReadParam(aMsg, aIter, &aResult->mMimeType) &&
@@ -44,17 +44,17 @@ struct ParamTraits<mozilla::VideoInfo> {
         ReadParam(aMsg, aIter, &aResult->mStereoMode) &&
         ReadParam(aMsg, aIter, &aResult->mImage) &&
         ReadParam(aMsg, aIter, &imageRect) &&
         ReadParam(aMsg, aIter, aResult->mCodecSpecificConfig.get()) &&
         ReadParam(aMsg, aIter, aResult->mExtraData.get()) &&
         ReadParam(aMsg, aIter, &aResult->mRotation) &&
         ReadParam(aMsg, aIter, &aResult->mColorDepth) &&
         ReadParam(aMsg, aIter, &aResult->mColorSpace) &&
-        ReadParam(aMsg, aIter, &aResult->mColorRange) &&
+        ReadParam(aMsg, aIter, &aResult->mFullRange) &&
         ReadParam(aMsg, aIter, &alphaPresent)) {
       aResult->SetImageRect(imageRect);
       aResult->SetAlpha(alphaPresent);
       return true;
     }
     return false;
   }
 };
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -80,17 +80,16 @@ static const int64_t MIN_UPDATE_INTERVAL
 static void SetImageToGreenPixel(PlanarYCbCrImage* aImage) {
   static uint8_t greenPixel[] = {0x00, 0x00, 0x00};
   PlanarYCbCrData data;
   data.mYChannel = greenPixel;
   data.mCbChannel = greenPixel + 1;
   data.mCrChannel = greenPixel + 2;
   data.mYStride = data.mCbCrStride = 1;
   data.mPicSize = data.mYSize = data.mCbCrSize = gfx::IntSize(1, 1);
-  data.mYUVColorSpace = gfx::YUVColorSpace::BT601;
   aImage->CopyData(data);
 }
 
 VideoSink::VideoSink(AbstractThread* aThread, MediaSink* aAudioSink,
                      MediaQueue<VideoData>& aVideoQueue,
                      VideoFrameContainer* aContainer,
                      FrameStatistics& aFrameStats,
                      uint32_t aVQueueSentToCompositerSize)
--- a/dom/media/platforms/agnostic/AOMDecoder.cpp
+++ b/dom/media/platforms/agnostic/AOMDecoder.cpp
@@ -195,24 +195,21 @@ RefPtr<MediaDataDecoder::DecodePromise> 
       case AOM_CICP_MC_BT_601:
         b.mYUVColorSpace = YUVColorSpace::BT601;
         break;
       case AOM_CICP_MC_BT_2020_NCL:
       case AOM_CICP_MC_BT_2020_CL:
         b.mYUVColorSpace = YUVColorSpace::BT2020;
         break;
       case AOM_CICP_MC_BT_709:
+      default:
+        // Set 709 as default, as it's the most sane default.
         b.mYUVColorSpace = YUVColorSpace::BT709;
         break;
-      default:
-        b.mYUVColorSpace = DefaultColorSpace({img->d_w, img->d_h});
-        break;
     }
-    b.mColorRange = img->range == AOM_CR_FULL_RANGE ? ColorRange::FULL
-                                                    : ColorRange::LIMITED;
 
     RefPtr<VideoData> v;
     v = VideoData::CreateAndCopyData(mInfo, mImageContainer, aSample->mOffset,
                                      aSample->mTime, aSample->mDuration, b,
                                      aSample->mKeyframe, aSample->mTimecode,
                                      mInfo.ScaledImageRect(img->d_w, img->d_h));
 
     if (!v) {
--- a/dom/media/platforms/agnostic/BlankDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/BlankDecoderModule.cpp
@@ -65,18 +65,16 @@ already_AddRefed<MediaData> BlankVideoDa
   // Cr plane.
   buffer.mPlanes[2].mData = frame.get();
   buffer.mPlanes[2].mStride = (mFrameWidth + 1) / 2;
   buffer.mPlanes[2].mHeight = (mFrameHeight + 1) / 2;
   buffer.mPlanes[2].mWidth = (mFrameWidth + 1) / 2;
   buffer.mPlanes[2].mOffset = 0;
   buffer.mPlanes[2].mSkip = 0;
 
-  buffer.mYUVColorSpace = gfx::YUVColorSpace::BT601;
-
   return VideoData::CreateAndCopyData(
       mInfo, mImageContainer, aSample->mOffset, aSample->mTime,
       aSample->mDuration, buffer, aSample->mKeyframe, aSample->mTime, mPicture);
 }
 
 BlankAudioDataCreator::BlankAudioDataCreator(uint32_t aChannelCount,
                                              uint32_t aSampleRate)
     : mFrameSum(0), mChannelCount(aChannelCount), mSampleRate(aSampleRate) {}
--- a/dom/media/platforms/agnostic/DAV1DDecoder.cpp
+++ b/dom/media/platforms/agnostic/DAV1DDecoder.cpp
@@ -189,27 +189,25 @@ already_AddRefed<VideoData> DAV1DDecoder
       case DAV1D_MC_BT2020_NCL:
       case DAV1D_MC_BT2020_CL:
         b.mYUVColorSpace = YUVColorSpace::BT2020;
         break;
       case DAV1D_MC_BT601:
         b.mYUVColorSpace = YUVColorSpace::BT601;
         break;
       case DAV1D_MC_BT709:
+      default:
+        // Set 709 as default, as it's the most sane default.
         b.mYUVColorSpace = YUVColorSpace::BT709;
         break;
-      default:
-        break;
     }
+  } else {
+    // BT709 is the only default that makes sense in a modern video context.
+    b.mYUVColorSpace = YUVColorSpace::BT709;
   }
-  if (b.mYUVColorSpace == YUVColorSpace::UNKNOWN) {
-    b.mYUVColorSpace = DefaultColorSpace({aPicture.p.w, aPicture.p.h});
-  }
-  b.mColorRange = aPicture.seq_hdr->color_range ? gfx::ColorRange::FULL
-                                                : gfx::ColorRange::LIMITED;
 
   b.mPlanes[0].mData = static_cast<uint8_t*>(aPicture.data[0]);
   b.mPlanes[0].mStride = aPicture.stride[0];
   b.mPlanes[0].mHeight = aPicture.p.h;
   b.mPlanes[0].mWidth = aPicture.p.w;
   b.mPlanes[0].mOffset = 0;
   b.mPlanes[0].mSkip = 0;
 
--- a/dom/media/platforms/agnostic/TheoraDecoder.cpp
+++ b/dom/media/platforms/agnostic/TheoraDecoder.cpp
@@ -161,19 +161,16 @@ RefPtr<MediaDataDecoder::DecodePromise> 
     b.mPlanes[1].mOffset = b.mPlanes[1].mSkip = 0;
 
     b.mPlanes[2].mData = ycbcr[2].data;
     b.mPlanes[2].mStride = ycbcr[2].stride;
     b.mPlanes[2].mHeight = mTheoraInfo.frame_height >> vdec;
     b.mPlanes[2].mWidth = mTheoraInfo.frame_width >> hdec;
     b.mPlanes[2].mOffset = b.mPlanes[2].mSkip = 0;
 
-    b.mYUVColorSpace =
-        DefaultColorSpace({mTheoraInfo.frame_width, mTheoraInfo.frame_height});
-
     IntRect pictureArea(mTheoraInfo.pic_x, mTheoraInfo.pic_y,
                         mTheoraInfo.pic_width, mTheoraInfo.pic_height);
 
     VideoInfo info;
     info.mDisplay = mInfo.mDisplay;
     RefPtr<VideoData> v = VideoData::CreateAndCopyData(
         info, mImageContainer, aSample->mOffset, aSample->mTime,
         aSample->mDuration, b, aSample->mKeyframe, aSample->mTimecode,
--- a/dom/media/platforms/agnostic/VPXDecoder.cpp
+++ b/dom/media/platforms/agnostic/VPXDecoder.cpp
@@ -172,32 +172,16 @@ RefPtr<MediaDataDecoder::DecodePromise> 
       b.mPlanes[2].mWidth = img->d_w;
     } else {
       LOG("VPX Unknown image format");
       return DecodePromise::CreateAndReject(
           MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
                       RESULT_DETAIL("VPX Unknown image format")),
           __func__);
     }
-    b.mYUVColorSpace = [&]() {
-      switch (img->cs) {
-        case VPX_CS_BT_601:
-        case VPX_CS_SMPTE_170:
-        case VPX_CS_SMPTE_240:
-          return gfx::YUVColorSpace::BT601;
-        case VPX_CS_BT_709:
-          return gfx::YUVColorSpace::BT709;
-        case VPX_CS_BT_2020:
-          return gfx::YUVColorSpace::BT2020;
-        default:
-          return DefaultColorSpace({img->d_w, img->d_h});
-      }
-    }();
-    b.mColorRange = img->range == VPX_CR_FULL_RANGE ? gfx::ColorRange::FULL
-                                                    : gfx::ColorRange::LIMITED;
 
     RefPtr<VideoData> v;
     if (!img_alpha) {
       v = VideoData::CreateAndCopyData(
           mInfo, mImageContainer, aSample->mOffset, aSample->mTime,
           aSample->mDuration, b, aSample->mKeyframe, aSample->mTimecode,
           mInfo.ScaledImageRect(img->d_w, img->d_h), mImageAllocator);
     } else {
--- a/dom/media/platforms/agnostic/VPXDecoder.h
+++ b/dom/media/platforms/agnostic/VPXDecoder.h
@@ -106,20 +106,16 @@ class VPXDecoder : public MediaDataDecod
       For BitDepth equals 12:
         Y is between 256 and 3760.
         U and V are between 256 and 3840 inclusive.
     mFullRange == true then:
       No restriction on Y, U, V values.
     */
     bool mFullRange = false;
 
-    gfx::ColorRange ColorRange() const {
-      return mFullRange ? gfx::ColorRange::FULL : gfx::ColorRange::LIMITED;
-    }
-
     /*
       Sub-sampling, used only for non sRGB colorspace.
       subsampling_x subsampling_y Description
           0             0         YUV 4:4:4
           0             1         YUV 4:4:0
           1             0         YUV 4:2:2
           1             1         YUV 4:2:0
     */
--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
@@ -51,19 +51,16 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
     } else {
       b.mPlanes[i].mWidth = (decodedFrame->Width() + 1) / 2;
       b.mPlanes[i].mHeight = (decodedFrame->Height() + 1) / 2;
     }
     b.mPlanes[i].mOffset = 0;
     b.mPlanes[i].mSkip = 0;
   }
 
-  b.mYUVColorSpace =
-      DefaultColorSpace({decodedFrame->Width(), decodedFrame->Height()});
-
   gfx::IntRect pictureRegion(0, 0, decodedFrame->Width(),
                              decodedFrame->Height());
   RefPtr<VideoData> v = VideoData::CreateAndCopyData(
       mConfig, mImageContainer, mLastStreamOffset,
       media::TimeUnit::FromMicroseconds(decodedFrame->Timestamp()),
       media::TimeUnit::FromMicroseconds(decodedFrame->Duration()), b, false,
       media::TimeUnit::FromMicroseconds(-1), pictureRegion);
   RefPtr<GMPVideoDecoder> self = this;
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -30,20 +30,17 @@ using namespace layers;
 AppleVTDecoder::AppleVTDecoder(const VideoInfo& aConfig, TaskQueue* aTaskQueue,
                                layers::ImageContainer* aImageContainer,
                                CreateDecoderParams::OptionSet aOptions)
     : mExtraData(aConfig.mExtraData),
       mPictureWidth(aConfig.mImage.width),
       mPictureHeight(aConfig.mImage.height),
       mDisplayWidth(aConfig.mDisplay.width),
       mDisplayHeight(aConfig.mDisplay.height),
-      mColorSpace(aConfig.mColorSpace == gfx::YUVColorSpace::UNKNOWN
-                      ? DefaultColorSpace({mPictureWidth, mPictureHeight})
-                      : aConfig.mColorSpace),
-      mColorRange(aConfig.mColorRange),
+      mColorSpace(aConfig.mColorSpace),
       mTaskQueue(aTaskQueue),
       mMaxRefFrames(aOptions.contains(CreateDecoderParams::Option::LowLatency)
                         ? 0
                         : H264::ComputeMaxRefFrames(aConfig.mExtraData)),
       mImageContainer(aImageContainer)
 #ifdef MOZ_WIDGET_UIKIT
       ,
       mUseSoftwareImages(true)
@@ -373,17 +370,16 @@ void AppleVTDecoder::OutputFrame(CVPixel
         static_cast<uint8_t*>(CVPixelBufferGetBaseAddressOfPlane(aImage, 2));
     buffer.mPlanes[2].mStride = CVPixelBufferGetBytesPerRowOfPlane(aImage, 2);
     buffer.mPlanes[2].mWidth = (width + 1) / 2;
     buffer.mPlanes[2].mHeight = (height + 1) / 2;
     buffer.mPlanes[2].mOffset = 0;
     buffer.mPlanes[2].mSkip = 0;
 
     buffer.mYUVColorSpace = mColorSpace;
-    buffer.mColorRange = mColorRange;
 
     gfx::IntRect visible = gfx::IntRect(0, 0, mPictureWidth, mPictureHeight);
 
     // Copy the image data into our own format.
     data = VideoData::CreateAndCopyData(
         info, mImageContainer, aFrameRef.byte_offset,
         aFrameRef.composition_timestamp, aFrameRef.duration, buffer,
         aFrameRef.is_sync_point, aFrameRef.decode_timestamp, visible);
@@ -545,20 +541,17 @@ CFDictionaryRef AppleVTDecoder::CreateOu
 
     return CFDictionaryCreate(
         kCFAllocatorDefault, outputKeys, outputValues, ArrayLength(outputKeys),
         &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
   }
 
 #ifndef MOZ_WIDGET_UIKIT
   // Output format type:
-  SInt32 PixelFormatTypeValue =
-      mColorRange == gfx::ColorRange::FULL
-          ? kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
-          : kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
+  SInt32 PixelFormatTypeValue = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
   AutoCFRelease<CFNumberRef> PixelFormatTypeNumber = CFNumberCreate(
       kCFAllocatorDefault, kCFNumberSInt32Type, &PixelFormatTypeValue);
   // Construct IOSurface Properties
   const void* IOSurfaceKeys[] = {MacIOSurfaceLib::kPropIsGlobal};
   const void* IOSurfaceValues[] = {kCFBooleanTrue};
   static_assert(ArrayLength(IOSurfaceKeys) == ArrayLength(IOSurfaceValues),
                 "Non matching keys/values array size");
 
--- a/dom/media/platforms/apple/AppleVTDecoder.h
+++ b/dom/media/platforms/apple/AppleVTDecoder.h
@@ -84,17 +84,16 @@ class AppleVTDecoder : public MediaDataD
   CFDictionaryRef CreateOutputConfiguration();
 
   const RefPtr<MediaByteBuffer> mExtraData;
   const uint32_t mPictureWidth;
   const uint32_t mPictureHeight;
   const uint32_t mDisplayWidth;
   const uint32_t mDisplayHeight;
   const gfx::YUVColorSpace mColorSpace;
-  const gfx::ColorRange mColorRange;
 
   // Method to set up the decompression session.
   MediaResult InitializeSession();
   nsresult WaitForAsynchronousFrames();
   CFDictionaryRef CreateDecoderSpecification();
   CFDictionaryRef CreateDecoderExtensions();
 
   const RefPtr<TaskQueue> mTaskQueue;
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
@@ -146,17 +146,16 @@ FFmpegLibWrapper::LinkResult FFmpegLibWr
   AV_FUNC(av_freep, AV_FUNC_AVUTIL_ALL)
   AV_FUNC(av_frame_alloc, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 |
                            AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58))
   AV_FUNC(av_frame_free, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 |
                           AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58))
   AV_FUNC(av_frame_unref, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 |
                            AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58))
   AV_FUNC_OPTION(av_frame_get_colorspace, AV_FUNC_AVUTIL_ALL)
-  AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL)
 #undef AV_FUNC
 #undef AV_FUNC_OPTION
 
   avcodec_register_all();
   if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) {
     av_log_set_level(AV_LOG_DEBUG);
   } else if (MOZ_LOG_TEST(sPDMLog, LogLevel::Info)) {
     av_log_set_level(AV_LOG_INFO);
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
@@ -96,17 +96,17 @@ struct MOZ_ONLY_USED_TO_AVOID_STATIC_CON
 
   // libavutil v55 and later only
   AVFrame* (*av_frame_alloc)();
   void (*av_frame_free)(AVFrame** frame);
   void (*av_frame_unref)(AVFrame* frame);
 
   // libavutil optional
   int (*av_frame_get_colorspace)(const AVFrame* frame);
-  int (*av_frame_get_color_range)(const AVFrame* frame);
+
   PRLibrary* mAVCodecLib;
   PRLibrary* mAVUtilLib;
 
  private:
 };
 
 }  // namespace mozilla
 
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -376,32 +376,26 @@ MediaResult FFmpegVideoDecoder<LIBAV_VER
       case AVCOL_SPC_BT709:
         b.mYUVColorSpace = gfx::YUVColorSpace::BT709;
         break;
       case AVCOL_SPC_SMPTE170M:
       case AVCOL_SPC_BT470BG:
         b.mYUVColorSpace = gfx::YUVColorSpace::BT601;
         break;
       case AVCOL_SPC_UNSPECIFIED:
-        b.mYUVColorSpace = gfx::YUVColorSpace::UNKNOWN;
+#if LIBAVCODEC_VERSION_MAJOR >= 55
+        if (mCodecContext->codec_id == AV_CODEC_ID_VP9) {
+          b.mYUVColorSpace = gfx::YUVColorSpace::BT709;
+        }
+#endif
         break;
       default:
         break;
     }
   }
-  if (b.mYUVColorSpace == gfx::YUVColorSpace::UNKNOWN) {
-    b.mYUVColorSpace = DefaultColorSpace({mFrame->width, mFrame->height});
-  }
-
-  if (mLib->av_frame_get_color_range) {
-    auto range = mLib->av_frame_get_color_range(mFrame);
-    b.mColorRange = range == AVCOL_RANGE_JPEG ? gfx::ColorRange::FULL
-                                              : gfx::ColorRange::LIMITED;
-  }
-
   RefPtr<VideoData> v = VideoData::CreateAndCopyData(
       mInfo, mImageContainer, aOffset, TimeUnit::FromMicroseconds(aPts),
       TimeUnit::FromMicroseconds(aDuration), b, !!mFrame->key_frame,
       TimeUnit::FromMicroseconds(-1),
       mInfo.ScaledImageRect(mFrame->width, mFrame->height), mImageAllocator);
 
   if (!v) {
     return MediaResult(NS_ERROR_OUT_OF_MEMORY,
--- a/dom/media/platforms/omx/OmxDataDecoder.cpp
+++ b/dom/media/platforms/omx/OmxDataDecoder.cpp
@@ -30,18 +30,16 @@
 #define CHECK_OMX_ERR(err)      \
   if (err != OMX_ErrorNone) {   \
     NotifyError(err, __func__); \
     return;                     \
   }
 
 namespace mozilla {
 
-using namespace gfx;
-
 static const char* StateTypeToStr(OMX_STATETYPE aType) {
   MOZ_ASSERT(aType == OMX_StateLoaded || aType == OMX_StateIdle ||
              aType == OMX_StateExecuting || aType == OMX_StatePause ||
              aType == OMX_StateWaitForResources || aType == OMX_StateInvalid);
 
   switch (aType) {
     case OMX_StateLoaded:
       return "OMX_StateLoaded";
@@ -933,21 +931,16 @@ already_AddRefed<VideoData> MediaDataHel
 
   b.mPlanes[2].mData = yuv420p_v;
   b.mPlanes[2].mWidth = (width + 1) / 2;
   b.mPlanes[2].mHeight = (height + 1) / 2;
   b.mPlanes[2].mStride = (stride + 1) / 2;
   b.mPlanes[2].mOffset = 0;
   b.mPlanes[2].mSkip = 0;
 
-  b.mYUVColorSpace =
-      mTrackInfo->GetAsVideoInfo()->mColorSpace == YUVColorSpace::UNKNOWN
-          ? DefaultColorSpace({width, height})
-          : mTrackInfo->GetAsVideoInfo()->mColorSpace;
-
   VideoInfo info(*mTrackInfo->GetAsVideoInfo());
   RefPtr<VideoData> data = VideoData::CreateAndCopyData(
       info, mImageContainer,
       0,                                     // Filled later by caller.
       media::TimeUnit::Zero(),               // Filled later by caller.
       media::TimeUnit::FromMicroseconds(1),  // We don't know the duration.
       b,
       0,  // Filled later by caller.
--- a/dom/media/platforms/wmf/DXVA2Manager.cpp
+++ b/dom/media/platforms/wmf/DXVA2Manager.cpp
@@ -588,18 +588,17 @@ class D3D11DXVA2Manager : public DXVA2Ma
   // into an image which is returned by aOutImage.
   HRESULT CopyToImage(IMFSample* aVideoSample, const gfx::IntRect& aRegion,
                       Image** aOutImage) override;
 
   HRESULT CopyToBGRATexture(ID3D11Texture2D* aInTexture,
                             ID3D11Texture2D** aOutTexture) override;
 
   HRESULT ConfigureForSize(IMFMediaType* aInputType,
-                           gfx::YUVColorSpace aColorSpace,
-                           gfx::ColorRange aColorRange, uint32_t aWidth,
+                           gfx::YUVColorSpace aColorSpace, uint32_t aWidth,
                            uint32_t aHeight) override;
 
   bool IsD3D11() override { return true; }
 
   bool SupportsConfig(IMFMediaType* aType, float aFramerate) override;
 
  private:
   HRESULT CreateFormatConverter();
@@ -621,18 +620,17 @@ class D3D11DXVA2Manager : public DXVA2Ma
   RefPtr<ID3D11VideoDecoder> mDecoder;
   RefPtr<layers::SyncObjectClient> mSyncObject;
   GUID mDecoderGUID;
   uint32_t mWidth = 0;
   uint32_t mHeight = 0;
   UINT mDeviceManagerToken = 0;
   RefPtr<IMFMediaType> mInputType;
   GUID mInputSubType;
-  gfx::YUVColorSpace mYUVColorSpace = gfx::YUVColorSpace::UNKNOWN;
-  gfx::ColorRange mColorRange = gfx::ColorRange::LIMITED;
+  gfx::YUVColorSpace mYUVColorSpace = gfx::YUVColorSpace::BT601;
 };
 
 bool D3D11DXVA2Manager::SupportsConfig(IMFMediaType* aType, float aFramerate) {
   MOZ_ASSERT(NS_IsMainThread());
   D3D11_VIDEO_DECODER_DESC desc;
   desc.Guid = mDecoderGUID;
   desc.OutputFormat = DXGI_FORMAT_NV12;
   HRESULT hr = MFGetAttributeSize(aType, MF_MT_FRAME_SIZE, &desc.SampleWidth,
@@ -885,17 +883,17 @@ D3D11DXVA2Manager::CreateOutputSample(Re
 HRESULT
 D3D11DXVA2Manager::CopyToImage(IMFSample* aVideoSample,
                                const gfx::IntRect& aRegion, Image** aOutImage) {
   NS_ENSURE_TRUE(aVideoSample, E_POINTER);
   NS_ENSURE_TRUE(aOutImage, E_POINTER);
   MOZ_ASSERT(mTextureClientAllocator);
 
   RefPtr<D3D11ShareHandleImage> image = new D3D11ShareHandleImage(
-      gfx::IntSize(mWidth, mHeight), aRegion, mYUVColorSpace, mColorRange);
+      gfx::IntSize(mWidth, mHeight), aRegion, mYUVColorSpace);
 
   // Retrieve the DXGI_FORMAT for the current video sample.
   RefPtr<IMFMediaBuffer> buffer;
   HRESULT hr = aVideoSample->GetBufferByIndex(0, getter_AddRefs(buffer));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   RefPtr<IMFDXGIBuffer> dxgiBuf;
   hr = buffer->QueryInterface((IMFDXGIBuffer**)getter_AddRefs(dxgiBuf));
@@ -1019,18 +1017,17 @@ D3D11DXVA2Manager::CopyToBGRATexture(ID3
 
     hr = inputType->SetUINT32(MF_MT_INTERLACE_MODE,
                               MFVideoInterlace_Progressive);
     NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
     hr = inputType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
     NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
-    hr = ConfigureForSize(inputType, mYUVColorSpace, mColorRange, desc.Width,
-                          desc.Height);
+    hr = ConfigureForSize(inputType, mYUVColorSpace, desc.Width, desc.Height);
     NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
   }
 
   RefPtr<IDXGIKeyedMutex> mutex;
   inTexture->QueryInterface((IDXGIKeyedMutex**)getter_AddRefs(mutex));
   // The rest of this function will not work if inTexture implements
   // IDXGIKeyedMutex! In that case case we would have to copy to a
   // non-mutex using texture.
@@ -1087,24 +1084,23 @@ D3D11DXVA2Manager::CopyToBGRATexture(ID3
   texture.forget(aOutTexture);
 
   return S_OK;
 }
 
 HRESULT
 D3D11DXVA2Manager::ConfigureForSize(IMFMediaType* aInputType,
                                     gfx::YUVColorSpace aColorSpace,
-                                    gfx::ColorRange aColorRange,
                                     uint32_t aWidth, uint32_t aHeight) {
   GUID subType = {0};
   HRESULT hr = aInputType->GetGUID(MF_MT_SUBTYPE, &subType);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   if (subType == mInputSubType && aWidth == mWidth && aHeight == mHeight &&
-      mYUVColorSpace == aColorSpace && mColorRange == aColorRange) {
+      mYUVColorSpace == aColorSpace) {
     // If the media type hasn't changed, don't reconfigure.
     return S_OK;
   }
 
   // Create a copy of our input type.
   RefPtr<IMFMediaType> inputType;
   hr = wmf::MFCreateMediaType(getter_AddRefs(inputType));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
@@ -1152,17 +1148,16 @@ D3D11DXVA2Manager::ConfigureForSize(IMFM
   });
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   mWidth = aWidth;
   mHeight = aHeight;
   mInputType = inputType;
   mInputSubType = subType;
   mYUVColorSpace = aColorSpace;
-  mColorRange = aColorRange;
   if (mTextureClientAllocator) {
     gfx::SurfaceFormat format = [&]() {
       if (subType == MFVideoFormat_NV12) {
         return gfx::SurfaceFormat::NV12;
       } else if (subType == MFVideoFormat_P010) {
         return gfx::SurfaceFormat::P010;
       } else if (subType == MFVideoFormat_P016) {
         return gfx::SurfaceFormat::P016;
--- a/dom/media/platforms/wmf/DXVA2Manager.h
+++ b/dom/media/platforms/wmf/DXVA2Manager.h
@@ -46,18 +46,17 @@ class DXVA2Manager {
                                     ID3D11Texture2D** aOutTexture) {
     // Not implemented!
     MOZ_CRASH("CopyToBGRATexture not implemented on this manager.");
     return E_FAIL;
   }
 
   virtual HRESULT ConfigureForSize(IMFMediaType* aInputType,
                                    gfx::YUVColorSpace aColorSpace,
-                                   gfx::ColorRange aColorRange, uint32_t aWidth,
-                                   uint32_t aHeight) {
+                                   uint32_t aWidth, uint32_t aHeight) {
     return S_OK;
   }
 
   virtual bool IsD3D11() { return false; }
 
   virtual ~DXVA2Manager();
 
   virtual bool SupportsConfig(IMFMediaType* aType, float aFramerate) = 0;
--- a/dom/media/platforms/wmf/WMFUtils.cpp
+++ b/dom/media/platforms/wmf/WMFUtils.cpp
@@ -63,28 +63,27 @@ GetDefaultStride(IMFMediaType* aType, ui
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   return hr;
 }
 
 gfx::YUVColorSpace GetYUVColorSpace(IMFMediaType* aType) {
   UINT32 yuvColorMatrix;
   HRESULT hr = aType->GetUINT32(MF_MT_YUV_MATRIX, &yuvColorMatrix);
-  NS_ENSURE_TRUE(SUCCEEDED(hr), gfx::YUVColorSpace::UNKNOWN);
+  NS_ENSURE_TRUE(SUCCEEDED(hr), gfx::YUVColorSpace::BT601);
 
   switch (yuvColorMatrix) {
     case MFVideoTransferMatrix_BT2020_10:
     case MFVideoTransferMatrix_BT2020_12:
       return gfx::YUVColorSpace::BT2020;
     case MFVideoTransferMatrix_BT709:
       return gfx::YUVColorSpace::BT709;
     case MFVideoTransferMatrix_BT601:
+    default:
       return gfx::YUVColorSpace::BT601;
-    default:
-      return gfx::YUVColorSpace::UNKNOWN;
   }
 }
 
 int32_t MFOffsetToInt32(const MFOffset& aOffset) {
   return int32_t(aOffset.value + (aOffset.fract / 65536.0f));
 }
 
 TimeUnit GetSampleDuration(IMFSample* aSample) {
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -134,17 +134,16 @@ WMFVideoMFTManager::WMFVideoMFTManager(
     const CreateDecoderParams::OptionSet& aOptions, bool aDXVAEnabled)
     : mVideoInfo(aConfig),
       mImageSize(aConfig.mImage),
       mDecodedImageSize(aConfig.mImage),
       mVideoStride(0),
       mColorSpace(aConfig.mColorSpace != gfx::YUVColorSpace::UNKNOWN
                       ? Some(aConfig.mColorSpace)
                       : Nothing()),
-      mColorRange(aConfig.mColorRange),
       mImageContainer(aImageContainer),
       mKnowsCompositor(aKnowsCompositor),
       mDXVAEnabled(aDXVAEnabled &&
                    !aOptions.contains(
                        CreateDecoderParams::Option::HardwareDecoderNotAllowed)),
       mFramerate(aFramerate),
       mLowLatency(aOptions.contains(CreateDecoderParams::Option::LowLatency))
 // mVideoStride, mVideoWidth, mVideoHeight, mUseHwAccel are initialized in
@@ -657,21 +656,18 @@ MediaResult WMFVideoMFTManager::InitInte
     return InitInternal();
   }
 
   LOG("Video Decoder initialized, Using DXVA: %s",
       (mUseHwAccel ? "Yes" : "No"));
 
   if (mUseHwAccel) {
     hr = mDXVA2Manager->ConfigureForSize(
-        outputType,
-        mColorSpace.refOr(
-            DefaultColorSpace({mImageSize.width, mImageSize.height})),
-        mColorRange, mVideoInfo.ImageRect().width,
-        mVideoInfo.ImageRect().height);
+        outputType, mColorSpace.refOr(gfx::YUVColorSpace::BT601),
+        mVideoInfo.ImageRect().width, mVideoInfo.ImageRect().height);
     NS_ENSURE_TRUE(SUCCEEDED(hr),
                    MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                                RESULT_DETAIL("Fail to configure image size for "
                                              "DXVA2Manager.")));
   } else {
     GetDefaultStride(outputType, mVideoInfo.ImageRect().width, &mVideoStride);
   }
   LOG("WMFVideoMFTManager frame geometry stride=%u picture=(%d, %d, %d, %d) "
@@ -760,17 +756,16 @@ WMFVideoMFTManager::Input(MediaRawData* 
       aSample->mTime.ToMicroseconds(), &inputSample);
   NS_ENSURE_TRUE(SUCCEEDED(hr) && inputSample != nullptr, hr);
 
   if (!mColorSpace && aSample->mTrackInfo) {
     // The colorspace definition is found in the H264 SPS NAL, available out of
     // band, while for VP9 it's only available within the VP9 bytestream.
     // The info would have been updated by the MediaChangeMonitor.
     mColorSpace = Some(aSample->mTrackInfo->GetAsVideoInfo()->mColorSpace);
-    mColorRange = aSample->mTrackInfo->GetAsVideoInfo()->mColorRange;
   }
   mLastDuration = aSample->mDuration;
 
   // Forward sample data to the decoder.
   return mDecoder->Input(inputSample);
 }
 
 class SupportsConfigEvent : public Runnable {
@@ -929,20 +924,18 @@ WMFVideoMFTManager::CreateBasicVideoFram
     b.mPlanes[2].mStride = stride;
     b.mPlanes[2].mHeight = halfHeight;
     b.mPlanes[2].mWidth = halfWidth;
     b.mPlanes[2].mOffset = 0;
     b.mPlanes[2].mSkip = 1;
   }
 
   // YuvColorSpace
-  b.mYUVColorSpace =
-      mColorSpace.refOr(DefaultColorSpace({videoWidth, videoHeight}));
+  b.mYUVColorSpace = *mColorSpace;
   b.mColorDepth = colorDepth;
-  b.mColorRange = mColorRange;
 
   TimeUnit pts = GetSampleTime(aSample);
   NS_ENSURE_TRUE(pts.IsValid(), E_FAIL);
   TimeUnit duration = GetSampleDuration(aSample);
   NS_ENSURE_TRUE(duration.IsValid(), E_FAIL);
   gfx::IntRect pictureRegion =
       mVideoInfo.ScaledImageRect(videoWidth, videoHeight);
 
@@ -1044,21 +1037,18 @@ WMFVideoMFTManager::Output(int64_t aStre
       }
 
       RefPtr<IMFMediaType> outputType;
       hr = mDecoder->GetOutputMediaType(outputType);
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
       if (mUseHwAccel) {
         hr = mDXVA2Manager->ConfigureForSize(
-            outputType,
-            mColorSpace.refOr(
-                DefaultColorSpace({mImageSize.width, mImageSize.height})),
-            mColorRange, mVideoInfo.ImageRect().width,
-            mVideoInfo.ImageRect().height);
+            outputType, mColorSpace.refOr(gfx::YUVColorSpace::BT601),
+            mVideoInfo.ImageRect().width, mVideoInfo.ImageRect().height);
         NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
       } else {
         // The stride may have changed, recheck for it.
         hr = GetDefaultStride(outputType, mVideoInfo.ImageRect().width,
                               &mVideoStride);
         NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
         UINT32 width = 0, height = 0;
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.h
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.h
@@ -67,17 +67,16 @@ class WMFVideoMFTManager : public MFTMan
   bool CanUseDXVA(IMFMediaType* aType, float aFramerate);
 
   // Video frame geometry.
   const VideoInfo mVideoInfo;
   const gfx::IntSize mImageSize;
   gfx::IntSize mDecodedImageSize;
   uint32_t mVideoStride;
   Maybe<gfx::YUVColorSpace> mColorSpace;
-  gfx::ColorRange mColorRange;
 
   RefPtr<layers::ImageContainer> mImageContainer;
   RefPtr<layers::KnowsCompositor> mKnowsCompositor;
   nsAutoPtr<DXVA2Manager> mDXVA2Manager;
 
   media::TimeUnit mLastDuration;
 
   bool mDXVAEnabled;
--- a/dom/media/platforms/wrappers/MediaChangeMonitor.cpp
+++ b/dom/media/platforms/wrappers/MediaChangeMonitor.cpp
@@ -136,19 +136,17 @@ class H264ChangeMonitor : public MediaCh
       mCurrentConfig.mImage.width = spsdata.pic_width;
       mCurrentConfig.mImage.height = spsdata.pic_height;
       mCurrentConfig.mDisplay.width = spsdata.display_width;
       mCurrentConfig.mDisplay.height = spsdata.display_height;
       mCurrentConfig.SetImageRect(
           gfx::IntRect(0, 0, spsdata.pic_width, spsdata.pic_height));
       mCurrentConfig.mColorDepth = spsdata.ColorDepth();
       mCurrentConfig.mColorSpace = spsdata.ColorSpace();
-      mCurrentConfig.mColorRange = spsdata.video_full_range_flag
-                                       ? gfx::ColorRange::FULL
-                                       : gfx::ColorRange::LIMITED;
+      mCurrentConfig.mFullRange = spsdata.video_full_range_flag;
     }
     mCurrentConfig.mExtraData = aExtraData;
     mTrackInfo = new TrackInfoSharedPtr(mCurrentConfig, mStreamID++);
   }
 
   VideoInfo mCurrentConfig;
   uint32_t mStreamID = 0;
   const bool mFullParsing;
@@ -199,17 +197,17 @@ class VPXChangeMonitor : public MediaCha
       rv = NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER;
     }
     mInfo = Some(info);
     // For the first frame, we leave the mDisplay/mImage untouched as they
     // contain aspect ratio (AR) information set by the demuxer.
     // The AR data isn't found in the VP8/VP9 bytestream.
     mCurrentConfig.mColorDepth = gfx::ColorDepthForBitDepth(info.mBitDepth);
     mCurrentConfig.mColorSpace = info.ColorSpace();
-    mCurrentConfig.mColorRange = info.ColorRange();
+    mCurrentConfig.mFullRange = info.mFullRange;
     mTrackInfo = new TrackInfoSharedPtr(mCurrentConfig, mStreamID++);
 
     return rv;
   }
 
   const TrackInfo& Config() const override { return mCurrentConfig; }
 
   MediaResult PrepareSample(MediaDataDecoder::ConversionRequired aConversion,
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -225,17 +225,16 @@ static void AllocateSolidColorFrame(laye
   aData.mCbCrStride = aWidth >> 1;
   aData.mCbChannel = frame + yLen;
   aData.mCrChannel = aData.mCbChannel + cbLen;
   aData.mCbCrSize = IntSize(aWidth >> 1, aHeight >> 1);
   aData.mPicX = 0;
   aData.mPicY = 0;
   aData.mPicSize = IntSize(aWidth, aHeight);
   aData.mStereoMode = StereoMode::MONO;
-  aData.mYUVColorSpace = gfx::YUVColorSpace::BT601;
 }
 
 static void ReleaseFrame(layers::PlanarYCbCrData& aData) {
   free(aData.mYChannel);
 }
 
 void MediaEngineDefaultVideoSource::SetTrack(
     const RefPtr<SourceMediaStream>& aStream, TrackID aTrackID,
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -583,17 +583,16 @@ int MediaEngineRemoteVideoSource::Delive
   data.mCbCrStride = buffer->StrideU();
   data.mCbChannel = const_cast<uint8_t*>(buffer->DataU());
   data.mCrChannel = const_cast<uint8_t*>(buffer->DataV());
   data.mCbCrSize =
       IntSize((buffer->width() + 1) / 2, (buffer->height() + 1) / 2);
   data.mPicX = 0;
   data.mPicY = 0;
   data.mPicSize = IntSize(buffer->width(), buffer->height());
-  data.mYUVColorSpace = gfx::YUVColorSpace::BT601;
 
   RefPtr<layers::PlanarYCbCrImage> image =
       mImageContainer->CreatePlanarYCbCrImage();
   if (!image->CopyData(data)) {
     MOZ_ASSERT_UNREACHABLE(
         "We might fail to allocate a buffer, but with this "
         "being a recycling container that shouldn't happen");
     return 0;
--- a/gfx/2d/MacIOSurface.cpp
+++ b/gfx/2d/MacIOSurface.cpp
@@ -3,20 +3,20 @@
 /* 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 "MacIOSurface.h"
 #include <OpenGL/gl.h>
 #include <QuartzCore/QuartzCore.h>
 #include <dlfcn.h>
+#include "mozilla/RefPtr.h"
+#include "mozilla/Assertions.h"
 #include "GLConsts.h"
 #include "GLContextCGL.h"
-#include "mozilla/Assertions.h"
-#include "mozilla/RefPtr.h"
 
 using namespace mozilla;
 // IOSurface signatures
 #define IOSURFACE_FRAMEWORK_PATH \
   "/System/Library/Frameworks/IOSurface.framework/IOSurface"
 #define OPENGL_FRAMEWORK_PATH \
   "/System/Library/Frameworks/OpenGL.framework/OpenGL"
 #define COREGRAPHICS_FRAMEWORK_PATH                                      \
@@ -290,17 +290,16 @@ MacIOSurface::MacIOSurface(IOSurfacePtr 
   IncrementUseCount();
 }
 
 MacIOSurface::~MacIOSurface() {
   DecrementUseCount();
   CFRelease(mIOSurfacePtr);
 }
 
-/* static */
 already_AddRefed<MacIOSurface> MacIOSurface::CreateIOSurface(
     int aWidth, int aHeight, double aContentsScaleFactor, bool aHasAlpha) {
   if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0) return nullptr;
 
   CFMutableDictionaryRef props = ::CFDictionaryCreateMutable(
       kCFAllocatorDefault, 4, &kCFTypeDictionaryKeyCallBacks,
       &kCFTypeDictionaryValueCallBacks);
   if (!props) return nullptr;
@@ -335,17 +334,16 @@ already_AddRefed<MacIOSurface> MacIOSurf
       new MacIOSurface(surfaceRef, aContentsScaleFactor, aHasAlpha);
 
   // Release the IOSurface because MacIOSurface retained it
   CFRelease(surfaceRef);
 
   return ioSurface.forget();
 }
 
-/* static */
 already_AddRefed<MacIOSurface> MacIOSurface::LookupSurface(
     IOSurfaceID aIOSurfaceID, double aContentsScaleFactor, bool aHasAlpha,
     gfx::YUVColorSpace aColorSpace) {
   if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0) return nullptr;
 
   IOSurfacePtr surfaceRef = MacIOSurfaceLib::IOSurfaceLookup(aIOSurfaceID);
   if (!surfaceRef) return nullptr;
 
@@ -353,40 +351,40 @@ already_AddRefed<MacIOSurface> MacIOSurf
       surfaceRef, aContentsScaleFactor, aHasAlpha, aColorSpace);
 
   // Release the IOSurface because MacIOSurface retained it
   CFRelease(surfaceRef);
 
   return ioSurface.forget();
 }
 
-IOSurfaceID MacIOSurface::GetIOSurfaceID() const {
+IOSurfaceID MacIOSurface::GetIOSurfaceID() {
   return MacIOSurfaceLib::IOSurfaceGetID(mIOSurfacePtr);
 }
 
-void* MacIOSurface::GetBaseAddress() const {
+void* MacIOSurface::GetBaseAddress() {
   return MacIOSurfaceLib::IOSurfaceGetBaseAddress(mIOSurfacePtr);
 }
 
-void* MacIOSurface::GetBaseAddressOfPlane(size_t aPlaneIndex) const {
+void* MacIOSurface::GetBaseAddressOfPlane(size_t aPlaneIndex) {
   return MacIOSurfaceLib::IOSurfaceGetBaseAddressOfPlane(mIOSurfacePtr,
                                                          aPlaneIndex);
 }
 
-size_t MacIOSurface::GetWidth(size_t plane) const {
+size_t MacIOSurface::GetWidth(size_t plane) {
   size_t intScaleFactor = ceil(mContentsScaleFactor);
   return GetDevicePixelWidth(plane) / intScaleFactor;
 }
 
-size_t MacIOSurface::GetHeight(size_t plane) const {
+size_t MacIOSurface::GetHeight(size_t plane) {
   size_t intScaleFactor = ceil(mContentsScaleFactor);
   return GetDevicePixelHeight(plane) / intScaleFactor;
 }
 
-size_t MacIOSurface::GetPlaneCount() const {
+size_t MacIOSurface::GetPlaneCount() {
   return MacIOSurfaceLib::IOSurfaceGetPlaneCount(mIOSurfacePtr);
 }
 
 /*static*/
 size_t MacIOSurface::GetMaxWidth() {
   if (!MacIOSurfaceLib::isInit()) return -1;
   return MacIOSurfaceLib::IOSurfaceGetPropertyMaximum(
       MacIOSurfaceLib::kPropWidth);
@@ -394,29 +392,29 @@ size_t MacIOSurface::GetMaxWidth() {
 
 /*static*/
 size_t MacIOSurface::GetMaxHeight() {
   if (!MacIOSurfaceLib::isInit()) return -1;
   return MacIOSurfaceLib::IOSurfaceGetPropertyMaximum(
       MacIOSurfaceLib::kPropHeight);
 }
 
-size_t MacIOSurface::GetDevicePixelWidth(size_t plane) const {
+size_t MacIOSurface::GetDevicePixelWidth(size_t plane) {
   return MacIOSurfaceLib::IOSurfaceGetWidth(mIOSurfacePtr, plane);
 }
 
-size_t MacIOSurface::GetDevicePixelHeight(size_t plane) const {
+size_t MacIOSurface::GetDevicePixelHeight(size_t plane) {
   return MacIOSurfaceLib::IOSurfaceGetHeight(mIOSurfacePtr, plane);
 }
 
-size_t MacIOSurface::GetBytesPerRow(size_t plane) const {
+size_t MacIOSurface::GetBytesPerRow(size_t plane) {
   return MacIOSurfaceLib::IOSurfaceGetBytesPerRow(mIOSurfacePtr, plane);
 }
 
-OSType MacIOSurface::GetPixelFormat() const {
+OSType MacIOSurface::GetPixelFormat() {
   return MacIOSurfaceLib::IOSurfaceGetPixelFormat(mIOSurfacePtr);
 }
 
 void MacIOSurface::IncrementUseCount() {
   MacIOSurfaceLib::IOSurfaceIncrementUseCount(mIOSurfacePtr);
 }
 
 void MacIOSurface::DecrementUseCount() {
@@ -465,34 +463,32 @@ already_AddRefed<SourceSurface> MacIOSur
   RefPtr<mozilla::gfx::DataSourceSurface> surf =
       mozilla::gfx::Factory::CreateWrappingDataSourceSurface(
           dataCpy, bytesPerRow, IntSize(ioWidth, ioHeight), format,
           &MacIOSurfaceBufferDeallocator, static_cast<void*>(dataCpy));
 
   return surf.forget();
 }
 
-SurfaceFormat MacIOSurface::GetFormat() const {
+SurfaceFormat MacIOSurface::GetFormat() {
   OSType pixelFormat = GetPixelFormat();
-  if (pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange ||
-      pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {
+  if (pixelFormat == '420v') {
     return SurfaceFormat::NV12;
-  } else if (pixelFormat == kCVPixelFormatType_422YpCbCr8) {
+  } else if (pixelFormat == '2vuy') {
     return SurfaceFormat::YUV422;
   } else {
     return HasAlpha() ? SurfaceFormat::R8G8B8A8 : SurfaceFormat::R8G8B8X8;
   }
 }
 
-SurfaceFormat MacIOSurface::GetReadFormat() const {
+SurfaceFormat MacIOSurface::GetReadFormat() {
   OSType pixelFormat = GetPixelFormat();
-  if (pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange ||
-      pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {
+  if (pixelFormat == '420v') {
     return SurfaceFormat::NV12;
-  } else if (pixelFormat == kCVPixelFormatType_422YpCbCr8) {
+  } else if (pixelFormat == '2vuy') {
     return SurfaceFormat::R8G8B8X8;
   } else {
     return HasAlpha() ? SurfaceFormat::R8G8B8A8 : SurfaceFormat::R8G8B8X8;
   }
 }
 
 CGLError MacIOSurface::CGLTexImageIOSurface2D(CGLContextObj ctx, GLenum target,
                                               GLenum internalFormat,
@@ -509,18 +505,17 @@ CGLError MacIOSurface::CGLTexImageIOSurf
     mozilla::gfx::SurfaceFormat* aOutReadFormat) {
   MOZ_ASSERT(plane >= 0);
   bool isCompatibilityProfile = aGL->IsCompatibilityProfile();
   OSType pixelFormat = GetPixelFormat();
 
   GLenum internalFormat;
   GLenum format;
   GLenum type;
-  if (pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange ||
-      pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {
+  if (pixelFormat == '420v') {
     MOZ_ASSERT(GetPlaneCount() == 2);
     MOZ_ASSERT(plane < 2);
 
     // The LOCAL_GL_LUMINANCE and LOCAL_GL_LUMINANCE_ALPHA are the deprecated
     // format. So, use LOCAL_GL_RED and LOCAL_GL_RB if we use core profile.
     // https://www.khronos.org/opengl/wiki/Image_Format#Legacy_Image_Formats
     if (plane == 0) {
       internalFormat = format =
@@ -528,17 +523,17 @@ CGLError MacIOSurface::CGLTexImageIOSurf
     } else {
       internalFormat = format =
           (isCompatibilityProfile) ? (LOCAL_GL_LUMINANCE_ALPHA) : (LOCAL_GL_RG);
     }
     type = LOCAL_GL_UNSIGNED_BYTE;
     if (aOutReadFormat) {
       *aOutReadFormat = mozilla::gfx::SurfaceFormat::NV12;
     }
-  } else if (pixelFormat == kCVPixelFormatType_422YpCbCr8) {
+  } else if (pixelFormat == '2vuy') {
     MOZ_ASSERT(plane == 0);
     // The YCBCR_422_APPLE ext is only available in compatibility profile. So,
     // we should use RGB_422_APPLE for core profile. The difference between
     // YCBCR_422_APPLE and RGB_422_APPLE is that the YCBCR_422_APPLE converts
     // the YCbCr value to RGB with REC 601 conversion. But the RGB_422_APPLE
     // doesn't contain color conversion. You should do the color conversion by
     // yourself for RGB_422_APPLE.
     //
--- a/gfx/2d/MacIOSurface.h
+++ b/gfx/2d/MacIOSurface.h
@@ -2,18 +2,18 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 MacIOSurface_h__
 #define MacIOSurface_h__
 #ifdef XP_DARWIN
+#  include <QuartzCore/QuartzCore.h>
 #  include <CoreVideo/CoreVideo.h>
-#  include <QuartzCore/QuartzCore.h>
 #  include <dlfcn.h>
 
 #  include "mozilla/gfx/Types.h"
 
 namespace mozilla {
 namespace gl {
 class GLContext;
 }
@@ -65,18 +65,18 @@ typedef OSType (*IOSurfacePixelFormatFun
 
 #  ifdef XP_MACOSX
 #    import <OpenGL/OpenGL.h>
 #  else
 #    import <OpenGLES/ES2/gl.h>
 #  endif
 
 #  include "2D.h"
+#  include "mozilla/RefPtr.h"
 #  include "mozilla/RefCounted.h"
-#  include "mozilla/RefPtr.h"
 
 enum CGContextType {
   CG_CONTEXT_TYPE_UNKNOWN = 0,
   // These are found by inspection, it's possible they could be changed
   CG_CONTEXT_TYPE_BITMAP = 4,
   CG_CONTEXT_TYPE_IOSURFACE = 8
 };
 
@@ -103,48 +103,45 @@ class MacIOSurface final
           mozilla::gfx::YUVColorSpace::UNKNOWN);
 
   explicit MacIOSurface(IOSurfacePtr aIOSurfacePtr,
                         double aContentsScaleFactor = 1.0,
                         bool aHasAlpha = true,
                         mozilla::gfx::YUVColorSpace aColorSpace =
                             mozilla::gfx::YUVColorSpace::UNKNOWN);
   ~MacIOSurface();
-  IOSurfaceID GetIOSurfaceID() const;
-  void* GetBaseAddress() const;
-  void* GetBaseAddressOfPlane(size_t planeIndex) const;
-  size_t GetPlaneCount() const;
-  OSType GetPixelFormat() const;
+  IOSurfaceID GetIOSurfaceID();
+  void* GetBaseAddress();
+  void* GetBaseAddressOfPlane(size_t planeIndex);
+  size_t GetPlaneCount();
+  OSType GetPixelFormat();
   // GetWidth() and GetHeight() return values in "display pixels".  A
   // "display pixel" is the smallest fully addressable part of a display.
   // But in HiDPI modes each "display pixel" corresponds to more than one
   // device pixel.  Use GetDevicePixel**() to get device pixels.
-  size_t GetWidth(size_t plane = 0) const;
-  size_t GetHeight(size_t plane = 0) const;
-  double GetContentsScaleFactor() const { return mContentsScaleFactor; }
-  size_t GetDevicePixelWidth(size_t plane = 0) const;
-  size_t GetDevicePixelHeight(size_t plane = 0) const;
-  size_t GetBytesPerRow(size_t plane = 0) const;
+  size_t GetWidth(size_t plane = 0);
+  size_t GetHeight(size_t plane = 0);
+  double GetContentsScaleFactor() { return mContentsScaleFactor; }
+  size_t GetDevicePixelWidth(size_t plane = 0);
+  size_t GetDevicePixelHeight(size_t plane = 0);
+  size_t GetBytesPerRow(size_t plane = 0);
   void Lock(bool aReadOnly = true);
   void Unlock(bool aReadOnly = true);
   void IncrementUseCount();
   void DecrementUseCount();
-  bool HasAlpha() const { return mHasAlpha; }
-  mozilla::gfx::SurfaceFormat GetFormat() const;
-  mozilla::gfx::SurfaceFormat GetReadFormat() const;
+  bool HasAlpha() { return mHasAlpha; }
+  mozilla::gfx::SurfaceFormat GetFormat();
+  mozilla::gfx::SurfaceFormat GetReadFormat();
   // This would be better suited on MacIOSurfaceImage type, however due to the
   // current data structure, this is not possible as only the IOSurfacePtr is
   // being used across.
   void SetYUVColorSpace(mozilla::gfx::YUVColorSpace aColorSpace) {
     mColorSpace = aColorSpace;
   }
   mozilla::gfx::YUVColorSpace GetYUVColorSpace() const { return mColorSpace; }
-  bool IsFullRange() const {
-    return GetPixelFormat() == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange;
-  }
 
   // We would like to forward declare NSOpenGLContext, but it is an @interface
   // and this file is also used from c++, so we use a void *.
   CGLError CGLTexImageIOSurface2D(
       mozilla::gl::GLContext* aGL, CGLContextObj ctxt, size_t plane,
       mozilla::gfx::SurfaceFormat* aOutReadFormat = nullptr);
   CGLError CGLTexImageIOSurface2D(CGLContextObj ctxt, GLenum target,
                                   GLenum internalFormat, GLsizei width,
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -151,22 +151,16 @@ enum class YUVColorSpace : uint8_t {
 enum class ColorDepth : uint8_t {
   COLOR_8,
   COLOR_10,
   COLOR_12,
   COLOR_16,
   UNKNOWN
 };
 
-enum class ColorRange : uint8_t {
-  LIMITED,
-  FULL,
-  UNKNOWN
-};
-
 static inline SurfaceFormat SurfaceFormatForColorDepth(ColorDepth aColorDepth) {
   SurfaceFormat format = SurfaceFormat::A8;
   switch (aColorDepth) {
     case ColorDepth::COLOR_8:
       break;
     case ColorDepth::COLOR_10:
     case ColorDepth::COLOR_12:
     case ColorDepth::COLOR_16:
--- a/gfx/gl/GLBlitHelper.cpp
+++ b/gfx/gl/GLBlitHelper.cpp
@@ -1003,17 +1003,17 @@ bool GLBlitHelper::BlitImage(layers::Mac
       unpackFormats[2] = unpackFormats[0];
       pYuvArgs = &yuvArgs;
       break;
     default:
       gfxCriticalError() << "Unexpected plane count: " << planes;
       return false;
   }
 
-  if (pixelFormat == kCVPixelFormatType_422YpCbCr8) {
+  if (pixelFormat == '2vuy') {
     fragBody = kFragBody_CrYCb;
     // APPLE_rgb_422 adds RGB_RAW_422_APPLE for `internalFormat`, but only RGB
     // seems to work?
     internalFormats[0] = LOCAL_GL_RGB;
     unpackFormats[0] = LOCAL_GL_RGB_422_APPLE;
     unpackTypes[0] = LOCAL_GL_UNSIGNED_SHORT_8_8_APPLE;
     pYuvArgs = &yuvArgs;
   }
--- a/gfx/gl/SharedSurfaceANGLE.cpp
+++ b/gfx/gl/SharedSurfaceANGLE.cpp
@@ -146,18 +146,17 @@ void SharedSurface_ANGLEShareHandle::Pro
   }
 }
 
 bool SharedSurface_ANGLEShareHandle::ToSurfaceDescriptor(
     layers::SurfaceDescriptor* const out_descriptor) {
   gfx::SurfaceFormat format =
       mHasAlpha ? gfx::SurfaceFormat::B8G8R8A8 : gfx::SurfaceFormat::B8G8R8X8;
   *out_descriptor = layers::SurfaceDescriptorD3D10(
-      (WindowsHandle)mShareHandle, format, mSize, gfx::YUVColorSpace::UNKNOWN,
-      gfx::ColorRange::FULL);
+      (WindowsHandle)mShareHandle, format, mSize, gfx::YUVColorSpace::UNKNOWN);
   return true;
 }
 
 class ScopedLockTexture final {
  public:
   explicit ScopedLockTexture(ID3D11Texture2D* texture, bool* succeeded)
       : mIsLocked(false), mTexture(texture) {
     MOZ_ASSERT(NS_IsMainThread(),
--- a/gfx/gl/SharedSurfaceD3D11Interop.cpp
+++ b/gfx/gl/SharedSurfaceD3D11Interop.cpp
@@ -462,18 +462,17 @@ void SharedSurface_D3D11Interop::Produce
   mLockedForGL = false;
 }
 
 bool SharedSurface_D3D11Interop::ToSurfaceDescriptor(
     layers::SurfaceDescriptor* const out_descriptor) {
   const auto format =
       (mHasAlpha ? gfx::SurfaceFormat::B8G8R8A8 : gfx::SurfaceFormat::B8G8R8X8);
   *out_descriptor = layers::SurfaceDescriptorD3D10(
-      WindowsHandle(mDXGIHandle), format, mSize, gfx::YUVColorSpace::UNKNOWN,
-      gfx::ColorRange::FULL);
+      WindowsHandle(mDXGIHandle), format, mSize, gfx::YUVColorSpace::UNKNOWN);
   return true;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
 // Factory
 
 /*static*/
 UniquePtr<SurfaceFactory_D3D11Interop> SurfaceFactory_D3D11Interop::Create(
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -648,22 +648,16 @@ struct ParamTraits<mozilla::gfx::Surface
 
 template <>
 struct ParamTraits<mozilla::gfx::ColorDepth>
     : public ContiguousEnumSerializer<mozilla::gfx::ColorDepth,
                                       mozilla::gfx::ColorDepth::COLOR_8,
                                       mozilla::gfx::ColorDepth::UNKNOWN> {};
 
 template <>
-struct ParamTraits<mozilla::gfx::ColorRange>
-    : public ContiguousEnumSerializer<mozilla::gfx::ColorRange,
-                                      mozilla::gfx::ColorRange::LIMITED,
-                                      mozilla::gfx::ColorRange::UNKNOWN> {};
-
-template <>
 struct ParamTraits<mozilla::gfx::YUVColorSpace>
     : public ContiguousEnumSerializer<
           mozilla::gfx::YUVColorSpace, mozilla::gfx::YUVColorSpace::BT601,
           mozilla::gfx::YUVColorSpace::_NUM_COLORSPACE> {};
 
 template <>
 struct ParamTraits<mozilla::StereoMode>
     : public ContiguousEnumSerializer<mozilla::StereoMode,
--- a/gfx/layers/BufferTexture.cpp
+++ b/gfx/layers/BufferTexture.cpp
@@ -150,17 +150,17 @@ BufferTextureData* BufferTextureData::Cr
     return new ShmemTextureData(aDesc, aMoz2DBackend, shm);
   }
 }
 
 BufferTextureData* BufferTextureData::CreateForYCbCr(
     KnowsCompositor* aAllocator, gfx::IntSize aYSize, uint32_t aYStride,
     gfx::IntSize aCbCrSize, uint32_t aCbCrStride, StereoMode aStereoMode,
     gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
-    gfx::ColorRange aColorRange, TextureFlags aTextureFlags) {
+    TextureFlags aTextureFlags) {
   uint32_t bufSize = ImageDataSerializer::ComputeYCbCrBufferSize(
       aYSize, aYStride, aCbCrSize, aCbCrStride);
   if (bufSize == 0) {
     return nullptr;
   }
 
   uint32_t yOffset;
   uint32_t cbOffset;
@@ -178,20 +178,19 @@ BufferTextureData* BufferTextureData::Cr
 
   bool hasIntermediateBuffer =
       aAllocator
           ? ComputeHasIntermediateBuffer(gfx::SurfaceFormat::YUV,
                                          aAllocator->GetCompositorBackendType(),
                                          supportsTextureDirectMapping)
           : true;
 
-  YCbCrDescriptor descriptor =
-      YCbCrDescriptor(aYSize, aYStride, aCbCrSize, aCbCrStride, yOffset,
-                      cbOffset, crOffset, aStereoMode, aColorDepth,
-                      aYUVColorSpace, aColorRange, hasIntermediateBuffer);
+  YCbCrDescriptor descriptor = YCbCrDescriptor(
+      aYSize, aYStride, aCbCrSize, aCbCrStride, yOffset, cbOffset, crOffset,
+      aStereoMode, aColorDepth, aYUVColorSpace, hasIntermediateBuffer);
 
   return CreateInternal(
       aAllocator ? aAllocator->GetTextureForwarder() : nullptr, descriptor,
       gfx::BackendType::NONE, bufSize, aTextureFlags);
 }
 
 void BufferTextureData::FillInfo(TextureData::Info& aInfo) const {
   aInfo.size = GetSize();
--- a/gfx/layers/BufferTexture.h
+++ b/gfx/layers/BufferTexture.h
@@ -29,17 +29,17 @@ class BufferTextureData : public Texture
                                    TextureFlags aFlags,
                                    TextureAllocationFlags aAllocFlags,
                                    LayersIPCChannel* aAllocator);
 
   static BufferTextureData* CreateForYCbCr(
       KnowsCompositor* aAllocator, gfx::IntSize aYSize, uint32_t aYStride,
       gfx::IntSize aCbCrSize, uint32_t aCbCrStride, StereoMode aStereoMode,
       gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
-      gfx::ColorRange aColorRange, TextureFlags aTextureFlags);
+      TextureFlags aTextureFlags);
 
   bool Lock(OpenMode aMode) override { return true; }
 
   void Unlock() override {}
 
   void FillInfo(TextureData::Info& aInfo) const override;
 
   already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
--- a/gfx/layers/D3D11ShareHandleImage.cpp
+++ b/gfx/layers/D3D11ShareHandleImage.cpp
@@ -20,29 +20,26 @@
 
 namespace mozilla {
 namespace layers {
 
 using namespace gfx;
 
 D3D11ShareHandleImage::D3D11ShareHandleImage(const gfx::IntSize& aSize,
                                              const gfx::IntRect& aRect,
-                                             gfx::YUVColorSpace aColorSpace,
-                                             gfx::ColorRange aColorRange)
+                                             gfx::YUVColorSpace aColorSpace)
     : Image(nullptr, ImageFormat::D3D11_SHARE_HANDLE_TEXTURE),
       mSize(aSize),
       mPictureRect(aRect),
-      mYUVColorSpace(aColorSpace),
-      mColorRange(aColorRange) {}
+      mYUVColorSpace(aColorSpace) {}
 
 bool D3D11ShareHandleImage::AllocateTexture(D3D11RecycleAllocator* aAllocator,
                                             ID3D11Device* aDevice) {
   if (aAllocator) {
-    mTextureClient =
-        aAllocator->CreateOrRecycleClient(mYUVColorSpace, mColorRange, mSize);
+    mTextureClient = aAllocator->CreateOrRecycleClient(mYUVColorSpace, mSize);
     if (mTextureClient) {
       D3D11TextureData* textureData = GetData();
       MOZ_DIAGNOSTIC_ASSERT(textureData, "Wrong TextureDataType");
       mTexture = textureData->GetD3D11Texture();
       return true;
     }
     return false;
   } else {
@@ -175,59 +172,54 @@ D3D11ShareHandleImage::GetAsSourceSurfac
 
 ID3D11Texture2D* D3D11ShareHandleImage::GetTexture() const { return mTexture; }
 
 class MOZ_RAII D3D11TextureClientAllocationHelper
     : public ITextureClientAllocationHelper {
  public:
   D3D11TextureClientAllocationHelper(gfx::SurfaceFormat aFormat,
                                      gfx::YUVColorSpace aColorSpace,
-                                     gfx::ColorRange aColorRange,
                                      const gfx::IntSize& aSize,
                                      TextureAllocationFlags aAllocFlags,
                                      ID3D11Device* aDevice,
                                      TextureFlags aTextureFlags)
       : ITextureClientAllocationHelper(aFormat, aSize, BackendSelector::Content,
                                        aTextureFlags, aAllocFlags),
         mYUVColorSpace(aColorSpace),
-        mColorRange(aColorRange),
         mDevice(aDevice) {}
 
   bool IsCompatible(TextureClient* aTextureClient) override {
     D3D11TextureData* textureData =
         aTextureClient->GetInternalData()->AsD3D11TextureData();
     if (!textureData || aTextureClient->GetFormat() != mFormat ||
         aTextureClient->GetSize() != mSize) {
       return false;
     }
     // TODO: Should we also check for change in the allocation flags if RGBA?
     return (aTextureClient->GetFormat() != gfx::SurfaceFormat::NV12 &&
             aTextureClient->GetFormat() != gfx::SurfaceFormat::P010 &&
             aTextureClient->GetFormat() != gfx::SurfaceFormat::P016) ||
            (textureData->GetYUVColorSpace() == mYUVColorSpace &&
-            textureData->GetColorRange() == mColorRange &&
             textureData->GetTextureAllocationFlags() == mAllocationFlags);
   }
 
   already_AddRefed<TextureClient> Allocate(
       KnowsCompositor* aAllocator) override {
     D3D11TextureData* data =
         D3D11TextureData::Create(mSize, mFormat, mAllocationFlags, mDevice);
     if (!data) {
       return nullptr;
     }
     data->SetYUVColorSpace(mYUVColorSpace);
-    data->SetColorRange(mColorRange);
     return MakeAndAddRef<TextureClient>(data, mTextureFlags,
                                         aAllocator->GetTextureForwarder());
   }
 
  private:
-  const gfx::YUVColorSpace mYUVColorSpace;
-  const gfx::ColorRange mColorRange;
+  gfx::YUVColorSpace mYUVColorSpace;
   const RefPtr<ID3D11Device> mDevice;
 };
 
 D3D11RecycleAllocator::D3D11RecycleAllocator(
     KnowsCompositor* aAllocator, ID3D11Device* aDevice,
     gfx::SurfaceFormat aPreferredFormat)
     : TextureClientRecycleAllocator(aAllocator),
       mDevice(aDevice),
@@ -249,36 +241,35 @@ void D3D11RecycleAllocator::SetPreferred
     return;
   }
   // We can't handle the native source format, set it to BGRA which will
   // force the caller to convert it later.
   mUsableSurfaceFormat = gfx::SurfaceFormat::B8G8R8A8;
 }
 
 already_AddRefed<TextureClient> D3D11RecycleAllocator::CreateOrRecycleClient(
-    gfx::YUVColorSpace aColorSpace, gfx::ColorRange aColorRange,
-    const gfx::IntSize& aSize) {
+    gfx::YUVColorSpace aColorSpace, const gfx::IntSize& aSize) {
   // When CompositorDevice or ContentDevice is updated,
   // we could not reuse old D3D11Textures. It could cause video flickering.
   RefPtr<ID3D11Device> device = gfx::DeviceManagerDx::Get()->GetImageDevice();
   if (!!mImageDevice && mImageDevice != device) {
     ShrinkToMinimumSize();
   }
   mImageDevice = device;
 
   TextureAllocationFlags allocFlags = TextureAllocationFlags::ALLOC_DEFAULT;
   if (StaticPrefs::media_wmf_use_sync_texture_AtStartup() ||
       mDevice == DeviceManagerDx::Get()->GetCompositorDevice()) {
     // If our device is the compositor device, we don't need any synchronization
     // in practice.
     allocFlags = TextureAllocationFlags::ALLOC_MANUAL_SYNCHRONIZATION;
   }
 
-  D3D11TextureClientAllocationHelper helper(
-      mUsableSurfaceFormat, aColorSpace, aColorRange, aSize, allocFlags,
-      mDevice, layers::TextureFlags::DEFAULT);
+  D3D11TextureClientAllocationHelper helper(mUsableSurfaceFormat, aColorSpace,
+                                            aSize, allocFlags, mDevice,
+                                            layers::TextureFlags::DEFAULT);
 
   RefPtr<TextureClient> textureClient = CreateOrRecycle(helper);
   return textureClient.forget();
 }
 
 }  // namespace layers
 }  // namespace mozilla
--- a/gfx/layers/D3D11ShareHandleImage.h
+++ b/gfx/layers/D3D11ShareHandleImage.h
@@ -23,18 +23,17 @@ class GLBlitHelper;
 namespace layers {
 
 class D3D11RecycleAllocator final : public TextureClientRecycleAllocator {
  public:
   D3D11RecycleAllocator(KnowsCompositor* aAllocator, ID3D11Device* aDevice,
                         gfx::SurfaceFormat aPreferredFormat);
 
   already_AddRefed<TextureClient> CreateOrRecycleClient(
-      gfx::YUVColorSpace aColorSpace, gfx::ColorRange aColorRange,
-      const gfx::IntSize& aSize);
+      gfx::YUVColorSpace aColorSpace, const gfx::IntSize& aSize);
 
   void SetPreferredSurfaceFormat(gfx::SurfaceFormat aPreferredFormat);
 
  private:
   const RefPtr<ID3D11Device> mDevice;
   const bool mCanUseNV12;
   const bool mCanUseP010;
   const bool mCanUseP016;
@@ -47,46 +46,43 @@ class D3D11RecycleAllocator final : publ
 
 // Image class that wraps a ID3D11Texture2D. This class copies the image
 // passed into SetData(), so that it can be accessed from other D3D devices.
 // This class also manages the synchronization of the copy, to ensure the
 // resource is ready to use.
 class D3D11ShareHandleImage final : public Image {
  public:
   D3D11ShareHandleImage(const gfx::IntSize& aSize, const gfx::IntRect& aRect,
-                        gfx::YUVColorSpace aColorSpace,
-                        gfx::ColorRange aColorRange);
+                        gfx::YUVColorSpace aColorSpace);
   virtual ~D3D11ShareHandleImage() = default;
 
   bool AllocateTexture(D3D11RecycleAllocator* aAllocator,
                        ID3D11Device* aDevice);
 
   gfx::IntSize GetSize() const override;
   already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
   TextureClient* GetTextureClient(KnowsCompositor* aKnowsCompositor) override;
   gfx::IntRect GetPictureRect() const override { return mPictureRect; }
 
   ID3D11Texture2D* GetTexture() const;
 
   gfx::YUVColorSpace GetYUVColorSpace() const { return mYUVColorSpace; }
-  gfx::ColorRange GetColorRange() const { return mColorRange; }
 
  private:
   friend class gl::GLBlitHelper;
   D3D11TextureData* GetData() const {
     if (!mTextureClient) {
       return nullptr;
     }
     return mTextureClient->GetInternalData()->AsD3D11TextureData();
   }
 
   gfx::IntSize mSize;
   gfx::IntRect mPictureRect;
   gfx::YUVColorSpace mYUVColorSpace;
-  gfx::ColorRange mColorRange;
   RefPtr<TextureClient> mTextureClient;
   RefPtr<ID3D11Texture2D> mTexture;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // GFX_D3DSURFACEIMAGE_H
--- a/gfx/layers/D3D11YCbCrImage.cpp
+++ b/gfx/layers/D3D11YCbCrImage.cpp
@@ -28,17 +28,16 @@ bool D3D11YCbCrImage::SetData(KnowsCompo
                               ImageContainer* aContainer,
                               const PlanarYCbCrData& aData) {
   mPictureRect = IntRect(aData.mPicX, aData.mPicY, aData.mPicSize.width,
                          aData.mPicSize.height);
   mYSize = aData.mYSize;
   mCbCrSize = aData.mCbCrSize;
   mColorDepth = aData.mColorDepth;
   mColorSpace = aData.mYUVColorSpace;
-  mColorRange = aData.mColorRange;
 
   D3D11YCbCrRecycleAllocator* allocator =
       aContainer->GetD3D11YCbCrRecycleAllocator(aAllocator);
   if (!allocator) {
     return false;
   }
 
   RefPtr<ID3D11Device> device = gfx::DeviceManagerDx::Get()->GetImageDevice();
@@ -228,17 +227,16 @@ already_AddRefed<SourceSurface> D3D11YCb
   MOZ_ASSERT(mapCb.RowPitch == mapCr.RowPitch);
 
   data.mPicX = mPictureRect.X();
   data.mPicY = mPictureRect.Y();
   data.mPicSize = mPictureRect.Size();
   data.mStereoMode = StereoMode::MONO;
   data.mColorDepth = mColorDepth;
   data.mYUVColorSpace = mColorSpace;
-  data.mColorRange = mColorRange;
   data.mYSkip = data.mCbSkip = data.mCrSkip = 0;
   data.mYSize = mYSize;
   data.mCbCrSize = mCbCrSize;
   data.mYChannel = static_cast<uint8_t*>(mapY.pData);
   data.mYStride = mapY.RowPitch;
   data.mCbChannel = static_cast<uint8_t*>(mapCb.pData);
   data.mCrChannel = static_cast<uint8_t*>(mapCr.pData);
   data.mCbCrStride = mapCb.RowPitch;
@@ -401,18 +399,17 @@ already_AddRefed<TextureClient> DXGIYCbC
   NS_ENSURE_TRUE(SUCCEEDED(hr), nullptr);
 
   TextureForwarder* forwarder =
       aAllocator ? aAllocator->GetTextureForwarder() : nullptr;
 
   return TextureClient::CreateWithData(
       DXGIYCbCrTextureData::Create(textureY, textureCb, textureCr, mData.mYSize,
                                    mData.mYSize, mData.mCbCrSize,
-                                   mData.mColorDepth, mData.mYUVColorSpace,
-                                   mData.mColorRange),
+                                   mData.mColorDepth, mData.mYUVColorSpace),
       mTextureFlags, forwarder);
 }
 
 already_AddRefed<TextureClient> D3D11YCbCrRecycleAllocator::Allocate(
     SurfaceFormat aFormat, IntSize aSize, BackendSelector aSelector,
     TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) {
   MOZ_ASSERT_UNREACHABLE("unexpected to be called");
   return nullptr;
--- a/gfx/layers/D3D11YCbCrImage.h
+++ b/gfx/layers/D3D11YCbCrImage.h
@@ -75,16 +75,15 @@ class D3D11YCbCrImage : public Image {
  private:
   const DXGIYCbCrTextureData* GetData() const;
 
   gfx::IntSize mYSize;
   gfx::IntSize mCbCrSize;
   gfx::IntRect mPictureRect;
   gfx::ColorDepth mColorDepth;
   gfx::YUVColorSpace mColorSpace;
-  gfx::ColorRange mColorRange;
   RefPtr<TextureClient> mTextureClient;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // GFX_D3D11_YCBCR_IMAGE_H
--- a/gfx/layers/D3D9SurfaceImage.cpp
+++ b/gfx/layers/D3D9SurfaceImage.cpp
@@ -80,18 +80,17 @@ already_AddRefed<IDirect3DSurface9> DXGI
 }
 
 bool DXGID3D9TextureData::Serialize(SurfaceDescriptor& aOutDescriptor) {
   // In reality, with D3D9 we will only ever deal with RGBA textures.
   bool isYUV = mFormat == SurfaceFormat::NV12 ||
                mFormat == SurfaceFormat::P010 || mFormat == SurfaceFormat::P016;
   aOutDescriptor = SurfaceDescriptorD3D10(
       (WindowsHandle)(mHandle), mFormat, GetSize(),
-      isYUV ? gfx::YUVColorSpace::BT601 : gfx::YUVColorSpace::UNKNOWN,
-      gfx::ColorRange::LIMITED);
+      isYUV ? gfx::YUVColorSpace::BT601 : gfx::YUVColorSpace::UNKNOWN);
   return true;
 }
 
 D3D9SurfaceImage::D3D9SurfaceImage()
     : Image(nullptr, ImageFormat::D3D9_RGB32_TEXTURE),
       mSize(0, 0),
       mShareHandle(0),
       mValid(true) {}
--- a/gfx/layers/Effects.h
+++ b/gfx/layers/Effects.h
@@ -135,36 +135,31 @@ struct EffectRGB : public TexturedEffect
       : TexturedEffect(EffectTypes::RGB, aTexture, aPremultiplied,
                        aSamplingFilter) {}
 
   const char* Name() override { return "EffectRGB"; }
 };
 
 struct EffectYCbCr : public TexturedEffect {
   EffectYCbCr(TextureSource* aSource, gfx::YUVColorSpace aYUVColorSpace,
-              gfx::ColorRange aColorRange, gfx::ColorDepth aColorDepth,
-              gfx::SamplingFilter aSamplingFilter)
+              gfx::ColorDepth aColorDepth, gfx::SamplingFilter aSamplingFilter)
       : TexturedEffect(EffectTypes::YCBCR, aSource, false, aSamplingFilter),
         mYUVColorSpace(aYUVColorSpace),
-        mColorRange(aColorRange),
         mColorDepth(aColorDepth) {}
 
   const char* Name() override { return "EffectYCbCr"; }
 
   gfx::YUVColorSpace mYUVColorSpace;
-  gfx::ColorRange mColorRange;
   gfx::ColorDepth mColorDepth;
 };
 
 struct EffectNV12 : public EffectYCbCr {
   EffectNV12(TextureSource* aSource, gfx::YUVColorSpace aYUVColorSpace,
-             gfx::ColorRange aColorRange, gfx::ColorDepth aColorDepth,
-             gfx::SamplingFilter aSamplingFilter)
-      : EffectYCbCr(aSource, aYUVColorSpace, aColorRange, aColorDepth,
-                    aSamplingFilter) {
+             gfx::ColorDepth aColorDepth, gfx::SamplingFilter aSamplingFilter)
+      : EffectYCbCr(aSource, aYUVColorSpace, aColorDepth, aSamplingFilter) {
     mType = EffectTypes::NV12;
   }
 
   const char* Name() override { return "EffectNV12"; }
 };
 
 struct EffectComponentAlpha : public TexturedEffect {
   EffectComponentAlpha(TextureSource* aOnBlack, TextureSource* aOnWhite,
@@ -243,25 +238,23 @@ inline already_AddRefed<TexturedEffect> 
   MOZ_ASSERT(aSource);
 
   RefPtr<TexturedEffect> result;
 
   switch (aHost->GetReadFormat()) {
     case gfx::SurfaceFormat::YUV:
       MOZ_ASSERT(aHost->GetYUVColorSpace() != gfx::YUVColorSpace::UNKNOWN);
       result = new EffectYCbCr(aSource, aHost->GetYUVColorSpace(),
-                               aHost->GetColorRange(), aHost->GetColorDepth(),
-                               aSamplingFilter);
+                               aHost->GetColorDepth(), aSamplingFilter);
       break;
     case gfx::SurfaceFormat::NV12:
     case gfx::SurfaceFormat::P010:
     case gfx::SurfaceFormat::P016:
       result = new EffectNV12(aSource, aHost->GetYUVColorSpace(),
-                              aHost->GetColorRange(), aHost->GetColorDepth(),
-                              aSamplingFilter);
+                              aHost->GetColorDepth(), aSamplingFilter);
       break;
     default:
       result = CreateTexturedEffect(aHost->GetReadFormat(), aSource,
                                     aSamplingFilter, isAlphaPremultiplied);
       break;
   }
   return result.forget();
 }
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -448,17 +448,17 @@ nsresult PlanarYCbCrImage::BuildSurfaceD
   uint32_t crOffset;
   ImageDataSerializer::ComputeYCbCrOffsets(
       pdata->mYStride, pdata->mYSize.height, pdata->mCbCrStride,
       pdata->mCbCrSize.height, yOffset, cbOffset, crOffset);
 
   aSdBuffer.desc() = YCbCrDescriptor(
       pdata->mYSize, pdata->mYStride, pdata->mCbCrSize, pdata->mCbCrStride,
       yOffset, cbOffset, crOffset, pdata->mStereoMode, pdata->mColorDepth,
-      pdata->mYUVColorSpace, pdata->mColorRange,
+      pdata->mYUVColorSpace,
       /*hasIntermediateBuffer*/ false);
 
   uint8_t* buffer = nullptr;
   const MemoryOrShmem& memOrShmem = aSdBuffer.data();
   switch (memOrShmem.type()) {
     case MemoryOrShmem::Tuintptr_t:
       buffer = reinterpret_cast<uint8_t*>(memOrShmem.get_uintptr_t());
       break;
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -711,39 +711,56 @@ class AutoLockImage {
   }
 
  private:
   AutoTArray<ImageContainer::OwningImage, 4> mImages;
 };
 
 struct PlanarYCbCrData {
   // Luminance buffer
-  uint8_t* mYChannel = nullptr;
-  int32_t mYStride = 0;
-  gfx::IntSize mYSize = gfx::IntSize(0, 0);
-  int32_t mYSkip = 0;
+  uint8_t* mYChannel;
+  int32_t mYStride;
+  gfx::IntSize mYSize;
+  int32_t mYSkip;
   // Chroma buffers
-  uint8_t* mCbChannel = nullptr;
-  uint8_t* mCrChannel = nullptr;
-  int32_t mCbCrStride = 0;
-  gfx::IntSize mCbCrSize = gfx::IntSize(0, 0);
-  int32_t mCbSkip = 0;
-  int32_t mCrSkip = 0;
+  uint8_t* mCbChannel;
+  uint8_t* mCrChannel;
+  int32_t mCbCrStride;
+  gfx::IntSize mCbCrSize;
+  int32_t mCbSkip;
+  int32_t mCrSkip;
   // Picture region
-  uint32_t mPicX = 0;
-  uint32_t mPicY = 0;
-  gfx::IntSize mPicSize = gfx::IntSize(0, 0);
-  StereoMode mStereoMode = StereoMode::MONO;
-  gfx::ColorDepth mColorDepth = gfx::ColorDepth::COLOR_8;
-  gfx::YUVColorSpace mYUVColorSpace = gfx::YUVColorSpace::UNKNOWN;
-  gfx::ColorRange mColorRange = gfx::ColorRange::LIMITED;
+  uint32_t mPicX;
+  uint32_t mPicY;
+  gfx::IntSize mPicSize;
+  StereoMode mStereoMode;
+  gfx::YUVColorSpace mYUVColorSpace;
+  gfx::ColorDepth mColorDepth;
 
   gfx::IntRect GetPictureRect() const {
     return gfx::IntRect(mPicX, mPicY, mPicSize.width, mPicSize.height);
   }
+
+  PlanarYCbCrData()
+      : mYChannel(nullptr),
+        mYStride(0),
+        mYSize(0, 0),
+        mYSkip(0),
+        mCbChannel(nullptr),
+        mCrChannel(nullptr),
+        mCbCrStride(0),
+        mCbCrSize(0, 0),
+        mCbSkip(0),
+        mCrSkip(0),
+        mPicX(0),
+        mPicY(0),
+        mPicSize(0, 0),
+        mStereoMode(StereoMode::MONO),
+        mYUVColorSpace(gfx::YUVColorSpace::BT601),
+        mColorDepth(gfx::ColorDepth::COLOR_8) {}
 };
 
 /****** Image subtypes for the different formats ******/
 
 /**
  * We assume that the image data is in the REC 470M color space (see
  * Theora specification, section 4.3.1).
  *
--- a/gfx/layers/ImageDataSerializer.cpp
+++ b/gfx/layers/ImageDataSerializer.cpp
@@ -177,28 +177,16 @@ Maybe<gfx::ColorDepth> ColorDepthFromBuf
       return Nothing();
     case BufferDescriptor::TYCbCrDescriptor:
       return Some(aDescriptor.get_YCbCrDescriptor().colorDepth());
     default:
       MOZ_CRASH("GFX:  ColorDepthFromBufferDescriptor");
   }
 }
 
-Maybe<gfx::ColorRange> ColorRangeFromBufferDescriptor(
-    const BufferDescriptor& aDescriptor) {
-  switch (aDescriptor.type()) {
-    case BufferDescriptor::TRGBDescriptor:
-      return Nothing();
-    case BufferDescriptor::TYCbCrDescriptor:
-      return Some(aDescriptor.get_YCbCrDescriptor().colorRange());
-    default:
-      MOZ_CRASH("GFX: YUVFullRangeFromBufferDescriptor");
-  }
-}
-
 Maybe<StereoMode> StereoModeFromBufferDescriptor(
     const BufferDescriptor& aDescriptor) {
   switch (aDescriptor.type()) {
     case BufferDescriptor::TRGBDescriptor:
       return Nothing();
     case BufferDescriptor::TYCbCrDescriptor:
       return Some(aDescriptor.get_YCbCrDescriptor().stereoMode());
     default:
--- a/gfx/layers/ImageDataSerializer.h
+++ b/gfx/layers/ImageDataSerializer.h
@@ -61,19 +61,16 @@ Maybe<gfx::IntSize> CbCrSizeFromBufferDe
     const BufferDescriptor& aDescriptor);
 
 Maybe<gfx::YUVColorSpace> YUVColorSpaceFromBufferDescriptor(
     const BufferDescriptor& aDescriptor);
 
 Maybe<gfx::ColorDepth> ColorDepthFromBufferDescriptor(
     const BufferDescriptor& aDescriptor);
 
-Maybe<gfx::ColorRange> ColorRangeFromBufferDescriptor(
-    const BufferDescriptor& aDescriptor);
-
 Maybe<StereoMode> StereoModeFromBufferDescriptor(
     const BufferDescriptor& aDescriptor);
 
 uint8_t* GetYChannel(uint8_t* aBuffer, const YCbCrDescriptor& aDescriptor);
 
 uint8_t* GetCbChannel(uint8_t* aBuffer, const YCbCrDescriptor& aDescriptor);
 
 uint8_t* GetCrChannel(uint8_t* aBuffer, const YCbCrDescriptor& aDescriptor);
--- a/gfx/layers/MacIOSurfaceHelpers.cpp
+++ b/gfx/layers/MacIOSurfaceHelpers.cpp
@@ -78,19 +78,16 @@ CreateSourceSurfaceFromLockedMacIOSurfac
     data.mYChannel = (uint8_t*)aSurface->GetBaseAddressOfPlane(0);
     data.mYStride = aSurface->GetBytesPerRow(0);
     data.mYSize = IntSize::Truncate(ioWidth, ioHeight);
     data.mCbChannel = cbPlane.get();
     data.mCrChannel = crPlane.get();
     data.mCbCrStride = cbCrWidth;
     data.mCbCrSize = IntSize::Truncate(cbCrWidth, cbCrHeight);
     data.mPicSize = data.mYSize;
-    data.mYUVColorSpace = aSurface->GetYUVColorSpace();
-    data.mColorRange = aSurface->IsFullRange() ? gfx::ColorRange::FULL
-                                               : gfx::ColorRange::LIMITED;
 
     ConvertYCbCrToRGB(data, SurfaceFormat::B8G8R8X8,
                       IntSize::Truncate(ioWidth, ioHeight), mappedSurface.mData,
                       mappedSurface.mStride);
   } else if (ioFormat == SurfaceFormat::YUV422) {
     if (ioWidth == ALIGNED_32(ioWidth)) {
       // Optimization when width is aligned to 32.
       IntSize size = IntSize::Truncate(ioWidth, ioHeight);
@@ -145,19 +142,16 @@ CreateSourceSurfaceFromLockedMacIOSurfac
       data.mYChannel = ALIGNEDPTR_32(yPlane.get());
       data.mYStride = cbCrStride * 2;
       data.mYSize = IntSize::Truncate(ioWidth, ioHeight);
       data.mCbChannel = ALIGNEDPTR_32(cbPlane.get());
       data.mCrChannel = ALIGNEDPTR_32(crPlane.get());
       data.mCbCrStride = cbCrStride;
       data.mCbCrSize = IntSize::Truncate(cbCrWidth, cbCrHeight);
       data.mPicSize = data.mYSize;
-      data.mYUVColorSpace = aSurface->GetYUVColorSpace();
-      data.mColorRange = aSurface->IsFullRange() ? gfx::ColorRange::FULL
-                                                 : gfx::ColorRange::LIMITED;
 
       ConvertYCbCrToRGB(data, SurfaceFormat::B8G8R8X8,
                         IntSize::Truncate(ioWidth, ioHeight),
                         mappedSurface.mData, mappedSurface.mStride);
     }
   } else {
     unsigned char* ioData = (unsigned char*)aSurface->GetBaseAddress();
 
--- a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
+++ b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
@@ -49,23 +49,25 @@ class MacIOSurfaceTextureSourceBasic : p
  *
  * Most of the logic actually happens in MacIOSurfaceTextureSourceBasic.
  */
 class MacIOSurfaceTextureHostBasic : public TextureHost {
  public:
   MacIOSurfaceTextureHostBasic(
       TextureFlags aFlags, const SurfaceDescriptorMacIOSurface& aDescriptor);
 
-  void SetTextureSourceProvider(TextureSourceProvider* aProvider) override;
+  virtual void SetTextureSourceProvider(
+      TextureSourceProvider* aProvider) override;
 
   bool Lock() override;
 
   gfx::SurfaceFormat GetFormat() const override;
 
-  bool BindTextureSource(CompositableTextureSourceRef& aTexture) override {
+  virtual bool BindTextureSource(
+      CompositableTextureSourceRef& aTexture) override {
     aTexture = mTextureSource;
     return !!aTexture;
   }
 
   already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
     return nullptr;  // XXX - implement this (for MOZ_DUMP_PAINTING)
   }
 
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -97,17 +97,17 @@ already_AddRefed<TextureClient> ImageCli
     PlanarYCbCrImage* ycbcr = static_cast<PlanarYCbCrImage*>(aImage);
     const PlanarYCbCrData* data = ycbcr->GetData();
     if (!data) {
       return nullptr;
     }
     texture = TextureClient::CreateForYCbCr(
         aKnowsCompositor, data->mYSize, data->mYStride, data->mCbCrSize,
         data->mCbCrStride, data->mStereoMode, data->mColorDepth,
-        data->mYUVColorSpace, data->mColorRange, TextureFlags::DEFAULT);
+        data->mYUVColorSpace, TextureFlags::DEFAULT);
     if (!texture) {
       return nullptr;
     }
 
     TextureClientAutoLock autoLock(texture, OpenMode::OPEN_WRITE_ONLY);
     if (!autoLock.Succeeded()) {
       return nullptr;
     }
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -1330,28 +1330,28 @@ already_AddRefed<TextureClient> TextureC
   return MakeAndAddRef<TextureClient>(texData, aTextureFlags, aAllocator);
 }
 
 // static
 already_AddRefed<TextureClient> TextureClient::CreateForYCbCr(
     KnowsCompositor* aAllocator, gfx::IntSize aYSize, uint32_t aYStride,
     gfx::IntSize aCbCrSize, uint32_t aCbCrStride, StereoMode aStereoMode,
     gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
-    gfx::ColorRange aColorRange, TextureFlags aTextureFlags) {
+    TextureFlags aTextureFlags) {
   if (!aAllocator || !aAllocator->GetLayersIPCActor()->IPCOpen()) {
     return nullptr;
   }
 
   if (!gfx::Factory::AllowedSurfaceSize(aYSize)) {
     return nullptr;
   }
 
   TextureData* data = BufferTextureData::CreateForYCbCr(
       aAllocator, aYSize, aYStride, aCbCrSize, aCbCrStride, aStereoMode,
-      aColorDepth, aYUVColorSpace, aColorRange, aTextureFlags);
+      aColorDepth, aYUVColorSpace, aTextureFlags);
   if (!data) {
     return nullptr;
   }
 
   return MakeAndAddRef<TextureClient>(data, aTextureFlags,
                                       aAllocator->GetTextureForwarder());
 }
 
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -360,17 +360,17 @@ class TextureClient : public AtomicRefCo
       BackendSelector aSelector, TextureFlags aTextureFlags,
       TextureAllocationFlags aAllocFlags);
 
   // Creates and allocates a TextureClient supporting the YCbCr format.
   static already_AddRefed<TextureClient> CreateForYCbCr(
       KnowsCompositor* aAllocator, gfx::IntSize aYSize, uint32_t aYStride,
       gfx::IntSize aCbCrSize, uint32_t aCbCrStride, StereoMode aStereoMode,
       gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
-      gfx::ColorRange aColorRange, TextureFlags aTextureFlags);
+      TextureFlags aTextureFlags);
 
   // Creates and allocates a TextureClient (can be accessed through raw
   // pointers).
   static already_AddRefed<TextureClient> CreateForRawBufferAccess(
       KnowsCompositor* aAllocator, gfx::SurfaceFormat aFormat,
       gfx::IntSize aSize, gfx::BackendType aMoz2dBackend,
       TextureFlags aTextureFlags, TextureAllocationFlags flags = ALLOC_DEFAULT);
 
--- a/gfx/layers/client/TextureClientRecycleAllocator.cpp
+++ b/gfx/layers/client/TextureClientRecycleAllocator.cpp
@@ -91,20 +91,20 @@ bool YCbCrTextureClientAllocationHelper:
       bufferData->GetStereoMode().ref() != mData.mStereoMode) {
     return false;
   }
   return true;
 }
 
 already_AddRefed<TextureClient> YCbCrTextureClientAllocationHelper::Allocate(
     KnowsCompositor* aAllocator) {
-  return TextureClient::CreateForYCbCr(
-      aAllocator, mData.mYSize, mData.mYStride, mData.mCbCrSize,
-      mData.mCbCrStride, mData.mStereoMode, mData.mColorDepth,
-      mData.mYUVColorSpace, mData.mColorRange, mTextureFlags);
+  return TextureClient::CreateForYCbCr(aAllocator, mData.mYSize, mData.mYStride,
+                                       mData.mCbCrSize, mData.mCbCrStride,
+                                       mData.mStereoMode, mData.mColorDepth,
+                                       mData.mYUVColorSpace, mTextureFlags);
 }
 
 TextureClientRecycleAllocator::TextureClientRecycleAllocator(
     KnowsCompositor* aAllocator)
     : mSurfaceAllocator(aAllocator),
       mMaxPooledSize(kMaxPooledSized),
       mLock("TextureClientRecycleAllocatorImp.mLock"),
       mIsDestroyed(false) {}
--- a/gfx/layers/composite/GPUVideoTextureHost.cpp
+++ b/gfx/layers/composite/GPUVideoTextureHost.cpp
@@ -80,23 +80,16 @@ void GPUVideoTextureHost::SetTextureSour
 
 gfx::YUVColorSpace GPUVideoTextureHost::GetYUVColorSpace() const {
   if (mWrappedTextureHost) {
     return mWrappedTextureHost->GetYUVColorSpace();
   }
   return gfx::YUVColorSpace::UNKNOWN;
 }
 
-gfx::ColorRange GPUVideoTextureHost::GetColorRange() const {
-  if (mWrappedTextureHost) {
-    return mWrappedTextureHost->GetColorRange();
-  }
-  return TextureHost::GetColorRange();
-}
-
 gfx::IntSize GPUVideoTextureHost::GetSize() const {
   if (!mWrappedTextureHost) {
     return gfx::IntSize();
   }
   return mWrappedTextureHost->GetSize();
 }
 
 gfx::SurfaceFormat GPUVideoTextureHost::GetFormat() const {
--- a/gfx/layers/composite/GPUVideoTextureHost.h
+++ b/gfx/layers/composite/GPUVideoTextureHost.h
@@ -33,17 +33,16 @@ class GPUVideoTextureHost : public Textu
   bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
   bool AcquireTextureSource(CompositableTextureSourceRef& aTexture) override;
 
   already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
     return nullptr;  // XXX - implement this (for MOZ_DUMP_PAINTING)
   }
 
   gfx::YUVColorSpace GetYUVColorSpace() const override;
-  gfx::ColorRange GetColorRange() const override;
 
   gfx::IntSize GetSize() const override;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   const char* Name() override { return "GPUVideoTextureHost"; }
 #endif
 
   bool HasIntermediateBuffer() const override;
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -623,18 +623,17 @@ void BufferTextureHost::PushDisplayItems
     aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
                        !(mFlags & TextureFlags::NON_PREMULTIPLIED));
   } else {
     MOZ_ASSERT(aImageKeys.length() == 3);
     const YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
     aBuilder.PushYCbCrPlanarImage(
         aBounds, aClip, true, aImageKeys[0], aImageKeys[1], aImageKeys[2],
         wr::ToWrColorDepth(desc.colorDepth()),
-        wr::ToWrYuvColorSpace(desc.yUVColorSpace()),
-        wr::ToWrColorRange(desc.colorRange()), aFilter);
+        wr::ToWrYuvColorSpace(desc.yUVColorSpace()), aFilter);
   }
 }
 
 void TextureHost::DeserializeReadLock(const ReadLockDescriptor& aDesc,
                                       ISurfaceAllocator* aAllocator) {
   if (mReadLock) {
     return;
   }
@@ -891,24 +890,16 @@ gfx::YUVColorSpace BufferTextureHost::Ge
 gfx::ColorDepth BufferTextureHost::GetColorDepth() const {
   if (mFormat == gfx::SurfaceFormat::YUV) {
     const YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
     return desc.colorDepth();
   }
   return gfx::ColorDepth::COLOR_8;
 }
 
-gfx::ColorRange BufferTextureHost::GetColorRange() const {
-  if (mFormat == gfx::SurfaceFormat::YUV) {
-    const YCbCrDescriptor& desc = mDescriptor.get_YCbCrDescriptor();
-    return desc.colorRange();
-  }
-  return TextureHost::GetColorRange();
-}
-
 bool BufferTextureHost::UploadIfNeeded() {
   return MaybeUpload(!mNeedsFullUpdate ? &mMaybeUpdatedRegion : nullptr);
 }
 
 bool BufferTextureHost::MaybeUpload(nsIntRegion* aRegion) {
   auto serial = mFirstSource ? mFirstSource->GetUpdateSerial() : 0;
 
   if (serial == mUpdateSerial) {
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -443,24 +443,16 @@ class TextureHost : public AtomicRefCoun
   /**
    * Return the color depth of the image. Used with YUV textures.
    */
   virtual gfx::ColorDepth GetColorDepth() const {
     return gfx::ColorDepth::COLOR_8;
   }
 
   /**
-   * Return true if using full range values (0-255 if 8 bits YUV). Used with YUV
-   * textures.
-   */
-  virtual gfx::ColorRange GetColorRange() const {
-    return gfx::ColorRange::LIMITED;
-  }
-
-  /**
    * Called during the transaction. The TextureSource may or may not be
    * composited.
    *
    * Note that this is called outside of lock/unlock.
    */
   virtual void PrepareTextureSource(CompositableTextureSourceRef& aTexture) {}
 
   /**
@@ -767,18 +759,16 @@ class BufferTextureHost : public Texture
    * GetFormat will be RGB32 (even though mFormat is SurfaceFormat::YUV).
    */
   gfx::SurfaceFormat GetFormat() const override;
 
   gfx::YUVColorSpace GetYUVColorSpace() const override;
 
   gfx::ColorDepth GetColorDepth() const override;
 
-  gfx::ColorRange GetColorRange() const override;
-
   gfx::IntSize GetSize() const override { return mSize; }
 
   already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override;
 
   bool HasIntermediateBuffer() const override { return mHasIntermediateBuffer; }
 
   BufferTextureHost* AsBufferTextureHost() override { return this; }
 
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -379,17 +379,17 @@ bool D3D11TextureData::SerializeSpecific
   HANDLE sharedHandle;
   HRESULT hr = resource->GetSharedHandle(&sharedHandle);
   if (FAILED(hr)) {
     LOGD3D11("Error getting shared handle for texture.");
     return false;
   }
 
   *aOutDesc = SurfaceDescriptorD3D10((WindowsHandle)sharedHandle, mFormat,
-                                     mSize, mYUVColorSpace, mColorRange);
+                                     mSize, mYUVColorSpace);
   return true;
 }
 
 bool D3D11TextureData::Serialize(SurfaceDescriptor& aOutDescriptor) {
   SurfaceDescriptorD3D10 desc;
   if (!SerializeSpecific(&desc)) return false;
 
   aOutDescriptor = std::move(desc);
@@ -567,17 +567,17 @@ TextureFlags D3D11TextureData::GetTextur
   return flags;
 }
 
 DXGIYCbCrTextureData* DXGIYCbCrTextureData::Create(
     IDirect3DTexture9* aTextureY, IDirect3DTexture9* aTextureCb,
     IDirect3DTexture9* aTextureCr, HANDLE aHandleY, HANDLE aHandleCb,
     HANDLE aHandleCr, const gfx::IntSize& aSize, const gfx::IntSize& aSizeY,
     const gfx::IntSize& aSizeCbCr, gfx::ColorDepth aColorDepth,
-    YUVColorSpace aYUVColorSpace, gfx::ColorRange aColorRange) {
+    YUVColorSpace aYUVColorSpace) {
   if (!aHandleY || !aHandleCb || !aHandleCr || !aTextureY || !aTextureCb ||
       !aTextureCr) {
     return nullptr;
   }
 
   DXGIYCbCrTextureData* texture = new DXGIYCbCrTextureData();
   texture->mHandles[0] = aHandleY;
   texture->mHandles[1] = aHandleCb;
@@ -585,27 +585,25 @@ DXGIYCbCrTextureData* DXGIYCbCrTextureDa
   texture->mD3D9Textures[0] = aTextureY;
   texture->mD3D9Textures[1] = aTextureCb;
   texture->mD3D9Textures[2] = aTextureCr;
   texture->mSize = aSize;
   texture->mSizeY = aSizeY;
   texture->mSizeCbCr = aSizeCbCr;
   texture->mColorDepth = aColorDepth;
   texture->mYUVColorSpace = aYUVColorSpace;
-  texture->mColorRange = aColorRange;
 
   return texture;
 }
 
 DXGIYCbCrTextureData* DXGIYCbCrTextureData::Create(
     ID3D11Texture2D* aTextureY, ID3D11Texture2D* aTextureCb,
     ID3D11Texture2D* aTextureCr, const gfx::IntSize& aSize,
     const gfx::IntSize& aSizeY, const gfx::IntSize& aSizeCbCr,
-    gfx::ColorDepth aColorDepth, YUVColorSpace aYUVColorSpace,
-    gfx::ColorRange aColorRange) {
+    gfx::ColorDepth aColorDepth, YUVColorSpace aYUVColorSpace) {
   if (!aTextureY || !aTextureCb || !aTextureCr) {
     return nullptr;
   }
 
   aTextureY->SetPrivateDataInterface(
       sD3D11TextureUsage,
       new TextureMemoryMeasurer(aSize.width * aSize.height));
   aTextureCb->SetPrivateDataInterface(
@@ -647,17 +645,16 @@ DXGIYCbCrTextureData* DXGIYCbCrTextureDa
   texture->mD3D11Textures[0] = aTextureY;
   texture->mD3D11Textures[1] = aTextureCb;
   texture->mD3D11Textures[2] = aTextureCr;
   texture->mSize = aSize;
   texture->mSizeY = aSizeY;
   texture->mSizeCbCr = aSizeCbCr;
   texture->mColorDepth = aColorDepth;
   texture->mYUVColorSpace = aYUVColorSpace;
-  texture->mColorRange = aColorRange;
 
   return texture;
 }
 
 void DXGIYCbCrTextureData::FillInfo(TextureData::Info& aInfo) const {
   aInfo.size = mSize;
   aInfo.format = gfx::SurfaceFormat::YUV;
   aInfo.supportsMoz2D = false;
@@ -665,17 +662,17 @@ void DXGIYCbCrTextureData::FillInfo(Text
   aInfo.hasSynchronization = false;
 }
 
 void DXGIYCbCrTextureData::SerializeSpecific(
     SurfaceDescriptorDXGIYCbCr* const aOutDesc) {
   *aOutDesc = SurfaceDescriptorDXGIYCbCr(
       (WindowsHandle)mHandles[0], (WindowsHandle)mHandles[1],
       (WindowsHandle)mHandles[2], mSize, mSizeY, mSizeCbCr, mColorDepth,
-      mYUVColorSpace, mColorRange);
+      mYUVColorSpace);
 }
 
 bool DXGIYCbCrTextureData::Serialize(SurfaceDescriptor& aOutDescriptor) {
   SurfaceDescriptorDXGIYCbCr desc;
   SerializeSpecific(&desc);
 
   aOutDescriptor = std::move(desc);
   return true;
@@ -760,17 +757,16 @@ bool D3D11TextureData::UpdateFromSurface
 
 DXGITextureHostD3D11::DXGITextureHostD3D11(
     TextureFlags aFlags, const SurfaceDescriptorD3D10& aDescriptor)
     : TextureHost(aFlags),
       mSize(aDescriptor.size()),
       mHandle(aDescriptor.handle()),
       mFormat(aDescriptor.format()),
       mYUVColorSpace(aDescriptor.yUVColorSpace()),
-      mColorRange(aDescriptor.colorRange()),
       mIsLocked(false) {}
 
 bool DXGITextureHostD3D11::EnsureTexture() {
   RefPtr<ID3D11Device> device;
   if (mTexture) {
     mTexture->GetDevice(getter_AddRefs(device));
     if (device == DeviceManagerDx::Get()->GetCompositorDevice()) {
       NS_WARNING("Incompatible texture.");
@@ -1075,35 +1071,33 @@ void DXGITextureHostD3D11::PushDisplayIt
     case gfx::SurfaceFormat::P010:
     case gfx::SurfaceFormat::P016:
     case gfx::SurfaceFormat::NV12: {
       MOZ_ASSERT(aImageKeys.length() == 2);
       aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
                              GetFormat() == gfx::SurfaceFormat::NV12
                                  ? wr::ColorDepth::Color8
                                  : wr::ColorDepth::Color16,
-                             wr::ToWrYuvColorSpace(mYUVColorSpace),
-                             wr::ToWrColorRange(mColorRange), aFilter);
+                             wr::ToWrYuvColorSpace(mYUVColorSpace), aFilter);
       break;
     }
     default: {
       MOZ_ASSERT_UNREACHABLE("unexpected to be called");
     }
   }
 }
 
 DXGIYCbCrTextureHostD3D11::DXGIYCbCrTextureHostD3D11(
     TextureFlags aFlags, const SurfaceDescriptorDXGIYCbCr& aDescriptor)
     : TextureHost(aFlags),
       mSize(aDescriptor.size()),
       mSizeCbCr(aDescriptor.sizeCbCr()),
       mIsLocked(false),
       mColorDepth(aDescriptor.colorDepth()),
-      mYUVColorSpace(aDescriptor.yUVColorSpace()),
-      mColorRange(aDescriptor.colorRange()) {
+      mYUVColorSpace(aDescriptor.yUVColorSpace()) {
   mHandles[0] = aDescriptor.handleY();
   mHandles[1] = aDescriptor.handleCb();
   mHandles[2] = aDescriptor.handleCr();
 }
 
 bool DXGIYCbCrTextureHostD3D11::EnsureTexture() {
   RefPtr<ID3D11Device> device;
   if (mTextures[0]) {
@@ -1286,20 +1280,20 @@ void DXGIYCbCrTextureHostD3D11::PushReso
 }
 
 void DXGIYCbCrTextureHostD3D11::PushDisplayItems(
     wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
     const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
     const Range<wr::ImageKey>& aImageKeys) {
   MOZ_ASSERT(aImageKeys.length() == 3);
 
-  aBuilder.PushYCbCrPlanarImage(
-      aBounds, aClip, true, aImageKeys[0], aImageKeys[1], aImageKeys[2],
-      wr::ToWrColorDepth(mColorDepth), wr::ToWrYuvColorSpace(mYUVColorSpace),
-      wr::ToWrColorRange(mColorRange), aFilter);
+  aBuilder.PushYCbCrPlanarImage(aBounds, aClip, true, aImageKeys[0],
+                                aImageKeys[1], aImageKeys[2],
+                                wr::ToWrColorDepth(mColorDepth),
+                                wr::ToWrYuvColorSpace(mYUVColorSpace), aFilter);
 }
 
 bool DXGIYCbCrTextureHostD3D11::AcquireTextureSource(
     CompositableTextureSourceRef& aTexture) {
   if (!EnsureTextureSource()) {
     return false;
   }
   aTexture = mTextureSources[0].get();
--- a/gfx/layers/d3d11/TextureD3D11.h
+++ b/gfx/layers/d3d11/TextureD3D11.h
@@ -82,18 +82,16 @@ class D3D11TextureData final : public Te
 
   bool Serialize(SurfaceDescriptor& aOutDescrptor) override;
   void GetSubDescriptor(GPUVideoSubDescriptor* aOutDesc) override;
 
   gfx::YUVColorSpace GetYUVColorSpace() const { return mYUVColorSpace; }
   void SetYUVColorSpace(gfx::YUVColorSpace aColorSpace) {
     mYUVColorSpace = aColorSpace;
   }
-  gfx::ColorRange GetColorRange() const { return mColorRange; }
-  void SetColorRange(gfx::ColorRange aColorRange) { mColorRange = aColorRange; }
 
   gfx::IntSize GetSize() const { return mSize; }
   gfx::SurfaceFormat GetSurfaceFormat() const { return mFormat; }
 
   TextureFlags GetTextureFlags() const override;
 
  private:
   D3D11TextureData(ID3D11Texture2D* aTexture, gfx::IntSize aSize,
@@ -114,17 +112,16 @@ class D3D11TextureData final : public Te
                                   ID3D11Device* aDevice = nullptr);
 
   // Hold on to the DrawTarget because it is expensive to create one each
   // ::Lock.
   RefPtr<gfx::DrawTarget> mDrawTarget;
   gfx::IntSize mSize;
   gfx::SurfaceFormat mFormat;
   gfx::YUVColorSpace mYUVColorSpace = gfx::YUVColorSpace::UNKNOWN;
-  gfx::ColorRange mColorRange = gfx::ColorRange::LIMITED;
   bool mNeedsClear;
   bool mNeedsClearWhite;
   bool mHasSynchronization;
   bool mIsForOutOfBandContent;
 
   RefPtr<ID3D11Texture2D> mTexture;
   const TextureAllocationFlags mAllocationFlags;
 };
@@ -133,24 +130,23 @@ class DXGIYCbCrTextureData : public Text
   friend class gl::GLBlitHelper;
 
  public:
   static DXGIYCbCrTextureData* Create(
       IDirect3DTexture9* aTextureY, IDirect3DTexture9* aTextureCb,
       IDirect3DTexture9* aTextureCr, HANDLE aHandleY, HANDLE aHandleCb,
       HANDLE aHandleCr, const gfx::IntSize& aSize, const gfx::IntSize& aSizeY,
       const gfx::IntSize& aSizeCbCr, gfx::ColorDepth aColorDepth,
-      gfx::YUVColorSpace aYUVColorSpace, gfx::ColorRange aColorRange);
+      gfx::YUVColorSpace aYUVColorSpace);
 
   static DXGIYCbCrTextureData* Create(
       ID3D11Texture2D* aTextureCb, ID3D11Texture2D* aTextureY,
       ID3D11Texture2D* aTextureCr, const gfx::IntSize& aSize,
       const gfx::IntSize& aSizeY, const gfx::IntSize& aSizeCbCr,
-      gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
-      gfx::ColorRange aColorRange);
+      gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace);
 
   bool Lock(OpenMode) override { return true; }
 
   void Unlock() override {}
 
   void FillInfo(TextureData::Info& aInfo) const override;
 
   void SerializeSpecific(SurfaceDescriptorDXGIYCbCr* aOutDesc);
@@ -169,33 +165,32 @@ class DXGIYCbCrTextureData : public Text
 
   DXGIYCbCrTextureData* AsDXGIYCbCrTextureData() override { return this; }
 
   gfx::IntSize GetYSize() const { return mSizeY; }
 
   gfx::IntSize GetCbCrSize() const { return mSizeCbCr; }
 
   gfx::ColorDepth GetColorDepth() const { return mColorDepth; }
+
   gfx::YUVColorSpace GetYUVColorSpace() const { return mYUVColorSpace; }
-  gfx::ColorRange GetColorRange() const { return mColorRange; }
 
   ID3D11Texture2D* GetD3D11Texture(size_t index) {
     return mD3D11Textures[index];
   }
 
  protected:
   RefPtr<ID3D11Texture2D> mD3D11Textures[3];
   RefPtr<IDirect3DTexture9> mD3D9Textures[3];
   HANDLE mHandles[3];
   gfx::IntSize mSize;
   gfx::IntSize mSizeY;
   gfx::IntSize mSizeCbCr;
   gfx::ColorDepth mColorDepth;
   gfx::YUVColorSpace mYUVColorSpace;
-  gfx::ColorRange mColorRange;
 };
 
 /**
  * TextureSource that provides with the necessary APIs to be composited by a
  * CompositorD3D11.
  */
 class TextureSourceD3D11 {
  public:
@@ -336,17 +331,16 @@ class DXGITextureHostD3D11 : public Text
 
   bool LockWithoutCompositor() override;
   void UnlockWithoutCompositor() override;
 
   gfx::IntSize GetSize() const override { return mSize; }
   gfx::YUVColorSpace GetYUVColorSpace() const override {
     return mYUVColorSpace;
   }
-  gfx::ColorRange GetColorRange() const override { return mColorRange; }
 
   already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override;
 
   void CreateRenderTexture(
       const wr::ExternalImageId& aExternalImageId) override;
 
   uint32_t NumSubTextures() override;
 
@@ -372,17 +366,16 @@ class DXGITextureHostD3D11 : public Text
 
   RefPtr<ID3D11Device> mDevice;
   RefPtr<ID3D11Texture2D> mTexture;
   RefPtr<DataTextureSourceD3D11> mTextureSource;
   gfx::IntSize mSize;
   WindowsHandle mHandle;
   gfx::SurfaceFormat mFormat;
   const gfx::YUVColorSpace mYUVColorSpace;
-  const gfx::ColorRange mColorRange;
   bool mIsLocked;
 };
 
 class DXGIYCbCrTextureHostD3D11 : public TextureHost {
  public:
   DXGIYCbCrTextureHostD3D11(TextureFlags aFlags,
                             const SurfaceDescriptorDXGIYCbCr& aDescriptor);
 
@@ -393,20 +386,20 @@ class DXGIYCbCrTextureHostD3D11 : public
 
   void SetTextureSourceProvider(TextureSourceProvider* aProvider) override;
 
   gfx::SurfaceFormat GetFormat() const override {
     return gfx::SurfaceFormat::YUV;
   }
 
   gfx::ColorDepth GetColorDepth() const override { return mColorDepth; }
+
   gfx::YUVColorSpace GetYUVColorSpace() const override {
     return mYUVColorSpace;
   }
-  gfx::ColorRange GetColorRange() const override { return mColorRange; }
 
   bool Lock() override;
 
   void Unlock() override;
 
   gfx::IntSize GetSize() const override { return mSize; }
 
   already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
@@ -440,17 +433,16 @@ class DXGIYCbCrTextureHostD3D11 : public
   RefPtr<DataTextureSourceD3D11> mTextureSources[3];
 
   gfx::IntSize mSize;
   gfx::IntSize mSizeCbCr;
   WindowsHandle mHandles[3];
   bool mIsLocked;
   gfx::ColorDepth mColorDepth;
   gfx::YUVColorSpace mYUVColorSpace;
-  gfx::ColorRange mColorRange;
 };
 
 class CompositingRenderTargetD3D11 : public CompositingRenderTarget,
                                      public TextureSourceD3D11 {
  public:
   CompositingRenderTargetD3D11(
       ID3D11Texture2D* aTexture, const gfx::IntPoint& aOrigin,
       DXGI_FORMAT aFormatOverride = DXGI_FORMAT_UNKNOWN);
--- a/gfx/layers/ipc/LayersSurfaces.ipdlh
+++ b/gfx/layers/ipc/LayersSurfaces.ipdlh
@@ -5,17 +5,16 @@
 using struct gfxPoint from "gfxPoint.h";
 using nsIntRegion from "nsRegion.h";
 using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
 using mozilla::StereoMode from "ImageTypes.h";
 using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
 using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
 using mozilla::gfx::YUVColorSpace from "mozilla/gfx/Types.h";
 using mozilla::gfx::ColorDepth from "mozilla/gfx/Types.h";
-using mozilla::gfx::ColorRange from "mozilla/gfx/Types.h";
 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
 using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h";
 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
 using mozilla::ipc::SharedMemoryBasic::Handle from "mozilla/ipc/SharedMemoryBasic.h";
 using gfxImageFormat from "gfxTypes.h";
 
 namespace mozilla {
 namespace layers {
@@ -31,29 +30,27 @@ struct SurfaceDescriptorDIB {
   uintptr_t surface;
 };
 
 struct SurfaceDescriptorD3D10 {
   WindowsHandle handle;
   SurfaceFormat format;
   IntSize size;
   YUVColorSpace yUVColorSpace;
-  ColorRange colorRange;
 };
 
 struct SurfaceDescriptorDXGIYCbCr {
   WindowsHandle handleY;
   WindowsHandle handleCb;
   WindowsHandle handleCr;
   IntSize size;
   IntSize sizeY;
   IntSize sizeCbCr;
   ColorDepth colorDepth;
   YUVColorSpace yUVColorSpace;
-  ColorRange colorRange;
 };
 
 struct SurfaceDescriptorMacIOSurface {
   uint32_t surfaceId;
   double scaleFactor;
   bool isOpaque;
   YUVColorSpace yUVColorSpace;
 };
@@ -105,17 +102,16 @@ struct YCbCrDescriptor {
   IntSize cbCrSize;
   uint32_t cbCrStride;
   uint32_t yOffset;
   uint32_t cbOffset;
   uint32_t crOffset;
   StereoMode stereoMode;
   ColorDepth colorDepth;
   YUVColorSpace yUVColorSpace;
-  ColorRange colorRange;
   bool hasIntermediateBuffer;
 };
 
 union BufferDescriptor {
   RGBDescriptor;
   YCbCrDescriptor;
 };
 
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
@@ -117,24 +117,16 @@ gl::GLContext* MacIOSurfaceTextureHostOG
 
 gfx::YUVColorSpace MacIOSurfaceTextureHostOGL::GetYUVColorSpace() const {
   if (!mSurface) {
     return gfx::YUVColorSpace::UNKNOWN;
   }
   return mSurface->GetYUVColorSpace();
 }
 
-gfx::ColorRange MacIOSurfaceTextureHostOGL::GetColorRange() const {
-  if (!mSurface) {
-    return gfx::ColorRange::LIMITED;
-  }
-  return mSurface->IsFullRange() ? gfx::ColorRange::FULL
-                                 : gfx::ColorRange::LIMITED;
-}
-
 void MacIOSurfaceTextureHostOGL::CreateRenderTexture(
     const wr::ExternalImageId& aExternalImageId) {
   RefPtr<wr::RenderTextureHost> texture =
       new wr::RenderMacIOSurfaceTextureHostOGL(GetMacIOSurface());
 
   wr::RenderThread::Get()->RegisterExternalImage(wr::AsUint64(aExternalImageId),
                                                  texture.forget());
 }
@@ -232,29 +224,28 @@ void MacIOSurfaceTextureHostOGL::PushDis
     }
     case gfx::SurfaceFormat::YUV422: {
       MOZ_ASSERT(aImageKeys.length() == 1);
       MOZ_ASSERT(mSurface->GetPlaneCount() == 0);
       // Those images can only be generated at present by the Apple H264 decoder
       // which only supports 8 bits color depth.
       aBuilder.PushYCbCrInterleavedImage(
           aBounds, aClip, true, aImageKeys[0], wr::ColorDepth::Color8,
-          wr::ToWrYuvColorSpace(GetYUVColorSpace()),
-          wr::ToWrColorRange(GetColorRange()), aFilter);
+          wr::ToWrYuvColorSpace(GetYUVColorSpace()), aFilter);
       break;
     }
     case gfx::SurfaceFormat::NV12: {
       MOZ_ASSERT(aImageKeys.length() == 2);
       MOZ_ASSERT(mSurface->GetPlaneCount() == 2);
       // Those images can only be generated at present by the Apple H264 decoder
       // which only supports 8 bits color depth.
       aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
                              wr::ColorDepth::Color8,
                              wr::ToWrYuvColorSpace(GetYUVColorSpace()),
-                             wr::ToWrColorRange(GetColorRange()), aFilter);
+                             aFilter);
       break;
     }
     default: {
       MOZ_ASSERT_UNREACHABLE("unexpected to be called");
     }
   }
 }
 
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
@@ -74,17 +74,16 @@ class MacIOSurfaceTextureHostOGL : publi
                            const wr::ExternalImageId& aExtID) override;
 
   void PushDisplayItems(wr::DisplayListBuilder& aBuilder,
                         const wr::LayoutRect& aBounds,
                         const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
                         const Range<wr::ImageKey>& aImageKeys) override;
 
   gfx::YUVColorSpace GetYUVColorSpace() const override;
-  gfx::ColorRange GetColorRange() const override;
 
  protected:
   GLTextureSource* CreateTextureSourceForPlane(size_t aPlane);
 
   RefPtr<GLTextureSource> mTextureSource;
   RefPtr<MacIOSurface> mSurface;
 };
 
--- a/gfx/layers/wr/WebRenderTextureHost.cpp
+++ b/gfx/layers/wr/WebRenderTextureHost.cpp
@@ -137,23 +137,16 @@ already_AddRefed<gfx::DataSourceSurface>
 
 gfx::YUVColorSpace WebRenderTextureHost::GetYUVColorSpace() const {
   if (mWrappedTextureHost) {
     return mWrappedTextureHost->GetYUVColorSpace();
   }
   return gfx::YUVColorSpace::UNKNOWN;
 }
 
-gfx::ColorRange WebRenderTextureHost::GetColorRange() const {
-  if (mWrappedTextureHost) {
-    return mWrappedTextureHost->GetColorRange();
-  }
-  return TextureHost::GetColorRange();
-}
-
 gfx::IntSize WebRenderTextureHost::GetSize() const {
   if (!mWrappedTextureHost) {
     return gfx::IntSize();
   }
   return mWrappedTextureHost->GetSize();
 }
 
 gfx::SurfaceFormat WebRenderTextureHost::GetFormat() const {
--- a/gfx/layers/wr/WebRenderTextureHost.h
+++ b/gfx/layers/wr/WebRenderTextureHost.h
@@ -47,17 +47,16 @@ class WebRenderTextureHost : public Text
   // textureHosts use their special data representation internally, but we could
   // treat these textureHost as the read-format when we read them.
   // Please check TextureHost::GetReadFormat().
   gfx::SurfaceFormat GetReadFormat() const override;
 
   already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override;
 
   gfx::YUVColorSpace GetYUVColorSpace() const override;
-  gfx::ColorRange GetColorRange() const override;
 
   gfx::IntSize GetSize() const override;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   const char* Name() override { return "WebRenderTextureHost"; }
 #endif
 
   WebRenderTextureHost* AsWebRenderTextureHost() override { return this; }
--- a/gfx/tests/gtest/TestTextures.cpp
+++ b/gfx/tests/gtest/TestTextures.cpp
@@ -292,16 +292,15 @@ TEST(Layers, TextureYCbCrSerialization)
 
   // Skip this testing if IPDL connection is not ready
   if (!retry && !imageBridge->IPCOpen()) {
     return;
   }
 
   RefPtr<TextureClient> client = TextureClient::CreateForYCbCr(
       imageBridge, clientData.mYSize, clientData.mYStride, clientData.mCbCrSize,
-      clientData.mCbCrStride, StereoMode::MONO, ColorDepth::COLOR_8,
-      YUVColorSpace::BT601, ColorRange::LIMITED,
-      TextureFlags::DEALLOCATE_CLIENT);
+      clientData.mCbCrStride, StereoMode::MONO, gfx::ColorDepth::COLOR_8,
+      YUVColorSpace::BT601, TextureFlags::DEALLOCATE_CLIENT);
 
   TestTextureClientYCbCr(client, clientData);
 
   // XXX - Test more texture client types.
 }
--- a/gfx/tests/gtest/TextureHelper.h
+++ b/gfx/tests/gtest/TextureHelper.h
@@ -59,18 +59,17 @@ static already_AddRefed<TextureClient> C
   clientData.mPicX = 0;
   clientData.mPicX = 0;
 
   // Create YCbCrTexture for basic backend.
   if (aLayersBackend == LayersBackend::LAYERS_BASIC) {
     return TextureClient::CreateForYCbCr(
         nullptr, clientData.mYSize, clientData.mYStride, clientData.mCbCrSize,
         clientData.mCbCrStride, StereoMode::MONO, gfx::ColorDepth::COLOR_8,
-        gfx::YUVColorSpace::BT601, gfx::ColorRange::LIMITED,
-        TextureFlags::DEALLOCATE_CLIENT);
+        YUVColorSpace::BT601, TextureFlags::DEALLOCATE_CLIENT);
   }
 
 #ifdef XP_WIN
   RefPtr<ID3D11Device> device = DeviceManagerDx::Get()->GetImageDevice();
 
   if (device && aLayersBackend == LayersBackend::LAYERS_D3D11) {
     DXGIYCbCrTextureAllocationHelper helper(clientData, TextureFlags::DEFAULT,
                                             device);
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -1068,44 +1068,43 @@ void DisplayListBuilder::PushImage(
                    aFilter, aImage, aPremultipliedAlpha, aColor);
 }
 
 void DisplayListBuilder::PushYCbCrPlanarImage(
     const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
     bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
     wr::ImageKey aImageChannel1, wr::ImageKey aImageChannel2,
     wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
-    wr::WrColorRange aColorRange, wr::ImageRendering aRendering) {
-  wr_dp_push_yuv_planar_image(
-      mWrState, aBounds, MergeClipLeaf(aClip), aIsBackfaceVisible,
-      &mCurrentSpaceAndClipChain, aImageChannel0, aImageChannel1,
-      aImageChannel2, aColorDepth, aColorSpace, aColorRange, aRendering);
+    wr::ImageRendering aRendering) {
+  wr_dp_push_yuv_planar_image(mWrState, aBounds, MergeClipLeaf(aClip),
+                              aIsBackfaceVisible, &mCurrentSpaceAndClipChain,
+                              aImageChannel0, aImageChannel1, aImageChannel2,
+                              aColorDepth, aColorSpace, aRendering);
 }
 
 void DisplayListBuilder::PushNV12Image(
     const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
     bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
     wr::ImageKey aImageChannel1, wr::WrColorDepth aColorDepth,
-    wr::WrYuvColorSpace aColorSpace, wr::WrColorRange aColorRange,
-    wr::ImageRendering aRendering) {
+    wr::WrYuvColorSpace aColorSpace, wr::ImageRendering aRendering) {
   wr_dp_push_yuv_NV12_image(mWrState, aBounds, MergeClipLeaf(aClip),
                             aIsBackfaceVisible, &mCurrentSpaceAndClipChain,
                             aImageChannel0, aImageChannel1, aColorDepth,
-                            aColorSpace, aColorRange, aRendering);
+                            aColorSpace, aRendering);
 }
 
 void DisplayListBuilder::PushYCbCrInterleavedImage(
     const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
     bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
     wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
-    wr::WrColorRange aColorRange, wr::ImageRendering aRendering) {
-  wr_dp_push_yuv_interleaved_image(
-      mWrState, aBounds, MergeClipLeaf(aClip), aIsBackfaceVisible,
-      &mCurrentSpaceAndClipChain, aImageChannel0, aColorDepth, aColorSpace,
-      aColorRange, aRendering);
+    wr::ImageRendering aRendering) {
+  wr_dp_push_yuv_interleaved_image(mWrState, aBounds, MergeClipLeaf(aClip),
+                                   aIsBackfaceVisible,
+                                   &mCurrentSpaceAndClipChain, aImageChannel0,
+                                   aColorDepth, aColorSpace, aRendering);
 }
 
 void DisplayListBuilder::PushIFrame(const wr::LayoutRect& aBounds,
                                     bool aIsBackfaceVisible,
                                     PipelineId aPipeline,
                                     bool aIgnoreMissingPipeline) {
   mRemotePipelineIds.AppendElement(aPipeline);
   wr_dp_push_iframe(mWrState, aBounds, MergeClipLeaf(aBounds),
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -471,29 +471,31 @@ class DisplayListBuilder final {
                  wr::ImageKey aImage, bool aPremultipliedAlpha = true,
                  const wr::ColorF& aColor = wr::ColorF{1.0f, 1.0f, 1.0f, 1.0f});
 
   void PushYCbCrPlanarImage(
       const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
       bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
       wr::ImageKey aImageChannel1, wr::ImageKey aImageChannel2,
       wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
-      wr::WrColorRange aColorRange, wr::ImageRendering aFilter);
+      wr::ImageRendering aFilter);
 
   void PushNV12Image(const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
                      bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
                      wr::ImageKey aImageChannel1, wr::WrColorDepth aColorDepth,
                      wr::WrYuvColorSpace aColorSpace,
-                     wr::WrColorRange aColorRange, wr::ImageRendering aFilter);
+                     wr::ImageRendering aFilter);
 
-  void PushYCbCrInterleavedImage(
-      const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
-      bool aIsBackfaceVisible, wr::ImageKey aImageChannel0,
-      wr::WrColorDepth aColorDepth, wr::WrYuvColorSpace aColorSpace,
-      wr::WrColorRange aColorRange, wr::ImageRendering aFilter);
+  void PushYCbCrInterleavedImage(const wr::LayoutRect& aBounds,
+                                 const wr::LayoutRect& aClip,
+                                 bool aIsBackfaceVisible,
+                                 wr::ImageKey aImageChannel0,
+                                 wr::WrColorDepth aColorDepth,
+                                 wr::WrYuvColorSpace aColorSpace,
+                                 wr::ImageRendering aFilter);
 
   void PushIFrame(const wr::LayoutRect& aBounds, bool aIsBackfaceVisible,
                   wr::PipelineId aPipeline, bool aIgnoreMissingPipeline);
 
   // XXX WrBorderSides are passed with Range.
   // It is just to bypass compiler bug. See Bug 1357734.
   void PushBorder(const wr::LayoutRect& aBounds, const wr::LayoutRect& aClip,
                   bool aIsBackfaceVisible, const wr::LayoutSideOffsets& aWidths,
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -905,28 +905,16 @@ static inline wr::WrColorDepth ToWrColor
     case gfx::ColorDepth::COLOR_16:
       return wr::WrColorDepth::Color16;
     default:
       MOZ_ASSERT_UNREACHABLE("Tried to convert invalid color depth value.");
   }
   return wr::WrColorDepth::Color8;
 }
 
-static inline wr::WrColorRange ToWrColorRange(gfx::ColorRange aColorRange) {
-  switch (aColorRange) {
-    case gfx::ColorRange::LIMITED:
-      return wr::WrColorRange::Limited;
-    case gfx::ColorRange::FULL:
-      return wr::WrColorRange::Full;
-    default:
-      MOZ_ASSERT_UNREACHABLE("Tried to convert invalid color range value.");
-      return wr ::WrColorRange::Limited;
-  }
-}
-
 static inline wr::SyntheticItalics DegreesToSyntheticItalics(float aDegrees) {
   wr::SyntheticItalics synthetic_italics;
   synthetic_italics.angle =
       int16_t(std::min(std::max(aDegrees, -89.0f), 89.0f) * 256.0f);
   return synthetic_italics;
 }
 
 }  // namespace wr
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -92,18 +92,16 @@ type WrImageKey = ImageKey;
 /// cbindgen:field-names=[mNamespace, mHandle]
 pub type WrFontKey = FontKey;
 /// cbindgen:field-names=[mNamespace, mHandle]
 pub type WrFontInstanceKey = FontInstanceKey;
 /// cbindgen:field-names=[mNamespace, mHandle]
 type WrYuvColorSpace = YuvColorSpace;
 /// cbindgen:field-names=[mNamespace, mHandle]
 type WrColorDepth = ColorDepth;
-/// cbindgen:field-names=[mNamespace, mHandle]
-type WrColorRange = ColorRange;
 
 
 #[repr(C)]
 pub struct WrSpaceAndClip {
     space: WrSpatialId,
     clip: WrClipId,
 }
 
@@ -2553,17 +2551,16 @@ pub extern "C" fn wr_dp_push_yuv_planar_
                                               clip: LayoutRect,
                                               is_backface_visible: bool,
                                               parent: &WrSpaceAndClipChain,
                                               image_key_0: WrImageKey,
                                               image_key_1: WrImageKey,
                                               image_key_2: WrImageKey,
                                               color_depth: WrColorDepth,
                                               color_space: WrYuvColorSpace,
-                                              color_range: WrColorRange,
                                               image_rendering: ImageRendering) {
     debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     let space_and_clip = parent.to_webrender(state.pipeline_id);
 
     let prim_info = CommonItemProperties {
         clip_rect: clip,
         clip_id: space_and_clip.clip_id,
@@ -2574,32 +2571,30 @@ pub extern "C" fn wr_dp_push_yuv_planar_
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(&prim_info,
                          bounds,
                          YuvData::PlanarYCbCr(image_key_0, image_key_1, image_key_2),
                          color_depth,
                          color_space,
-                         color_range,
                          image_rendering);
 }
 
 /// Push a 2 planar NV12 image.
 #[no_mangle]
 pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
                                             bounds: LayoutRect,
                                             clip: LayoutRect,
                                             is_backface_visible: bool,
                                             parent: &WrSpaceAndClipChain,
                                             image_key_0: WrImageKey,
                                             image_key_1: WrImageKey,
                                             color_depth: WrColorDepth,
                                             color_space: WrYuvColorSpace,
-                                            color_range: WrColorRange,
                                             image_rendering: ImageRendering) {
     debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     let space_and_clip = parent.to_webrender(state.pipeline_id);
 
     let prim_info = CommonItemProperties {
         clip_rect: clip,
         clip_id: space_and_clip.clip_id,
@@ -2610,31 +2605,29 @@ pub extern "C" fn wr_dp_push_yuv_NV12_im
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(&prim_info,
                          bounds,
                          YuvData::NV12(image_key_0, image_key_1),
                          color_depth,
                          color_space,
-                         color_range,
                          image_rendering);
 }
 
 /// Push a yuv interleaved image.
 #[no_mangle]
 pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
                                                    bounds: LayoutRect,
                                                    clip: LayoutRect,
                                                    is_backface_visible: bool,
                                                    parent: &WrSpaceAndClipChain,
                                                    image_key_0: WrImageKey,
                                                    color_depth: WrColorDepth,
                                                    color_space: WrYuvColorSpace,
-                                                   color_range: WrColorRange,
                                                    image_rendering: ImageRendering) {
     debug_assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     let space_and_clip = parent.to_webrender(state.pipeline_id);
 
     let prim_info = CommonItemProperties {
         clip_rect: clip,
         clip_id: space_and_clip.clip_id,
@@ -2645,17 +2638,16 @@ pub extern "C" fn wr_dp_push_yuv_interle
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(&prim_info,
                          bounds,
                          YuvData::InterleavedYCbCr(image_key_0),
                          color_depth,
                          color_space,
-                         color_range,
                          image_rendering);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_text(state: &mut WrState,
                                   bounds: LayoutRect,
                                   clip: LayoutRect,
                                   is_backface_visible: bool,
--- a/gfx/wr/examples/yuv.rs
+++ b/gfx/wr/examples/yuv.rs
@@ -160,31 +160,29 @@ impl Example for App {
             space_and_clip,
         );
         builder.push_yuv_image(
             &info,
             bounds,
             YuvData::NV12(yuv_chanel1, yuv_chanel2),
             ColorDepth::Color8,
             YuvColorSpace::Rec601,
-            ColorRange::Limited,
             ImageRendering::Auto,
         );
 
         let info = CommonItemProperties::new(
             LayoutRect::new(LayoutPoint::new(300.0, 0.0), LayoutSize::new(100.0, 100.0)),
             space_and_clip,
         );
         builder.push_yuv_image(
             &info,
             bounds,
             YuvData::PlanarYCbCr(yuv_chanel1, yuv_chanel2_1, yuv_chanel3),
             ColorDepth::Color8,
             YuvColorSpace::Rec601,
-            ColorRange::Limited,
             ImageRendering::Auto,
         );
 
         builder.pop_stacking_context();
     }
 
     fn on_event(
         &mut self,
--- a/gfx/wr/webrender/src/batch.rs
+++ b/gfx/wr/webrender/src/batch.rs
@@ -1,14 +1,14 @@
 /* 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/. */
 
 use api::{AlphaType, ClipMode, ExternalImageType, ImageRendering};
-use api::{YuvColorSpace, YuvFormat, ColorDepth, ColorRange, PremultipliedColorF, RasterSpace};
+use api::{YuvColorSpace, YuvFormat, ColorDepth, PremultipliedColorF, RasterSpace};
 use api::units::*;
 use crate::clip::{ClipDataStore, ClipNodeFlags, ClipNodeRange, ClipItem, ClipStore, ClipNodeInstance};
 use crate::clip_scroll_tree::{ClipScrollTree, ROOT_SPATIAL_NODE_INDEX, SpatialNodeIndex, CoordinateSystemId};
 use crate::glyph_rasterizer::GlyphFormat;
 use crate::gpu_cache::{GpuBlockData, GpuCache, GpuCacheHandle, GpuCacheAddress};
 use crate::gpu_types::{BrushFlags, BrushInstance, PrimitiveHeaders, ZBufferId, ZBufferIdGenerator};
 use crate::gpu_types::{ClipMaskInstance, SplitCompositeInstance, SnapOffsets};
 use crate::gpu_types::{PrimitiveInstanceData, RasterizationSpace, GlyphInstance};
@@ -50,17 +50,17 @@ pub enum BrushBatchKind {
     Solid,
     Image(ImageBufferKind),
     Blend,
     MixBlend {
         task_id: RenderTaskId,
         source_id: RenderTaskId,
         backdrop_id: RenderTaskId,
     },
-    YuvImage(ImageBufferKind, YuvFormat, ColorDepth, YuvColorSpace, ColorRange),
+    YuvImage(ImageBufferKind, YuvFormat, ColorDepth, YuvColorSpace),
     RadialGradient,
     LinearGradient,
 }
 
 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
 pub enum BatchKind {
@@ -1892,17 +1892,16 @@ impl BatchBuilder {
                         .all(|&tid| buffer_kind == get_buffer_kind(tid))
                 );
 
                 let kind = BrushBatchKind::YuvImage(
                     buffer_kind,
                     yuv_image_data.format,
                     yuv_image_data.color_depth,
                     yuv_image_data.color_space,
-                    yuv_image_data.color_range,
                 );
 
                 let batch_params = BrushBatchParameters::shared(
                     kind,
                     textures,
                     [
                         uv_rect_addresses[0],
                         uv_rect_addresses[1],
--- a/gfx/wr/webrender/src/display_list_flattener.rs
+++ b/gfx/wr/webrender/src/display_list_flattener.rs
@@ -5,17 +5,17 @@
 use api::{AlphaType, BorderDetails, BorderDisplayItem, BuiltDisplayListIter};
 use api::{ClipId, ColorF, CommonItemProperties, ComplexClipRegion, RasterSpace};
 use api::{DisplayItem, DisplayItemRef, ExtendMode, ExternalScrollId};
 use api::{FilterOp, FilterPrimitive, FontInstanceKey, GlyphInstance, GlyphOptions, GradientStop};
 use api::{IframeDisplayItem, ImageKey, ImageRendering, ItemRange, ColorDepth};
 use api::{LineOrientation, LineStyle, NinePatchBorderSource, PipelineId};
 use api::{PropertyBinding, ReferenceFrame, ReferenceFrameKind, ScrollFrameDisplayItem, ScrollSensitivity};
 use api::{Shadow, SpaceAndClipInfo, SpatialId, StackingContext, StickyFrameDisplayItem};
-use api::{ClipMode, PrimitiveKeyKind, TransformStyle, YuvColorSpace, ColorRange, YuvData, TempFilterData};
+use api::{ClipMode, PrimitiveKeyKind, TransformStyle, YuvColorSpace, YuvData, TempFilterData};
 use api::units::*;
 use crate::clip::{ClipChainId, ClipRegion, ClipItemKey, ClipStore};
 use crate::clip_scroll_tree::{ROOT_SPATIAL_NODE_INDEX, ClipScrollTree, SpatialNodeIndex};
 use crate::frame_builder::{ChasePrimitive, FrameBuilder, FrameBuilderConfig};
 use crate::glyph_rasterizer::FontInstance;
 use crate::hit_test::{HitTestingItem, HitTestingScene};
 use crate::image::simplify_repeated_primitive;
 use crate::intern::Interner;
@@ -1012,17 +1012,16 @@ impl<'a> DisplayListFlattener<'a> {
                 );
 
                 self.add_yuv_image(
                     clip_and_scroll,
                     &layout,
                     info.yuv_data,
                     info.color_depth,
                     info.color_space,
-                    info.color_range,
                     info.image_rendering,
                 );
             }
             DisplayItem::Text(ref info) => {
                 let (layout, clip_and_scroll) = self.process_common_properties_with_bounds(
                     &info.common,
                     &info.bounds,
                     apply_pipeline_clip,
@@ -3015,17 +3014,16 @@ impl<'a> DisplayListFlattener<'a> {
 
     pub fn add_yuv_image(
         &mut self,
         clip_and_scroll: ScrollNodeAndClipChain,
         info: &LayoutPrimitiveInfo,
         yuv_data: YuvData,
         color_depth: ColorDepth,
         color_space: YuvColorSpace,
-        color_range: ColorRange,
         image_rendering: ImageRendering,
     ) {
         let format = yuv_data.get_format();
         let yuv_key = match yuv_data {
             YuvData::NV12(plane_0, plane_1) => [plane_0, plane_1, ImageKey::DUMMY],
             YuvData::PlanarYCbCr(plane_0, plane_1, plane_2) => [plane_0, plane_1, plane_2],
             YuvData::InterleavedYCbCr(plane_0) => [plane_0, ImageKey::DUMMY, ImageKey::DUMMY],
         };
@@ -3034,17 +3032,16 @@ impl<'a> DisplayListFlattener<'a> {
             clip_and_scroll,
             info,
             Vec::new(),
             YuvImage {
                 color_depth,
                 yuv_key,
                 format,
                 color_space,
-                color_range,
                 image_rendering,
             },
         );
     }
 
     pub fn add_primitive_instance_to_3d_root(&mut self, instance: PrimitiveInstance) {
         // find the 3D root and append to the children list
         for sc in self.sc_stack.iter_mut().rev() {
--- a/gfx/wr/webrender/src/prim_store/image.rs
+++ b/gfx/wr/webrender/src/prim_store/image.rs
@@ -1,16 +1,16 @@
 /* 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/. */
 
 use api::{
     AlphaType, ColorDepth, ColorF, ColorU,
     ImageKey as ApiImageKey, ImageRendering,
-    PremultipliedColorF, Shadow, YuvColorSpace, ColorRange, YuvFormat,
+    PremultipliedColorF, Shadow, YuvColorSpace, YuvFormat,
 };
 use api::units::*;
 use crate::display_list_flattener::{CreateShadow, IsVisible};
 use crate::frame_builder::FrameBuildingState;
 use crate::gpu_cache::{GpuCache, GpuDataRequest};
 use crate::intern::{Internable, InternDebug, Handle as InternHandle};
 use crate::internal_types::LayoutPrimitiveInfo;
 use crate::prim_store::{
@@ -365,17 +365,16 @@ impl IsVisible for Image {
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
 #[derive(Debug, Clone, Eq, MallocSizeOf, PartialEq, Hash)]
 pub struct YuvImage {
     pub color_depth: ColorDepth,
     pub yuv_key: [ApiImageKey; 3],
     pub format: YuvFormat,
     pub color_space: YuvColorSpace,
-    pub color_range: ColorRange,
     pub image_rendering: ImageRendering,
 }
 
 pub type YuvImageKey = PrimKey<YuvImage>;
 
 impl YuvImageKey {
     pub fn new(
         is_backface_visible: bool,
@@ -398,28 +397,26 @@ impl InternDebug for YuvImageKey {}
 #[cfg_attr(feature = "capture", derive(Serialize))]
 #[cfg_attr(feature = "replay", derive(Deserialize))]
 #[derive(MallocSizeOf)]
 pub struct YuvImageData {
     pub color_depth: ColorDepth,
     pub yuv_key: [ApiImageKey; 3],
     pub format: YuvFormat,
     pub color_space: YuvColorSpace,
-    pub color_range: ColorRange,
     pub image_rendering: ImageRendering,
 }
 
 impl From<YuvImage> for YuvImageData {
     fn from(image: YuvImage) -> Self {
         YuvImageData {
             color_depth: image.color_depth,
             yuv_key: image.yuv_key,
             format: image.format,
             color_space: image.color_space,
-            color_range: image.color_range,
             image_rendering: image.image_rendering,
         }
     }
 }
 
 impl YuvImageData {
     /// Update the GPU cache for a given primitive template. This may be called multiple
     /// times per frame, by each primitive reference that refers to this interned
--- a/gfx/wr/webrender_api/src/display_item.rs
+++ b/gfx/wr/webrender_api/src/display_item.rs
@@ -1048,35 +1048,27 @@ pub enum AlphaType {
 
 #[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize, PeekPoke)]
 pub struct YuvImageDisplayItem {
     pub common: CommonItemProperties,
     pub bounds: LayoutRect,
     pub yuv_data: YuvData,
     pub color_depth: ColorDepth,
     pub color_space: YuvColorSpace,
-    pub color_range: ColorRange,
     pub image_rendering: ImageRendering,
 }
 
 #[repr(u8)]
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, PeekPoke)]
 pub enum YuvColorSpace {
     Rec601 = 0,
     Rec709 = 1,
     Rec2020 = 2,
 }
 
-#[repr(u8)]
-#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize, PeekPoke)]
-pub enum ColorRange {
-    Limited = 0,
-    Full = 1,
-}
-
 #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize, PeekPoke)]
 pub enum YuvData {
     NV12(ImageKey, ImageKey), // (Y channel, CbCr interleaved channel)
     PlanarYCbCr(ImageKey, ImageKey, ImageKey), // (Y channel, Cb channel, Cr Channel)
     InterleavedYCbCr(ImageKey), // (YCbCr interleaved channel)
 }
 
 impl YuvData {
--- a/gfx/wr/webrender_api/src/display_list.rs
+++ b/gfx/wr/webrender_api/src/display_list.rs
@@ -1018,26 +1018,24 @@ impl DisplayListBuilder {
     /// Push a yuv image. All planar data in yuv image should use the same buffer type.
     pub fn push_yuv_image(
         &mut self,
         common: &di::CommonItemProperties,
         bounds: LayoutRect,
         yuv_data: di::YuvData,
         color_depth: ColorDepth,
         color_space: di::YuvColorSpace,
-        color_range: di::ColorRange,
         image_rendering: di::ImageRendering,
     ) {
         let item = di::DisplayItem::YuvImage(di::YuvImageDisplayItem {
             common: *common,
             bounds,
             yuv_data,
             color_depth,
             color_space,
-            color_range,
             image_rendering,
         });
         self.push_item(&item);
     }
 
     pub fn push_text(
         &mut self,
         common: &di::CommonItemProperties,
--- a/gfx/wr/wrench/src/yaml_frame_reader.rs
+++ b/gfx/wr/wrench/src/yaml_frame_reader.rs
@@ -1159,17 +1159,16 @@ impl YamlFrameReader {
         dl: &mut DisplayListBuilder,
         wrench: &mut Wrench,
         item: &Yaml,
         info: &mut CommonItemProperties,
     ) {
         // TODO(gw): Support other YUV color depth and spaces.
         let color_depth = ColorDepth::Color8;
         let color_space = YuvColorSpace::Rec709;
-        let color_range = ColorRange::Limited;
 
         let yuv_data = match item["format"].as_str().expect("no format supplied") {
             "planar" => {
                 let y_path = rsrc_path(&item["src-y"], &self.aux_dir);
                 let (y_key, _) = self.add_or_get_image(&y_path, None, wrench);
 
                 let u_path = rsrc_path(&item["src-u"], &self.aux_dir);
                 let (u_key, _) = self.add_or_get_image(&u_path, None, wrench);
@@ -1206,17 +1205,16 @@ impl YamlFrameReader {
         );
 
         dl.push_yuv_image(
             &info,
             bounds,
             yuv_data,
             color_depth,
             color_space,
-            color_range,
             ImageRendering::Auto,
         );
     }
 
     fn handle_image(
         &mut self,
         dl: &mut DisplayListBuilder,
         wrench: &mut Wrench,
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -1500,18 +1500,16 @@ class MediaPipelineReceiveVideo::Pipelin
       yuvData.mCbChannel = const_cast<uint8_t*>(i420->DataU());
       yuvData.mCrChannel = const_cast<uint8_t*>(i420->DataV());
       yuvData.mCbCrSize =
           IntSize((i420->width() + 1) >> 1, (i420->height() + 1) >> 1);
       yuvData.mPicX = 0;
       yuvData.mPicY = 0;
       yuvData.mPicSize = IntSize(i420->width(), i420->height());
       yuvData.mStereoMode = StereoMode::MONO;
-      // This isn't the best default.
-      yuvData.mYUVColorSpace = gfx::YUVColorSpace::BT601;
 
       if (!yuvImage->CopyData(yuvData)) {
         MOZ_ASSERT(false);
         return;
       }
 
       image = yuvImage.forget();
     }