Bug 117216

Summary: [GTK] Make precedence of logical operators explicit
Product: WebKit Reporter: Alberto Garcia <berto>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: commit-queue, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch none

Description Alberto Garcia 2013-06-04 16:27:47 PDT
There's a couple of cases where we're mixing && and || in the same
expression without using parentheses.

In particular ChromeClient::contentsSizeChanged() has this:

   if (gtk_widget_get_realized(widget)
      && (requisition.height != size.height())
      || (requisition.width != size.width()))

Due to the operator precedence rules, this means

   if ((A && B) || C)

rather than

   if (A && (B || C))

which is what we want.

AcceleratedCompositingContext::renderLayersToWindow() has a similar
case. If I'm not wrong here the parentheses are not really necessary
but I'd suggest using them as well to make the precedence explicit.
Comment 1 Alberto Garcia 2013-06-04 16:33:28 PDT
Created attachment 203739 [details]
Comment 2 WebKit Commit Bot 2013-06-04 21:38:41 PDT
Comment on attachment 203739 [details]

Clearing flags on attachment: 203739

Committed r151198: <http://trac.webkit.org/changeset/151198>
Comment 3 WebKit Commit Bot 2013-06-04 21:38:43 PDT
All reviewed patches have been landed.  Closing bug.