New issue
Advanced search Search tips

Issue 641353 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

Incorrect value of "this" binding in ResizeObservers' callback

Reported by que....@gmail.com, Aug 26 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.0 Safari/537.36

Steps to reproduce the problem:
1. Execute following code:

(function () {
    'use strict';

    let observer = new ResizeObserver(function (entries, instance) {
        console.log(this, this === observer);
    });

    observer.observe(document.body); 
})();

What is the expected behavior?
According to the spec (https://wicg.github.io/ResizeObserver/#api) ResizeObserver is modeled after MutationObserver and IntersectionObserver API's in which
"this" binding of a callback function references the observer instance that it was invoked by.

What went wrong?
Value of "this" binding is undefined.

Did this work before? No 

Chrome version: 54.0.2840.0  Channel: canary
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0
 
Components: Blink>JavaScript
Components: -Blink>JavaScript Blink>DOM
Labels: M-55
Status: Untriaged (was: Unconfirmed)
Considering this as a Feature request and marking it as untriaged.

Comment 4 by atotic@chromium.org, Aug 31 2016

Owner: atotic@chromium.org
Status: Assigned (was: Untriaged)
Status: Fixed (was: Assigned)

Sign in to add a comment