blob: 8e446d1c994b611ac5b3b7dc4264b2d49987bf90 [file] [log] [blame]
Test the behavior of CSSStyleDeclaration.setProperty()
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
* Not enough parameters
PASS div.style.setProperty() threw exception TypeError: Not enough arguments.
PASS div.style.setProperty('color') threw exception TypeError: Not enough arguments.
* Should treat null as empty string for 'value' parameter
PASS div.style.setProperty('color', null) did not throw exception.
PASS div.style.getPropertyValue('color') is ""
PASS div.style.getPropertyPriority('color') is ""
* Should treat null as empty string for 'priority' parameter
PASS div.style.setProperty('background-color', 'green', null) did not throw exception.
PASS div.style.getPropertyValue('background-color') is "green"
PASS div.style.getPropertyPriority('background-color') is ""
* Last parameter should do a case-insensitive match to 'important'
PASS div.style.setProperty('border-left-color', 'green', 'important') did not throw exception.
PASS div.style.getPropertyValue('border-left-color') is "green"
PASS div.style.getPropertyPriority('border-left-color') is "important"
PASS div.style.setProperty('border-right-color', 'green', 'IMPORTANT') did not throw exception.
PASS div.style.getPropertyValue('border-right-color') is "green"
PASS div.style.getPropertyPriority('border-right-color') is "important"
* Invalid 'priority' value, should abort
PASS div.style.setProperty('border-top-color', 'red', 'invalid') did not throw exception.
PASS div.style.getPropertyValue('border-top-color') is ""
PASS div.style.getPropertyPriority('border-top-color') is ""
PASS div.style.setProperty('border-top-color', 'red', 'important invalid') did not throw exception.
PASS div.style.getPropertyValue('border-top-color') is ""
PASS div.style.getPropertyPriority('border-top-color') is ""
PASS div.style.setProperty('border-top-color', 'red', '!important') did not throw exception.
PASS div.style.getPropertyValue('border-top-color') is ""
PASS div.style.getPropertyPriority('border-top-color') is ""
PASS successfullyParsed is true
TEST COMPLETE