Changeset 161850 in webkit
- Timestamp:
- Jan 12, 2014 6:27:42 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161848 r161850 1 2014-01-12 Darin Adler <darin@apple.com> 2 3 Add type checking to isEqual methods 4 https://bugs.webkit.org/show_bug.cgi?id=126862 5 6 Reviewed by Anders Carlsson. 7 8 * page/ios/WebEventRegion.mm: 9 (-[WebEventRegion isEqual:]): Add type checking on the argument. 10 Add a FIXME about the lack of a hash method override. Formatted to match 11 the usual WebKit coding style. 12 1 13 2014-01-12 Anders Carlsson <andersca@apple.com> 2 14 -
trunk/Source/WebCore/page/ios/WebEventRegion.mm
r161806 r161850 67 67 } 68 68 69 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary, 70 // since two equal objects could have different hashes. 69 71 - (BOOL)isEqual:(id)other 70 72 { 71 return CGPointEqualToPoint(p1, ((WebEventRegion *)other)->p1) && 72 CGPointEqualToPoint(p2, ((WebEventRegion *)other)->p2) && 73 CGPointEqualToPoint(p3, ((WebEventRegion *)other)->p3) && 74 CGPointEqualToPoint(p4, ((WebEventRegion *)other)->p4); 73 if (![other isKindOfClass:[WebEventRegion class]]) 74 return NO; 75 return CGPointEqualToPoint(p1, ((WebEventRegion *)other)->p1) 76 && CGPointEqualToPoint(p2, ((WebEventRegion *)other)->p2) 77 && CGPointEqualToPoint(p3, ((WebEventRegion *)other)->p3) 78 && CGPointEqualToPoint(p4, ((WebEventRegion *)other)->p4); 75 79 } 76 80 -
trunk/Source/WebKit/ios/ChangeLog
r161468 r161850 1 2014-01-12 Darin Adler <darin@apple.com> 2 3 Add type checking to isEqual methods 4 https://bugs.webkit.org/show_bug.cgi?id=126862 5 6 Reviewed by Anders Carlsson. 7 8 * WebCoreSupport/WebVisiblePosition.mm: 9 (-[WebVisiblePosition isEqual:]): Add type checking on the argument. 10 Add a FIXME about the lack of a hash method override. Simplified by 11 removing the unneeded local variables. 12 1 13 2014-01-02 Andy Estes <aestes@apple.com> 2 14 -
trunk/Source/WebKit/ios/WebCoreSupport/WebVisiblePosition.mm
r161185 r161850 88 88 } 89 89 90 - (BOOL)isEqual:(WebVisiblePosition *)other 91 { 92 VisiblePosition myVP = [self _visiblePosition]; 93 VisiblePosition otherVP = [other _visiblePosition]; 94 return (myVP == otherVP); 90 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary, 91 // since two equal objects could have different hashes. 92 - (BOOL)isEqual:(id)other 93 { 94 if (![other isKindOfClass:[WebVisiblePosition class]]) 95 return NO; 96 return [self _visiblePosition] == [(WebVisiblePosition *)other _visiblePosition]; 95 97 } 96 98 -
trunk/Source/WebKit/mac/ChangeLog
r161796 r161850 1 2014-01-12 Darin Adler <darin@apple.com> 2 3 Add type checking to isEqual methods 4 https://bugs.webkit.org/show_bug.cgi?id=126862 5 6 Reviewed by Anders Carlsson. 7 8 * WebCoreSupport/WebSecurityOrigin.mm: 9 (-[WebSecurityOrigin isEqual:]): Added a FIXME about the lack of a hash method 10 override. Tweaked formatting. 11 12 * WebView/WebDashboardRegion.mm: 13 (-[WebDashboardRegion isEqual:]): Added type checking on the argument. Added a 14 FIXME about the lack of a hash method override. 15 1 16 2014-01-11 Alexey Proskuryakov <ap@apple.com> 2 17 -
trunk/Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm
r161185 r161850 90 90 } 91 91 92 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary, 93 // since two equal objects could have different hashes. 92 94 - (BOOL)isEqual:(id)anObject 93 95 { 94 if (![anObject isMemberOfClass:[WebSecurityOrigin class]]) {96 if (![anObject isMemberOfClass:[WebSecurityOrigin class]]) 95 97 return NO; 96 }97 98 98 99 return [self _core]->equal([anObject _core]); -
trunk/Source/WebKit/mac/WebView/WebDashboardRegion.mm
r149980 r161850 81 81 } 82 82 83 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into a NSSet or is the key in an NSDictionary. 83 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary, 84 // since two equal objects could have different hashes. 84 85 - (BOOL)isEqual:(id)other 85 86 { 87 if (![other isKindOfClass:[WebDashboardRegion class]]) 88 return NO; 89 86 90 return NSEqualRects(rect, [other dashboardRegionRect]) && NSEqualRects(clip, [other dashboardRegionClip]) && type == [other dashboardRegionType]; 87 91 } -
trunk/Source/WebKit2/ChangeLog
r161849 r161850 1 2014-01-12 Darin Adler <darin@apple.com> 2 3 Add type checking to isEqual methods 4 https://bugs.webkit.org/show_bug.cgi?id=126862 5 6 Reviewed by Anders Carlsson. 7 8 * UIProcess/API/ios/WKInteractionView.mm: 9 (-[WKTextRange isEqual:]): Added type checking for the argument. The old 10 code asserted instead, and it's not clear what guarantees that assertion is 11 true. Added a FIXME about the lack of a hash method. Added another FIXME 12 about the fact that this method ignores much of the object state. Removed 13 an unneeded extra fetch of the isRange property. Deleted some dead code. 14 (-[WKTextPosition isEqual:]): Ditto. 15 1 16 2014-01-12 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm
r161358 r161850 1516 1516 } 1517 1517 1518 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary, 1519 // since two equal items could have different hashes. 1518 1520 - (BOOL)isEqual:(id)other 1519 1521 { 1520 assert([other isKindOfClass:[WKTextRange class]]); 1522 if (![other isKindOfClass:[WKTextRange class]]) 1523 return NO; 1524 1521 1525 WKTextRange *otherRange = (WKTextRange *)other; 1522 1526 1523 1527 if (self == other) 1524 1528 return YES; 1525 1529 1530 // FIXME: Probably incorrect for equality to ignore so much of the object state. 1531 // It ignores isNone, isEditable, selectedTextLength, and selectionRects. 1532 1526 1533 if (self.isRange) { 1527 1534 if (!otherRange.isRange) 1528 1535 return NO; 1529 1536 return CGRectEqualToRect(self.startRect, otherRange.startRect) && CGRectEqualToRect(self.endRect, otherRange.endRect); 1530 } else if (!self.isRange){1537 } else { 1531 1538 if (otherRange.isRange) 1532 1539 return NO; 1540 // FIXME: Do we need to check isNone here? 1533 1541 return CGRectEqualToRect(self.startRect, otherRange.startRect); 1534 1542 } 1535 return otherRange.isNone;1536 1543 } 1537 1544 … … 1549 1556 } 1550 1557 1558 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into a NSSet or is the key in an NSDictionary, 1559 // since two equal items could have different hashes. 1551 1560 - (BOOL)isEqual:(id)other 1552 1561 { 1553 assert([other isKindOfClass:[self class]]); 1562 if (![object isKindOfClass:[WKTextPosition class]]) 1563 return NO; 1564 1554 1565 return CGRectEqualToRect(self.positionRect, ((WKTextPosition *)other).positionRect); 1555 1566 }
Note: See TracChangeset
for help on using the changeset viewer.