WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
136826
Rename Node::nodeIndex() to computeNodeIndex() for clarity
https://bugs.webkit.org/show_bug.cgi?id=136826
Summary
Rename Node::nodeIndex() to computeNodeIndex() for clarity
Chris Dumez
Reported
2014-09-15 09:47:19 PDT
Rename Node::nodeIndex() to computeNodeIndex() to make it clearer that the node index is actually computed and thus calling this method is potentially expensive.
Attachments
Patch
(28.45 KB, patch)
2014-09-15 10:52 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(29.04 KB, patch)
2014-09-16 09:02 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2014-09-15 10:52:06 PDT
Created
attachment 238132
[details]
Patch
Benjamin Poulain
Comment 2
2014-09-16 00:35:37 PDT
Comment on
attachment 238132
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=238132&action=review
I did not check the surrounding code, no need to change the type when the fix is non obvious.
> Source/WebCore/dom/Range.cpp:603 > + int nodeIndex = refNode->computeNodeIndex();
int -> unsigned?
> Source/WebCore/editing/ApplyStyleCommand.cpp:1294 > + int startOffsetAdjustment = startChild->computeNodeIndex();
ditto?
> Source/WebCore/editing/ApplyStyleCommand.cpp:1328 > + int endOffset = nextChild ? nextChild->computeNodeIndex() : nextElement->countChildNodes();
ditto?
> Source/WebCore/editing/DeleteSelectionCommand.cpp:563 > + offset = n->computeNodeIndex() + 1;
ditto?
> Source/WebCore/editing/Editor.cpp:166 > + startOffset = element->computeNodeIndex();
ditto?
> Source/WebCore/editing/Editor.cpp:171 > + endOffset = element->computeNodeIndex();
ditto?
> Source/WebCore/editing/TextIterator.cpp:1098 > + int index = m_positionOffsetBaseNode->computeNodeIndex();
ditto?
> Source/WebCore/html/HTMLTextFormControlElement.cpp:427 > + offsetInContainer = node->computeNodeIndex() + offset;
ditto?
> Source/WebCore/page/DOMSelection.cpp:367 > + int offset = shadowAncestor->computeNodeIndex();
ditto?
Chris Dumez
Comment 3
2014-09-16 09:02:55 PDT
Created
attachment 238183
[details]
Patch
WebKit Commit Bot
Comment 4
2014-09-16 11:29:04 PDT
Comment on
attachment 238183
[details]
Patch Clearing flags on attachment: 238183 Committed
r173665
: <
http://trac.webkit.org/changeset/173665
>
WebKit Commit Bot
Comment 5
2014-09-16 11:29:09 PDT
All reviewed patches have been landed. Closing bug.
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