Closed Bug 800282 Opened 12 years ago Closed 12 years ago

InvalidAccessError when setting itemValue on an element with on itemprop attribute

Categories

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

16 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jacobfogg, Unassigned)

Details

Attachments

(1 file)

307 bytes, text/html
Details
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
Attached file testcase
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
Closed: 12 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
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: