Title: [114852] branches/chromium/1084
- Revision
- 114852
- Author
- [email protected]
- Date
- 2012-04-21 16:56:41 -0700 (Sat, 21 Apr 2012)
Log Message
Merge 113229
BUG=99229
Review URL: https://chromiumcodereview.appspot.com/10165023
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1084/LayoutTests/fast/html/pending-stylesheet-crash-expected.txt (from rev 113229, trunk/LayoutTests/fast/html/pending-stylesheet-crash-expected.txt) (0 => 114852)
--- branches/chromium/1084/LayoutTests/fast/html/pending-stylesheet-crash-expected.txt (rev 0)
+++ branches/chromium/1084/LayoutTests/fast/html/pending-stylesheet-crash-expected.txt 2012-04-21 23:56:41 UTC (rev 114852)
@@ -0,0 +1 @@
+This test passes if it doesn't crash
Copied: branches/chromium/1084/LayoutTests/fast/html/pending-stylesheet-crash.html (from rev 113229, trunk/LayoutTests/fast/html/pending-stylesheet-crash.html) (0 => 114852)
--- branches/chromium/1084/LayoutTests/fast/html/pending-stylesheet-crash.html (rev 0)
+++ branches/chromium/1084/LayoutTests/fast/html/pending-stylesheet-crash.html 2012-04-21 23:56:41 UTC (rev 114852)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head id="h">
+</head>
+<body>
+<script>
+if (window.layoutTestController)
+ window.layoutTestController.dumpAsText();
+
+var link = document.createElement('link');
+link.setAttribute('type', 'text/css');
+link.setAttribute('rel', 'stylesheet');
+link.setAttribute('href', 'really-does-not-exist.css');
+document.getElementById('h').appendChild(link);
+link.parentNode.removeChild(link);
+link = null;
+</script>
+<script>
+function gc() {
+ if (window.GCController)
+ GCController.collect();
+ else {
+ // Allocate a sufficient number of objects to force a GC.
+ for (var i = 0; i < 10000; i++)
+ new Object;
+ }
+}
+
+gc();
+</script>
+<p>This test passes if it doesn't crash</p>
+</body>
+</html>
Modified: branches/chromium/1084/Source/WebCore/html/HTMLLinkElement.cpp (114851 => 114852)
--- branches/chromium/1084/Source/WebCore/html/HTMLLinkElement.cpp 2012-04-21 23:54:06 UTC (rev 114851)
+++ branches/chromium/1084/Source/WebCore/html/HTMLLinkElement.cpp 2012-04-21 23:56:41 UTC (rev 114852)
@@ -82,10 +82,8 @@
if (m_sheet)
m_sheet->clearOwnerNode();
- if (m_cachedSheet) {
+ if (m_cachedSheet)
m_cachedSheet->removeClient(this);
- removePendingSheet();
- }
if (inDocument())
document()->removeStyleSheetCandidateNode(this);
@@ -266,6 +264,9 @@
m_sheet = 0;
}
+ if (styleSheetIsLoading())
+ removePendingSheet();
+
if (document()->renderer())
document()->styleSelectorChanged(DeferRecalcStyle);
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes