WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
156805
Drop [UsePointersEvenForNonNullableObjectArguments] from Range
https://bugs.webkit.org/show_bug.cgi?id=156805
Summary
Drop [UsePointersEvenForNonNullableObjectArguments] from Range
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
Details
Formatted Diff
Diff
Patch
(94.49 KB, patch)
2016-04-20 19:41 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(95.20 KB, patch)
2016-04-20 19:47 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(96.01 KB, patch)
2016-04-20 19:53 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(97.76 KB, patch)
2016-04-20 19:57 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(98.70 KB, patch)
2016-04-20 20:03 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(103.12 KB, patch)
2016-04-20 20:50 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(106.10 KB, patch)
2016-04-21 08:54 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2016-04-20 19:13:38 PDT
Created
attachment 276884
[details]
Patch
Chris Dumez
Comment 2
2016-04-20 19:41:18 PDT
Created
attachment 276888
[details]
Patch
Chris Dumez
Comment 3
2016-04-20 19:47:59 PDT
Created
attachment 276889
[details]
Patch
Chris Dumez
Comment 4
2016-04-20 19:53:24 PDT
Created
attachment 276890
[details]
Patch
Chris Dumez
Comment 5
2016-04-20 19:57:09 PDT
Created
attachment 276892
[details]
Patch
Chris Dumez
Comment 6
2016-04-20 20:03:49 PDT
Created
attachment 276894
[details]
Patch
Chris Dumez
Comment 7
2016-04-20 20:50:25 PDT
Created
attachment 276895
[details]
Patch
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
Created
attachment 276932
[details]
Patch
Chris Dumez
Comment 11
2016-04-21 09:06:59 PDT
Committed
r199817
: <
http://trac.webkit.org/changeset/199817
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug