Bug 113230

Summary: CSS properties with <time> parameters may not use unitless 0
Product: WebKit Reporter: Robert McKee <robertjunk>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, ericwilligers
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=203484

Robert McKee
Reported 2013-03-25 12:11:21 PDT
According to the CSS 3 specification, you may not use a unitless 0 for parameters that take a <time>, and the current webkit engine incorrectly parses unitless 0 parameters. Running the following script: <script> $(function () { $('body').append('<div>').attr('id', 'results'); var tests = ["unset - garbage 1s 1s 1s", "0", "1s", "0 0", "0 1s", "1s 0", "1s 1s", "0 0 0", "0 0 1s", "0 1s 0", "0 1s 1s", "1s 0 0", "1s 0 1s", "1s 1s 0", "1s 1s 1s"]; tests.forEach(function(test) { var div = $('<div>').css('animation-duration', '2s').css('animation-delay', '3s').css('animation-iteration-count', 4).css("animation", test); $('#results').append("<br />Test: " + test + " "); if (div.css('animation-duration') == '2s') { $('#results').append('INVALID<br/>'); } else { $('#results').append('VALID<br/>'); var styleProps = ["animation", "animation-duration", "animation-delay", "animation-iteration-count"]; styleProps.forEach(function(prop) { $('#results').append(prop + ':' + div.css(prop) + '<br />'); }); } }); }); </script> Should yield the following: Test: unset - garbage 1s 1s 1s INVALID Test: 0 VALID animation:0s ease 0s normal none 0 none animation-duration:0s animation-delay:0s animation-iteration-count:0 Test: 1s VALID animation:1s ease 0s normal none 1 none animation-duration:1s animation-delay:0s animation-iteration-count:1 Test: 0 0 INVALID Test: 0 1s VALID animation:1s ease 0s normal none 0 none animation-duration:1s animation-delay:0s animation-iteration-count:0 Test: 1s 0 VALID animation:1s ease 0s normal none 0 none animation-duration:1s animation-delay:0s animation-iteration-count:0 Test: 1s 1s VALID animation:1s ease 1s normal none 1 none animation-duration:1s animation-delay:1s animation-iteration-count:1 Test: 0 0 0 INVALID Test: 0 0 1s INVALID Test: 0 1s 0 INVALID Test: 0 1s 1s VALID animation:1s ease 1s normal none 0 none animation-duration:1s animation-delay:1s animation-iteration-count:0 Test: 1s 0 0 INVALID Test: 1s 0 1s VALID animation:1s ease 1s normal none 0 none animation-duration:1s animation-delay:1s animation-iteration-count:0 Test: 1s 1s 0 VALID animation:1s ease 1s normal none 0 none animation-duration:1s animation-delay:1s animation-iteration-count:0 Test: 1s 1s 1s INVALID However, it is giving the following result: Test: unset - garbage 1s 1s 1s INVALID Test: 0 VALID animation:0ms animation-duration:0ms animation-delay:initial animation-iteration-count:initial Test: 1s VALID animation:1s animation-duration:1s animation-delay:initial animation-iteration-count:initial Test: 0 0 VALID animation:0ms 0ms animation-duration:0ms animation-delay:0ms animation-iteration-count:initial Test: 0 1s VALID animation:0ms 1s animation-duration:0ms animation-delay:1s animation-iteration-count:initial Test: 1s 0 VALID animation:1s 0ms animation-duration:1s animation-delay:0ms animation-iteration-count:initial Test: 1s 1s VALID animation:1s 1s animation-duration:1s animation-delay:1s animation-iteration-count:initial Test: 0 0 0 VALID animation:0ms 0ms 0 animation-duration:0ms animation-delay:0ms animation-iteration-count:0 Test: 0 0 1s INVALID Test: 0 1s 0 VALID animation:0ms 1s 0 animation-duration:0ms animation-delay:1s animation-iteration-count:0 Test: 0 1s 1s INVALID Test: 1s 0 0 VALID animation:1s 0ms 0 animation-duration:1s animation-delay:0ms animation-iteration-count:0 Test: 1s 0 1s INVALID Test: 1s 1s 0 VALID animation:1s 1s 0 animation-duration:1s animation-delay:1s animation-iteration-count:0 Test: 1s 1s 1s INVALID
Attachments
Brent Fulgham
Comment 2 2022-07-13 14:28:00 PDT
Safari 15+ handles these cases properly.
Note You need to log in before you can comment on or make changes to this bug.