Closed Bug 1454581 Opened 7 years ago Closed 7 years ago

PerformanceObserver Paint eventTypes raises error "The expression cannot be converted to return the specified type"

Categories

(Core :: DOM: Core & HTML, defect, P3)

61 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1403027
Tracking Status
firefox60 --- affected
firefox61 --- affected

People

(Reporter: tarunlalwani, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Steps to reproduce:

Version used: 60.0b12 (64-bit)

Run the below code

const observer = new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    if (typeof(Storage) !== 'undefined') {

      if (entry.name === 'first-paint') {
        localStorage.setItem(rumMetrics.RUM_METRICS_FIRST_PAINT, entry.startTime);
      }
      else if (entry.name === 'first-contentful-paint') {
        localStorage.setItem(rumMetrics.RUM_METRICS_FIRST_CONTENTFUL_PAINT, entry.startTime);
      }
    }
    else {
      console.log('local storage is not supported here. RUM metrics won\'t be recorded.');
    }
  }
});

observer.observe({ entryTypes: ['paint'] });


Actual results:

TypeError: The expression cannot be converted to return the specified type. (line: observer.observe({ entryTypes: ['paint'] });)



Expected results:

No error and performance observer callback should be called
I tested this issue on Mac OS X 10.12 with FF Nightly 61.0a1(2018-04-19) and I can reproduce this behavior.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM
Ever confirmed: true
Product: Firefox → Core
Version: 60 Branch → 61 Branch
Flags: needinfo?(hikezoe)
Priority: -- → P3
I thought the old behavior has been fixed by bug 1403027.  The old behavior means that observe() throws when it takes unsupported/unimplemented types.

Oh?  The patch hasn't landed yet!?
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(hikezoe)
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: