Title: [153392] branches/safari-537-branch
- Revision
- 153392
- Author
- [email protected]
- Date
- 2013-07-26 16:51:04 -0700 (Fri, 26 Jul 2013)
Log Message
Merged r153366. <rdar://problem/14556358>
Modified Paths
Added Paths
Diff
Modified: branches/safari-537-branch/LayoutTests/ChangeLog (153391 => 153392)
--- branches/safari-537-branch/LayoutTests/ChangeLog 2013-07-26 23:48:41 UTC (rev 153391)
+++ branches/safari-537-branch/LayoutTests/ChangeLog 2013-07-26 23:51:04 UTC (rev 153392)
@@ -1,3 +1,19 @@
+2013-07-26 Lucas Forschler <[email protected]>
+
+ Merge r153366
+
+ 2013-07-25 Ryosuke Niwa <[email protected]>
+
+ Fix document leak when selection is created inside the document
+ https://bugs.webkit.org/show_bug.cgi?id=119122
+
+ Reviewed by Andreas Kling.
+
+ Added a regression test.
+
+ * editing/selection/leak-document-with-selection-inside-expected.txt: Added.
+ * editing/selection/leak-document-with-selection-inside.html: Added.
+
2013-07-24 Lucas Forschler <[email protected]>
Merge r153002
Copied: branches/safari-537-branch/LayoutTests/editing/selection/leak-document-with-selection-inside-expected.txt (from rev 153366, trunk/LayoutTests/editing/selection/leak-document-with-selection-inside-expected.txt) (0 => 153392)
--- branches/safari-537-branch/LayoutTests/editing/selection/leak-document-with-selection-inside-expected.txt (rev 0)
+++ branches/safari-537-branch/LayoutTests/editing/selection/leak-document-with-selection-inside-expected.txt 2013-07-26 23:51:04 UTC (rev 153392)
@@ -0,0 +1,12 @@
+This test asserts that document doesn't leak when a selection is created inside the document.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.numberOfLiveDocuments() is originalNumberOfLiveDocuments
+PASS successfullyParsed is true
+
+TEST COMPLETE
+This test only runs on DumpRenderTree, as it requires existence of window.internals and cross-domain resource access check disabled.
+
+
Copied: branches/safari-537-branch/LayoutTests/editing/selection/leak-document-with-selection-inside.html (from rev 153366, trunk/LayoutTests/editing/selection/leak-document-with-selection-inside.html) (0 => 153392)
--- branches/safari-537-branch/LayoutTests/editing/selection/leak-document-with-selection-inside.html (rev 0)
+++ branches/safari-537-branch/LayoutTests/editing/selection/leak-document-with-selection-inside.html 2013-07-26 23:51:04 UTC (rev 153392)
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<body _onload_="runTest()">
+<p>This test only runs on DumpRenderTree, as it requires existence of window.internals and cross-domain resource access check disabled.</p>
+<iframe id="frame" src=''></iframe>
+<script src=""
+<script>
+description("This test asserts that document doesn't leak when a selection is created inside the document.");
+
+if (window.internals)
+ jsTestIsAsync = true;
+
+var originalNumberOfLiveDocuments = 0;
+
+var frame = document.getElementById('frame');
+frame._onload_ = function() {
+ if (frame.src ="" 'about:blank')
+ return true;
+
+ (function() {
+ var contentWindow = frame.contentWindow;
+ var element = contentWindow.document.getElementById("t");
+ contentWindow.getSelection().setPosition(element, 0);
+ })();
+
+ frame._onload_ = function() {
+ gc();
+ setTimeout(function () {
+ shouldBe("internals.numberOfLiveDocuments()", "originalNumberOfLiveDocuments");
+ finishJSTest();
+ }, 0);
+ }
+ frame.src = '';
+}
+
+function runTest() {
+ if (!window.internals)
+ return;
+ originalNumberOfLiveDocuments = internals.numberOfLiveDocuments();
+ frame.src = '';
+}
+
+var successfullyParsed = true;
+
+</script>
+<script src=""
+</body>
+</html>
\ No newline at end of file
Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (153391 => 153392)
--- branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-26 23:48:41 UTC (rev 153391)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog 2013-07-26 23:51:04 UTC (rev 153392)
@@ -1,5 +1,26 @@
2013-07-26 Lucas Forschler <[email protected]>
+ Merge r153366
+
+ 2013-07-25 Ryosuke Niwa <[email protected]>
+
+ Fix document leak when selection is created inside the document
+ https://bugs.webkit.org/show_bug.cgi?id=119122
+
+ Reviewed by Andreas Kling.
+
+ Merge https://chromium.googlesource.com/chromium/blink/+/b908cb4c8da93316d787de31c93f2a43de332a10
+
+ The bug was caused by FrameSelection::m_previousCaretNode holding onto a Node, leaking its document.
+ Fixed the bug by explicitly clearing it in FrameSelection::prepareForDestruction.
+
+ Test: editing/selection/leak-document-with-selection-inside.html
+
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::prepareForDestruction):
+
+2013-07-26 Lucas Forschler <[email protected]>
+
Merge r153344
2013-07-25 Sam Weinig <[email protected]>
Modified: branches/safari-537-branch/Source/WebCore/editing/FrameSelection.cpp (153391 => 153392)
--- branches/safari-537-branch/Source/WebCore/editing/FrameSelection.cpp 2013-07-26 23:48:41 UTC (rev 153391)
+++ branches/safari-537-branch/Source/WebCore/editing/FrameSelection.cpp 2013-07-26 23:51:04 UTC (rev 153392)
@@ -1210,6 +1210,7 @@
view->clearSelection();
setSelection(VisibleSelection(), CloseTyping | ClearTypingStyle | DoNotUpdateAppearance);
+ m_previousCaretNode.clear();
}
void FrameSelection::setStart(const VisiblePosition &pos, EUserTriggered trigger)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes