[Webkit-unassigned] [Bug 55202] Add missing length units to CSS unit category function

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 28 21:51:50 PST 2011


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





--- Comment #7 from Ojan Vafai <ojan at chromium.org>  2011-02-28 21:51:50 PST ---
(In reply to comment #6)
> Yes - my newfound understanding of the current code is that it is correct, but confusing.
> 
> (aside: I don't think you want an assert, since it is legal to call unitCategory with these types, and the intent is that they come back UOther).

It's not really legal though since the only two callers of this function assert that it returns something other than a UOther. So to me it's not unlike doing the following (which is in many places in WebKit):

ASSERT(foo);
// foo shouldn't be null here, but early-return to make sure we don't crash if it is.
if (!foo)
  return;

I guess I find it weird to have a default case for the switch but then have a number of cases that do the same thing. Why have a default at all?

-- 
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