InvalidAccessError when setting itemValue on an element with on itemprop attribute

RESOLVED INVALID

Status

()

Core
DOM
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: Jacob Fogg, Unassigned)

Tracking

16 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

307 bytes, text/html
Details
(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11

Steps to reproduce:

A simple Javascript command:

var tmpLi = document.createElement('li');
tmpLi.itemValue = 11;

Here is an example of how to reproduce it:
http://fiddle.jshell.net/T3Ctg/1/show/


Actual results:

Threw a Javascript error:

InvalidAccessError: A parameter or an operation is not supported by the underlying object

and caused Javascript execution to stop 


Expected results:

Should have assigned the value of 11 to the attribute "itemValue" for the li.

From talking in the #firefox IRC room, it was discussed that this may have been caused between the builds:
 last good: a7a905fd70d5
 first bad: f56e2197d9cd

Comment 1

5 years ago
Created attachment 670289 [details]
testcase

Comment 2

5 years ago
STR:
 1. Start a clean profile
 2. hit ctrl + shift + J
 2. Load the testcase

Expected result:
The page should load cleanly

Actual result:
Error: InvalidAccessError: A parameter or an operation is not supported by the underlying object
Source File: https://bug800282.bugzilla.mozilla.org/attachment.cgi?id=670289
Line: 8


Nightly:
Last good: 2012-06-05
First bad: 2012-06-06

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a7a905fd70d5&tochange=6338a8988917

Inbound:
Last good: 2012-06-04
First bad: 2012-06-05

http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=778ba119ded6&tochange=f56e2197d9cd


Intersection:
Last good: a7a905fd70d5
First bad: f56e2197d9cd

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a7a905fd70d5&tochange=f56e2197d9cd
Assignee: nobody → general
Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine
Ever confirmed: true
Product: Firefox → Core
This isn't an arbitrary attribute.  It's a very particular attribute.  It's an attribute defined in the microdata API, which landed during your regression range.

And the spec for what happens when setting .itemValue is at http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#dom-itemvalue and says:

  If the element has no itemprop attribute

    The attribute must return null on getting and must throw an InvalidAccessError
    exception on setting.

which is what happens in your attached testcase.  No itemprop attribute means we throw an InvalidAccessError.
Assignee: general → nobody
Component: JavaScript Engine → DOM
Marking invalid, but please do reopen if there's something I missed here.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
Summary: InvalidAccessError when assigning an arbitrary attribute to an li element → InvalidAccessError when setting itemValue on an element with on itemprop attribute
You need to log in before you can comment on or make changes to this bug.