Title: [270994] branches/safari-610-branch/Source/WebCore
- Revision
- 270994
- Author
- [email protected]
- Date
- 2020-12-18 16:10:59 -0800 (Fri, 18 Dec 2020)
Log Message
Cherry-pick r270983. rdar://problem/72484021
Crash in DOMSelection::getRangeAt()
https://bugs.webkit.org/show_bug.cgi?id=219804
Patch by Julian Gonzalez <[email protected]> on 2020-12-18
Reviewed by Darin Adler.
Add a check in HTMLTextFormControlElement::setSelectionRange()
that ensures we do not try to move the frame's selection
if the HTMLTextFormControlElement is no longer connected.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (270993 => 270994)
--- branches/safari-610-branch/Source/WebCore/ChangeLog 2020-12-18 23:59:53 UTC (rev 270993)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog 2020-12-19 00:10:59 UTC (rev 270994)
@@ -1,3 +1,36 @@
+2020-12-18 Alan Coon <[email protected]>
+
+ Cherry-pick r270983. rdar://problem/72484021
+
+ Crash in DOMSelection::getRangeAt()
+ https://bugs.webkit.org/show_bug.cgi?id=219804
+
+ Patch by Julian Gonzalez <[email protected]> on 2020-12-18
+ Reviewed by Darin Adler.
+
+ Add a check in HTMLTextFormControlElement::setSelectionRange()
+ that ensures we do not try to move the frame's selection
+ if the HTMLTextFormControlElement is no longer connected.
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionRange):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-12-18 Julian Gonzalez <[email protected]>
+
+ Crash in DOMSelection::getRangeAt()
+ https://bugs.webkit.org/show_bug.cgi?id=219804
+
+ Reviewed by Darin Adler.
+
+ Add a check in HTMLTextFormControlElement::setSelectionRange()
+ that ensures we do not try to move the frame's selection
+ if the HTMLTextFormControlElement is no longer connected.
+
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::setSelectionRange):
+
2020-12-16 Alan Coon <[email protected]>
Cherry-pick r269900. rdar://problem/72298580
Modified: branches/safari-610-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp (270993 => 270994)
--- branches/safari-610-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp 2020-12-18 23:59:53 UTC (rev 270993)
+++ branches/safari-610-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp 2020-12-19 00:10:59 UTC (rev 270994)
@@ -307,10 +307,16 @@
// FIXME: Removing this synchronous layout requires fixing setSelectionWithoutUpdatingAppearance not needing up-to-date style.
document().updateLayoutIgnorePendingStylesheets();
-
+
if (!isTextField())
return;
+ // Double-check our connected state after the layout update.
+ if (!isConnected()) {
+ cacheSelection(start, end, direction);
+ return;
+ }
+
// Double-check the state of innerTextElement after the layout.
innerText = innerTextElement();
auto* rendererTextControl = renderer();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes