Title: [137975] branches/chromium/1312
Revision
137975
Author
[email protected]
Date
2012-12-17 19:51:04 -0800 (Mon, 17 Dec 2012)

Log Message

Merge 137464
BUG=165602
Review URL: https://codereview.chromium.org/11616012

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1312/LayoutTests/inspector/styles/undo-add-rule-crash-expected.txt (from rev 137464, trunk/LayoutTests/inspector/styles/undo-add-rule-crash-expected.txt) (0 => 137975)


--- branches/chromium/1312/LayoutTests/inspector/styles/undo-add-rule-crash-expected.txt	                        (rev 0)
+++ branches/chromium/1312/LayoutTests/inspector/styles/undo-add-rule-crash-expected.txt	2012-12-18 03:51:04 UTC (rev 137975)
@@ -0,0 +1,4 @@
+Tests that the inspected page does not crash after undoing a new rule addition. Bug 104806
+The test has passed (no crash).
+
+

Copied: branches/chromium/1312/LayoutTests/inspector/styles/undo-add-rule-crash.html (from rev 137464, trunk/LayoutTests/inspector/styles/undo-add-rule-crash.html) (0 => 137975)


--- branches/chromium/1312/LayoutTests/inspector/styles/undo-add-rule-crash.html	                        (rev 0)
+++ branches/chromium/1312/LayoutTests/inspector/styles/undo-add-rule-crash.html	2012-12-18 03:51:04 UTC (rev 137975)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function test()
+{
+    InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
+
+    function step1()
+    {
+        addNewRuleAndSelectNode("other", step2);
+    }
+
+    function step2()
+    {
+        WebInspector.domAgent.undo();
+        InspectorTest.waitForStyles("other", step3);
+    }
+
+    function step3()
+    {
+        InspectorTest.completeTest();
+    }
+
+    function addNewRuleAndSelectNode(nodeId, next)
+    {
+        document.getElementById("add-style-button-test-id").click();
+        var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
+        InspectorTest.selectNodeAndWaitForStyles(nodeId, next);
+    }
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+Tests that the inspected page does not crash after undoing a new rule addition. <a href="" 104806</a>
+
+<p>The test has passed (no crash).</p>
+<div id="inspected"><div id="other" /></div>
+<style>
+@-webkit-keyframes cfpulse1 { 0% { opacity: 0.1;  } }
+.c1 { -webkit-animation-name: cfpulse1;  }
+</style>
+</html>

Modified: branches/chromium/1312/Source/WebCore/inspector/InspectorStyleSheet.cpp (137974 => 137975)


--- branches/chromium/1312/Source/WebCore/inspector/InspectorStyleSheet.cpp	2012-12-18 03:47:18 UTC (rev 137974)
+++ branches/chromium/1312/Source/WebCore/inspector/InspectorStyleSheet.cpp	2012-12-18 03:51:04 UTC (rev 137975)
@@ -897,7 +897,7 @@
 
     String sheetText = m_parsedStyleSheet->text();
     sheetText.remove(sourceData->ruleHeaderRange.start, sourceData->ruleBodyRange.end - sourceData->ruleHeaderRange.start + 1);
-    m_parsedStyleSheet->setText(sheetText);
+    setText(sheetText);
     fireStyleSheetChanged();
     return true;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to