[Webkit-unassigned] [Bug 55111] getComputedStyle() returns unitless values for some properties that require units

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 26 15:42:40 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=55111


Ojan Vafai <ojan at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #90103|review?, commit-queue?      |review+, commit-queue-
               Flag|                            |




--- Comment #2 from Ojan Vafai <ojan at chromium.org>  2011-04-26 15:42:40 PST ---
(From update of attachment 90103)
View in context: https://bugs.webkit.org/attachment.cgi?id=90103&action=review

> LayoutTests/fast/css/getComputedStyle/getComputedStyle-length-unit.html:93
> +        for (var propertyName in propertiesToCheck) {
> +            testElement.style[propertyName] = propertiesToCheck[propertyName];
> +        }
> +        
> +        function testPropertyUnit(className, propertyName)
> +        {
> +            if (testElement.className != className)
> +                testElement.className = className;
> +            var computedStyled = document.defaultView.getComputedStyle(testElement);
> +            var results = /\d+([a-z%]+)/.exec(computedStyled[propertyName]);
> +            return results ? results[1] : '';
> +        }
> +
> +        for (var propertyName in propertiesToCheck) {
> +            shouldBe("testPropertyUnit('visible', '" + propertyName + "')", "'px'");
> +        }
> +        for (var propertyName in propertiesToCheck) {
> +            shouldBe("testPropertyUnit('hidden', '" + propertyName + "')", "'px'");
> +        }
> +
> +        for (var propertyName in propertiesToCheck) {
> +            testElement.style[propertyName] = '';
> +        }

nit: although we don't enforce style for tests, webkit style is to not include curly braces for one-line if/else/for/while statements.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list