WebKit Bugzilla
Attachment 343107 Details for
Bug 186792
: Restrict Selection in contenteditable to the extent of that contenteditable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186792-20180619150732.patch (text/plain), 5.03 KB, created by
Megan Gardner
on 2018-06-19 15:07:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2018-06-19 15:07:33 PDT
Size:
5.03 KB
patch
obsolete
>Subversion Revision: 232780 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 852f833009f84fa46e6fda05ee41ab2299e0d5a7..a6a330447b6e75fc56fb7204c5f7dd6fd039ba0f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-19 Megan Gardner <megan_gardner@apple.com> >+ >+ Restrict Selection in contenteditable the extent of that contenteditable >+ https://bugs.webkit.org/show_bug.cgi?id=186792 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ My system currently will not allow me to run tests. I will add one when I can update. >+ >+ Expose the already existing funcitonality to restrict a selection to a single contentenditable >+ >+ * page/EventHandler.cpp: >+ (WebCore::EventHandler::selectionExtentRespectingEditingBoundary): >+ (WebCore::selectionExtentRespectingEditingBoundary): Deleted. >+ * page/EventHandler.h: >+ * rendering/HitTestResult.h: >+ > 2018-06-12 Ryosuke Niwa <rniwa@webkit.org> > > iOS WK1: Occasional crash in FrameView::setScrollPosition >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a777d75e06dafa3f7df0f9b2911b6d753dae328f..e79f9a1a9f99cbefedf142c271b7beb770dc66aa 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-19 Megan Gardner <megan_gardner@apple.com> >+ >+ Restrict Selection in contenteditable the extent of that contenteditable >+ https://bugs.webkit.org/show_bug.cgi?id=186792 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We have not been checking to make sure that when we make a selection that it is restricted to >+ a single content editable on iOS. There is functionality to ensure this on mac, so it has been >+ exposed and utilized for restricting the extent of a selection. >+ >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::updateSelectionWithTouches): >+ > 2018-06-12 Brent Fulgham <bfulgham@apple.com> > > Turn CSS Spring Animations and Link Preload off by default for production builds. >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index a5bbf90434a5dd939adddd402d48e0357d0512bf..a6e43d07e1158301fb14669c20a3e2193fa5d76f 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -904,12 +904,12 @@ void EventHandler::updateSelectionForMouseDrag() > updateSelectionForMouseDrag(result); > } > >-static VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const LayoutPoint& localPoint, Node* targetNode) >+VisiblePosition EventHandler::selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const LayoutPoint& localPoint, Node* targetNode) > { > FloatPoint selectionEndPoint = localPoint; > Element* editableElement = selection.rootEditableElement(); >- >- if (!targetNode->renderer()) >+ >+ if (!targetNode || !targetNode->renderer()) > return VisiblePosition(); > > if (editableElement && !editableElement->contains(targetNode)) { >diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h >index 2eec61d1e91f5f597e4cb8fcc6d658605e3662ec..fe96961a46c58f19facd86af461d713e84ec4377 100644 >--- a/Source/WebCore/page/EventHandler.h >+++ b/Source/WebCore/page/EventHandler.h >@@ -130,6 +130,7 @@ public: > void nodeWillBeRemoved(Node&); > > #if ENABLE(DRAG_SUPPORT) >+ WEBCORE_EXPORT VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection&, const LayoutPoint&, Node*); > void updateSelectionForMouseDrag(); > #endif > >diff --git a/Source/WebCore/rendering/HitTestResult.h b/Source/WebCore/rendering/HitTestResult.h >index a6c7b615d0b60ce7eb662f23c4c1965e3552a79d..d0777b3450c3a020aefd43a723cc6cb133deae0b 100644 >--- a/Source/WebCore/rendering/HitTestResult.h >+++ b/Source/WebCore/rendering/HitTestResult.h >@@ -140,7 +140,7 @@ public: > > Vector<String> dictationAlternatives() const; > >- Node* targetNode() const; >+ WEBCORE_EXPORT Node* targetNode() const; > WEBCORE_EXPORT Element* targetElement() const; > > private: >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 8b5d37c4268cf0522d12f7b5eaaafa41df8b7140..62e77aba6cc56c636794e0709551f4928d955e85 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -1335,6 +1335,9 @@ void WebPage::updateSelectionWithTouches(const IntPoint& point, uint32_t touches > break; > > case SelectionTouch::Moved: >+ HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent); >+ if (result.targetNode()) >+ position = m_page->mainFrame().eventHandler().selectionExtentRespectingEditingBoundary(frame.selection().selection(), result.localPoint(), result.targetNode()); > range = rangeForPosition(&frame, position, baseIsStart); > break; > }
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 186792
:
342996
|
343038
|
343065
|
343071
| 343107