Bug 74425 - Reduce code duplication in Element::setAttribute methods
Summary: Reduce code duplication in Element::setAttribute methods
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adam Klein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 11:12 PST by Adam Klein
Modified: 2011-12-13 12:41 PST (History)
4 users (show)

See Also:


Attachments
Patch (4.55 KB, patch)
2011-12-13 11:15 PST, Adam Klein
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Klein 2011-12-13 11:12:22 PST
Reduce code duplication in Element::setAttribute methods
Comment 1 Adam Klein 2011-12-13 11:15:18 PST
Created attachment 119046 [details]
Patch
Comment 2 Ryosuke Niwa 2011-12-13 11:24:08 PST
Comment on attachment 119046 [details]
Patch

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

> Source/WebCore/dom/Element.cpp:-664
> -    else if (old && !value.isNull()) {

The other one doesn't check !value.isNull(). Why is that okay?
Comment 3 Adam Klein 2011-12-13 11:32:52 PST
Comment on attachment 119046 [details]
Patch

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

>> Source/WebCore/dom/Element.cpp:-664
>> -    else if (old && !value.isNull()) {
> 
> The other one doesn't check !value.isNull(). Why is that okay?

The first branch's test is "old && value.isNull()", so "else if (old)" is equivalent to "else if (old && !value.isNull())". The one un-handled case here is "!old && value.isNull()", which is a no-op.
Comment 4 Ryosuke Niwa 2011-12-13 11:35:55 PST
Comment on attachment 119046 [details]
Patch

Thanks for the clarification. Makes sense to me.
Comment 5 WebKit Review Bot 2011-12-13 12:41:07 PST
Comment on attachment 119046 [details]
Patch

Clearing flags on attachment: 119046

Committed r102695: <http://trac.webkit.org/changeset/102695>
Comment 6 WebKit Review Bot 2011-12-13 12:41:12 PST
All reviewed patches have been landed.  Closing bug.