| Summary: | Position::findParent() should take a reference | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jon Honeycutt <jhoneycutt> | ||||
| Component: | HTML Editing | Assignee: | Jon Honeycutt <jhoneycutt> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, esprehn+autocc, kangil.han | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Jon Honeycutt
2015-06-16 17:09:12 PDT
Created attachment 254982 [details]
Patch
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? (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! Committed r185682: <http://trac.webkit.org/changeset/185682> |