Summary: | Reduce code duplication in Element::setAttribute methods | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Klein <adamk> | ||||
Component: | New Bugs | Assignee: | Adam Klein <adamk> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | darin, ojan, rniwa, webkit.review.bot | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Adam Klein
2011-12-13 11:12:22 PST
Created attachment 119046 [details]
Patch
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 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 on attachment 119046 [details]
Patch
Thanks for the clarification. Makes sense to me.
Comment on attachment 119046 [details] Patch Clearing flags on attachment: 119046 Committed r102695: <http://trac.webkit.org/changeset/102695> All reviewed patches have been landed. Closing bug. |