Persona is no longer an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 655478 - CSSStyleDeclaration.setProperty shouldn't require the third parameter to be set
: CSSStyleDeclaration.setProperty shouldn't require the third parameter to be set
Product: Core
Classification: Components
Component: DOM: CSS Object Model (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla13
Assigned To: Aryeh Gregor (:ayg) (working until November 1)
Depends on:
  Show dependency treegraph
Reported: 2011-05-07 07:02 PDT by Rainer Zufall
Modified: 2012-02-17 05:36 PST (History)
2 users (show)
dao+bmo: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (2.94 KB, patch)
2012-02-15 10:35 PST, Aryeh Gregor (:ayg) (working until November 1)
bzbarsky: review+
Details | Diff | Splinter Review
Patch v2 (2.47 KB, patch)
2012-02-15 13:32 PST, Aryeh Gregor (:ayg) (working until November 1)
ayg: review+
Details | Diff | Splinter Review

Description Rainer Zufall 2011-05-07 07:02:19 PDT
User-Agent:       Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.04 Chromium/11.0.696.57 Chrome/11.0.696.57 Safari/534.24
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

I wrote a user script that uses the method setProperty on a CSSStyleDeclaration object, but only with the first two parameters, leaving the third out.

Reproducible: Always

Steps to Reproduce:
1. Install this script in Greasemonkey
2. Navigate to or in your browser

Actual Results:  
No searchform as expected appeared and the error console said "Not enough arguments [nsIDOMCSSStyleDeclaration.setProperty]", referring to line 19, where setProperty is used.

Expected Results:  
It should have given the style the default priority and added "float:right" as style, and then (obviously) added the form to the DOM.

Please note that the script works just fine in Google Chrome, where it smoothly adds the search form, without even bothering about the missing third parameter in the console.
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2011-05-07 10:53:23 PDT
Chrome treats all parameters to all DOM methods as optional, whether the spec says to do that or not.

In DOM 2 CSS (which is what we implement), the third parameter is required.

In the proposed CSSOM, the third parameter is optional, but that proposal is in very early stages and I'm not sure we want to be implementing it yet.
Comment 2 Aryeh Gregor (:ayg) (working until November 1) 2012-02-15 10:34:08 PST

data:text/html,<!doctype html>
<script>"width", "5px")

In mozilla-central, this throws.  In IE10 Developer Preview, Chrome 18 dev, and Opera Next 12.00 alpha, it succeeds.  This is useful behavior, I think.
Comment 3 Aryeh Gregor (:ayg) (working until November 1) 2012-02-15 10:35:23 PST
Created attachment 597466 [details] [diff] [review]
Patch v1

For testing, I just changed one of the existing setProperty()s in test_priority_preservation.html to omit the third argument, leaving the others intact.
Comment 4 Mozilla RelEng Bot 2012-02-15 10:40:02 PST
Autoland Patchset:
	Patches: 597466
	Branch: mozilla-central => try
Try run started, revision e5363e1140b7. To cancel or monitor the job, see:
Comment 5 Boris Zbarsky [:bz] (still a bit busy) 2012-02-15 11:30:25 PST
Comment on attachment 597466 [details] [diff] [review]
Patch v1

You actually don't need to change the IID, because the C++ side is completely binary-compatible.

r=me with that removed
Comment 6 Aryeh Gregor (:ayg) (working until November 1) 2012-02-15 13:32:17 PST
Created attachment 597541 [details] [diff] [review]
Patch v2
Comment 7 Mozilla RelEng Bot 2012-02-15 17:31:07 PST
Try run for e5363e1140b7 is complete.
Detailed breakdown of the results available here:
Results (out of 210 total builds):
    success: 174
    warnings: 22
    failure: 14
Builds (or logs if builds failed) available at:
Comment 9 Ed Morley [:emorley] 2012-02-17 05:36:43 PST

Note You need to log in before you can comment on or make changes to this bug.