WebKit Bugzilla
Attachment 359095 Details for
Bug 193416
: Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193416-20190114162242.patch (text/plain), 3.04 KB, created by
Simon Fraser (smfr)
on 2019-01-14 16:22:42 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-01-14 16:22:42 PST
Size:
3.04 KB
patch
obsolete
>Subversion Revision: 239930 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 494681317a241b0d578825cd642356e6ab75407f..7a6da4229e174cbf3d6bcc182d26893899026472 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-14 Simon Fraser <simon.fraser@apple.com> >+ >+ Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections >+ https://bugs.webkit.org/show_bug.cgi?id=193416 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and >+ it shows up on Speedometer profiles so optimize to only run this code if we have a selection range. >+ >+ * editing/FrameSelection.cpp: >+ (WebCore::FrameSelection::respondToNodeModification): >+ > 2019-01-14 Myles C. Maxfield <mmaxfield@apple.com> > > [WHLSL] Assorted cleanup >diff --git a/Source/WebCore/editing/FrameSelection.cpp b/Source/WebCore/editing/FrameSelection.cpp >index 8073ad7fc7e0f757d2c7c333df8ba8df1a5de3e7..1416a259de2fc51195df2c4c7919c28d6f9927e5 100644 >--- a/Source/WebCore/editing/FrameSelection.cpp >+++ b/Source/WebCore/editing/FrameSelection.cpp >@@ -537,16 +537,18 @@ void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, boo > m_selection.setWithoutValidation(m_selection.start(), m_selection.end()); > else > m_selection.setWithoutValidation(m_selection.end(), m_selection.start()); >- } else if (RefPtr<Range> range = m_selection.firstRange()) { >- auto compareNodeResult = range->compareNode(node); >- if (!compareNodeResult.hasException()) { >- auto compareResult = compareNodeResult.releaseReturnValue(); >- if (compareResult == Range::NODE_BEFORE_AND_AFTER || compareResult == Range::NODE_INSIDE) { >- // If we did nothing here, when this node's renderer was destroyed, the rect that it >- // occupied would be invalidated, but, selection gaps that change as a result of >- // the removal wouldn't be invalidated. >- // FIXME: Don't do so much unnecessary invalidation. >- clearRenderTreeSelection = true; >+ } else if (isRange()) { >+ if (RefPtr<Range> range = m_selection.firstRange()) { >+ auto compareNodeResult = range->compareNode(node); >+ if (!compareNodeResult.hasException()) { >+ auto compareResult = compareNodeResult.releaseReturnValue(); >+ if (compareResult == Range::NODE_BEFORE_AND_AFTER || compareResult == Range::NODE_INSIDE) { >+ // If we did nothing here, when this node's renderer was destroyed, the rect that it >+ // occupied would be invalidated, but, selection gaps that change as a result of >+ // the removal wouldn't be invalidated. >+ // FIXME: Don't do so much unnecessary invalidation. >+ clearRenderTreeSelection = true; >+ } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193416
: 359095