Bug 87505

Summary: Add a != operator to ViewportArguments
Product: WebKit Reporter: Jacky Jiang <jkjiang>
Component: DOMAssignee: Jacky Jiang <jkjiang>
Status: RESOLVED FIXED    
Severity: Normal CC: jkjiang, kenneth, kpiascik, rwlbuis, tonikitoo, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch tonikitoo: review+

Description Jacky Jiang 2012-05-25 08:20:37 PDT
As suggested on bug 87438, we should add a != operator to ViewportArguments.
Hopefully this is right thing to do. Open for discussions in case there are different ideas.
Comment 1 Kenneth Rohde Christiansen 2012-05-26 01:38:57 PDT
You should explain better why that it needed. I actually believe that we used to have that.
Comment 2 Antonio Gomes 2012-05-26 04:20:46 PDT
I think it is only about convenience.

in blackberry/ we have 3 or 4 cases of

if (!(m_viewportArgument == DefaultViewportArguments)) {
...
}
Comment 3 Antonio Gomes 2012-06-17 19:15:58 PDT
Any update here? Looks straightforward and useful...
Comment 4 Jacky Jiang 2012-06-17 20:21:46 PDT
(In reply to comment #3)
> Any update here? Looks straightforward and useful...
I will update this. Assign to myself.
Comment 5 Jacky Jiang 2012-06-20 12:58:13 PDT
Created attachment 148632 [details]
Patch
Comment 6 Konrad Piascik 2012-06-20 13:04:37 PDT
Comment on attachment 148632 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=148632&action=review

> Source/WebCore/dom/ViewportArguments.h:111
> +    bool operator!=(const ViewportArguments& other) const

You don't want this duplicated code.  What you should do is this:
return !(this == other);
Comment 7 Jacky Jiang 2012-06-20 13:09:00 PDT
Comment on attachment 148632 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=148632&action=review

>> Source/WebCore/dom/ViewportArguments.h:111
>> +    bool operator!=(const ViewportArguments& other) const
> 
> You don't want this duplicated code.  What you should do is this:
> return !(this == other);

Thanks, should be this !(*this == other) if we don't want duplicate this code I think.
Comment 8 Jacky Jiang 2012-06-20 13:27:34 PDT
Created attachment 148644 [details]
Patch
Comment 9 Jacky Jiang 2012-06-20 16:02:46 PDT
Comment on attachment 148644 [details]
Patch

Committed r120874: <http://trac.webkit.org/changeset/120874>