Issue #2053 - Part 4a: Align IsPerformanceTimingAttribute to user-timing spec

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1772417
This commit is contained in:
FranklinDM 2023-04-06 21:06:47 +08:00 committed by roytam1
commit 4fc9cde7c1
5 changed files with 32 additions and 26 deletions

View file

@ -52,7 +52,8 @@ already_AddRefed<PerformanceMark> PerformanceMark::Constructor(
return nullptr;
}
if (performance->IsPerformanceTimingAttribute(aMarkName)) {
if (performance->IsGlobalObjectWindow() &&
performance->IsPerformanceTimingAttribute(aMarkName)) {
aRv.ThrowTypeError<MSG_PMO_INVALID_TIMING_ATTR>();
return nullptr;
}