Bug 87505 - Add a != operator to ViewportArguments
Summary: Add a != operator to ViewportArguments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jacky Jiang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-25 08:20 PDT by Jacky Jiang
Modified: 2012-06-20 16:03 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.79 KB, patch)
2012-06-20 12:58 PDT, Jacky Jiang
no flags Details | Formatted Diff | Diff
Patch (4.55 KB, patch)
2012-06-20 13:27 PDT, Jacky Jiang
tonikitoo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>