Bug 156805

Summary: Drop [UsePointersEvenForNonNullableObjectArguments] from Range
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Chris Dumez
Reported 2016-04-20 12:17:42 PDT
Drop [UsePointersEvenForNonNullableObjectArguments] from Range
Attachments
Patch (92.52 KB, patch)
2016-04-20 19:13 PDT, Chris Dumez
no flags
Patch (94.49 KB, patch)
2016-04-20 19:41 PDT, Chris Dumez
no flags
Patch (95.20 KB, patch)
2016-04-20 19:47 PDT, Chris Dumez
no flags
Patch (96.01 KB, patch)
2016-04-20 19:53 PDT, Chris Dumez
no flags
Patch (97.76 KB, patch)
2016-04-20 19:57 PDT, Chris Dumez
no flags
Patch (98.70 KB, patch)
2016-04-20 20:03 PDT, Chris Dumez
no flags
Patch (103.12 KB, patch)
2016-04-20 20:50 PDT, Chris Dumez
no flags
Patch (106.10 KB, patch)
2016-04-21 08:54 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-04-20 19:13:38 PDT
Chris Dumez
Comment 2 2016-04-20 19:41:18 PDT
Chris Dumez
Comment 3 2016-04-20 19:47:59 PDT
Chris Dumez
Comment 4 2016-04-20 19:53:24 PDT
Chris Dumez
Comment 5 2016-04-20 19:57:09 PDT
Chris Dumez
Comment 6 2016-04-20 20:03:49 PDT
Chris Dumez
Comment 7 2016-04-20 20:50:25 PDT
youenn fablet
Comment 8 2016-04-21 02:15:20 PDT
Comment on attachment 276895 [details] Patch r=me, some nits below. View in context: https://bugs.webkit.org/attachment.cgi?id=276895&action=review > Source/WebCore/accessibility/AXObjectCache.cpp:1639 > + return !range2 || range1->compareBoundaryPoints(Range::START_TO_START, *range2, IGNORE_EXCEPTION) <= 0; Do you know what is preventing range1 to be null? Should we check it/assert it? > Source/WebCore/accessibility/AXObjectCache.cpp:1758 > copyRange = Range::create(range->ownerDocument(), &range->startContainer(), range->startOffset(), &range->endContainer(), range->endOffset()); Is it possible to make copyRange a Ref<Range> and/or limit ref count churn here? > Source/WebCore/accessibility/AXObjectCache.cpp:1761 > + copyRange->setStart(*node, nodeStartOffset.startIndex); Why not making node a Node& instead of a Node*? > Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp:162 > Node* node = coreObject->node(); Add ASSERT(node)? > Source/WebCore/editing/htmlediting.cpp:1171 > return VisiblePosition(firstPositionInOrBeforeNode(node), DOWNSTREAM); Could visiblePositionForIndexUsingCharacterIterator take a Node& instead of a Node*, like you did for isNodeVisiblyContainedWithin?
Chris Dumez
Comment 9 2016-04-21 08:53:15 PDT
Comment on attachment 276895 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=276895&action=review >> Source/WebCore/accessibility/AXObjectCache.cpp:1639 >> + return !range2 || range1->compareBoundaryPoints(Range::START_TO_START, *range2, IGNORE_EXCEPTION) <= 0; > > Do you know what is preventing range1 to be null? > Should we check it/assert it? range1 was already being dereferenced so this is not new. An assertion would not bring much here because we would anyway crash right away when dereferencing range1 if range1 were null. We would add a null-check for range1 but considering there was not one before and my patch did not change range1 in any way, I decided to leave it alone. >> Source/WebCore/accessibility/AXObjectCache.cpp:1758 >> copyRange = Range::create(range->ownerDocument(), &range->startContainer(), range->startOffset(), &range->endContainer(), range->endOffset()); > > Is it possible to make copyRange a Ref<Range> and/or limit ref count churn here? I don't see why not. >> Source/WebCore/accessibility/AXObjectCache.cpp:1761 >> + copyRange->setStart(*node, nodeStartOffset.startIndex); > > Why not making node a Node& instead of a Node*? Ok. >> Source/WebCore/accessibility/atk/WebKitAccessibleUtil.cpp:162 >> Node* node = coreObject->node(); > > Add ASSERT(node)? It would anyway crash right away upon dereferencing in the line below. >> Source/WebCore/editing/htmlediting.cpp:1171 >> return VisiblePosition(firstPositionInOrBeforeNode(node), DOWNSTREAM); > > Could visiblePositionForIndexUsingCharacterIterator take a Node& instead of a Node*, like you did for isNodeVisiblyContainedWithin? Ok.
Chris Dumez
Comment 10 2016-04-21 08:54:25 PDT
Chris Dumez
Comment 11 2016-04-21 09:06:59 PDT
Note You need to log in before you can comment on or make changes to this bug.