[Bug 23066] New: Opinions wanted: preferred behavior of setProperty

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23066

            Bug ID: 23066
           Summary: Opinions wanted: preferred behavior of setProperty
    Classification: Unclassified
           Product: CSS
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: CSSOM
          Assignee: simonp@opera.com
          Reporter: simonp@opera.com
        QA Contact: public-css-bugzilla@w3.org

It seems that different people have different opinion about what setProperty
should do when the property is already specified, and in particular if the
existing property has its important flag set.

There are two axes of cases: third argument omitted/""/"important" and property
not present/present with important unset/present with important set. That gives
us the following cases to consider (using 'color' as example):

1. setProperty("color", "blue") and color is not present.
2. setProperty("color", "blue", "") and color is not present.
3. setProperty("color", "blue", "important") and color is not present.
4. setProperty("color", "blue") and color is present with important flag unset.
5. setProperty("color", "blue", "") and color is present with important flag
unset.
6. setProperty("color", "blue", "important") and color is present with
important flag unset.
7. setProperty("color", "blue") and color is present with important flag set.
8. setProperty("color", "blue", "") and color is present with important flag
set.
9. setProperty("color", "blue", "important") and color is present with
important flag set.

There are three behaviors on the table for how to handle these. For most cases
the result is identical:

A, B, C:
(1) append a new declaration with the given value and important flag unset.
(2) append a new declaration with the given value and important flag unset.
(3) append a new declaration with the given value and important flag set.
(4) update the value, leave the important flag unset.
(5) update the value, leave the important flag unset.
(6) updates the value and sets the important flag.    
(7) ???
(8) ???
(9) updates the value, leaves the important flag set.

For cases (7) and (8), the proposed behaviors are:

A:
(7) no-op
(8) no-op

B.
(7) updates the value, unsets the important flag.
(8) updates the value, unsets the important flag.

C:
(7) updates the value, leaves the important flag set.
(8) updates the value, unsets the important flag.

The status in browsers and the spec is as follows:

* IE/WebKit/Blink implement A.
* Gecko/Presto implement B. (Originally Gecko implemented A.)
* The spec had B until recently but changed to C, because there was a use case
for it [1] and it was argued to be saner behavior than B [2].

bz argues [3] that A is preferable since he thinks the mental model if
setProperty should be "append a declaration" and let it have the same behavior
as it would have declaratively.

Tab argues that C is preferable since the author just wants to change the value
and usually doesn't care about the priority, especially not when omitting the
priority argument.

I'd like to get some more opinions on this issue, especially from relevant
developers from non-Gecko browsers.

For context, see this thread
http://lists.w3.org/Archives/Public/www-style/2013Aug/thread.html#msg134

[1] http://lists.w3.org/Archives/Public/www-style/2013Aug/0168.html
[2] http://lists.w3.org/Archives/Public/www-style/2013Aug/0240.html
[3] http://lists.w3.org/Archives/Public/www-style/2013Aug/0431.html
[4] http://lists.w3.org/Archives/Public/www-style/2013Aug/0433.html

(Note that I'm not asking how to address the use case in that thread, but what
setProperty should do. When we have that established we can revisit the use
case and see if and how it should be addressed.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 26 August 2013 13:18:47 UTC