WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
140477
RenderLayerCompositor: Strange comparison of opacity to boolean.
https://bugs.webkit.org/show_bug.cgi?id=140477
Summary
RenderLayerCompositor: Strange comparison of opacity to boolean.
Brent Fulgham
Reported
2015-01-14 16:23:47 PST
I receive the following warning when I build. Reviewing the line in question reveals that we are comparing a boolean (the return value of "ancestorBacking->graphicsLayer->drawsContents()") to the float returned by the style's opacity property. This seems very strange. At the very least, we should do some casting here to make it clear that this is intentional (if it is). if (newStyle.opacity() != ancestorBacking->graphicsLayer()->drawsContent()) return true; Where: opacity is a float drawsContent is a boolean.
Attachments
Patch
(1.56 KB, patch)
2015-01-15 14:56 PST
,
Brent Fulgham
simon.fraser
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Brent Fulgham
Comment 1
2015-01-14 16:28:12 PST
Based on
Bug 138448
, it looks like this was an intentional comparison, but I think a cast would make it clear that this is desired behavior.
Simon Fraser (smfr)
Comment 2
2015-01-14 16:35:57 PST
Agreed it's odd. Would be fine to clarify.
Brent Fulgham
Comment 3
2015-01-14 16:40:54 PST
I neglected to include the compiler error: 18>c:\projects\webkit\opensource\source\webcore\rendering\RenderLayerCompositor.cpp(888): warning C4805: '!=' : unsafe mix of type 'float' and type 'bool' in operation (..\rendering\RenderingAllInOne.cpp)
Brent Fulgham
Comment 4
2015-01-15 08:40:08 PST
This code is checking for non-zero opacity.
Brent Fulgham
Comment 5
2015-01-15 14:56:37 PST
Created
attachment 244716
[details]
Patch
Brent Fulgham
Comment 6
2015-01-15 18:18:37 PST
Committed
r178568
: <
http://trac.webkit.org/changeset/178568
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug