[Webkit-unassigned] [Bug 5146] max-height/max-width not resizing images with correct aspect ratio

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Mon Feb 20 10:05:04 PST 2006


------- Comment #26 from darin at apple.com  2006-02-20 10:05 PDT -------
(In reply to comment #24)
> -    case Percent: {
> +    case Percent: 
>          const int cw = containingBlockWidth();
>          if (cw > 0)
>              return calcContentBoxWidth(w.minWidth(cw));
> -    }
> -    // fall through
> +    //fall through
>       default:

It's true that we don't always use braces for case statements.

But in this case, the braces are needed to scope the "cw" variable. If you
don't have braces, jumping to the default case puts you in a place where "cw"
is in scope, but not initialized. I believe gcc gives a warning about this.

So the braces are there for a reason and should not be removed. But it's true
that many case statements won't have braces.

Also, I don't see the point in removing the space after the "//" in the
comment. We always use a space there although it's not called out in the

Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list