[webkit-reviews] review granted: [Bug 114469] Add contentAnchor to WKView : [Attachment 197895] Reset layer origin on next setFrameSize with updates enabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 12 15:40:10 PDT 2013


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Gavin Barraclough
<barraclough at apple.com>'s request for review:
Bug 114469: Add contentAnchor to WKView
https://bugs.webkit.org/show_bug.cgi?id=114469

Attachment 197895: Reset layer origin on next setFrameSize with updates enabled
https://bugs.webkit.org/attachment.cgi?id=197895&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=197895&action=review


> Source/WebKit2/UIProcess/API/mac/WKView.mm:98
> +#define WKContentAnchorRight(x) (!!((x) & WKContentAnchorTopRight))
> +#define WKContentAnchorBottom(x) (!!((x) & WKContentAnchorBottomLeft))

Wouldn't inline functions be preferable in C++?

bool WKContentAnchorRight(unsigned x) { return x & WKContentAnchorTopRight; }

But WKContentAnchor* are not bit masks, so this is vulnerable to someone
re-ordering WKContentAnchor flags. I think an explicit	x ==
WKContentAnchorTopRight || x == WKContentAnchorBottomRight would be better.


More information about the webkit-reviews mailing list