WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
146038
Position::findParent() should take a reference
https://bugs.webkit.org/show_bug.cgi?id=146038
Summary
Position::findParent() should take a reference
Jon Honeycutt
Reported
2015-06-16 17:09:12 PDT
Position::findParent() should take a reference.
Attachments
Patch
(5.01 KB, patch)
2015-06-16 17:10 PDT
,
Jon Honeycutt
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jon Honeycutt
Comment 1
2015-06-16 17:10:31 PDT
Created
attachment 254982
[details]
Patch
Darin Adler
Comment 2
2015-06-16 20:07:16 PDT
Comment on
attachment 254982
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=254982&action=review
> Source/WebCore/dom/Position.cpp:165 > + return findParent(*m_anchorNode.get());
No need for .get() here.
> Source/WebCore/dom/Position.cpp:225 > + if (findParent(*m_anchorNode.get()) && (editingIgnoresContent(m_anchorNode.get()) || isRenderedTable(m_anchorNode.get())))
No need for .get() in the *m_anchorNode part.
> Source/WebCore/dom/Position.cpp:314 > + if (!node) > + return *this;
Looks like this fixes a bug. Can we make a test that shows this was broken before?
> Source/WebCore/dom/Position.cpp:367 > + if (!node) > + return *this;
Looks like this fixes a bug. Can we make a test that shows this was broken before?
Jon Honeycutt
Comment 3
2015-06-17 17:39:26 PDT
(In reply to
comment #2
)
> Comment on
attachment 254982
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=254982&action=review
> > > Source/WebCore/dom/Position.cpp:165 > > + return findParent(*m_anchorNode.get()); > > No need for .get() here. > > > Source/WebCore/dom/Position.cpp:225 > > + if (findParent(*m_anchorNode.get()) && (editingIgnoresContent(m_anchorNode.get()) || isRenderedTable(m_anchorNode.get()))) > > No need for .get() in the *m_anchorNode part.
Fixed.
> > > Source/WebCore/dom/Position.cpp:314 > > + if (!node) > > + return *this; > > Looks like this fixes a bug. Can we make a test that shows this was broken > before? > > > Source/WebCore/dom/Position.cpp:367 > > + if (!node) > > + return *this; > > Looks like this fixes a bug. Can we make a test that shows this was broken > before?
I couldn’t find a way to make this crash. I looked for existing bug reports and found <
rdar://problem/21026135
>, but I was unable to reproduce a crash given the repro steps in the bug. Thanks for the review!
Jon Honeycutt
Comment 4
2015-06-17 17:50:33 PDT
Committed
r185682
: <
http://trac.webkit.org/changeset/185682
>
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