diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs
index b79393a7863..d785d0b99fa 100644
--- a/components/script/dom/webglframebuffer.rs
+++ b/components/script/dom/webglframebuffer.rs
@@ -274,7 +274,9 @@ impl WebGLFramebuffer {
let rb_id = match rb {
Some(rb) => {
- rb.attach(self)?;
+ if !rb.ever_bound() {
+ return Err(WebGLError::InvalidOperation);
+ }
*binding.borrow_mut() = Some(WebGLFramebufferAttachment::Renderbuffer(Dom::from_ref(rb)));
Some(rb.id())
}
@@ -305,16 +307,7 @@ impl WebGLFramebuffer {
binding: &DomRefCell