Reviewed by Darin.
Fix <rdar://problem/
5480050>
Leopard9A551 with Dashcode 112: Dashcode crash when dragging image into canvas.
If @import stylesheet was modified through CSS DOM style selector would not get updated. This
could lead to crashes.
Test: fast/css/import-style-update.html
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::styleSheetChanged):
LayoutTests:
Reviewed by Darin.
Test for <rdar://problem/
5480050>
Leopard9A551 with Dashcode 112: Dashcode crash when dragging image into canvas.
Non-crashing test case, but it demonstrates the same problem that would crash
under some circumstances.
* fast/css/import-style-update-expected.txt: Added.
* fast/css/import-style-update.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25598
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-09-17 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Darin.
+
+ Test for <rdar://problem/5480050>
+ Leopard9A551 with Dashcode 112: Dashcode crash when dragging image into canvas.
+
+ Non-crashing test case, but it demonstrates the same problem that would crash
+ under some circumstances.
+
+ * fast/css/import-style-update-expected.txt: Added.
+ * fast/css/import-style-update.html: Added.
+
2007-09-16 Sam Weinig <sam@webkit.org>
Reviewed by Maciej.
--- /dev/null
+Test that modifying @import stylesheet through DOM updates style properly. You should see PASS below:
+PASS
+
--- /dev/null
+<head>
+<style>
+@import url("data:text/css,#test{display:none;}");
+</style>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+function test() {
+var s = document.styleSheets;
+s[0].cssRules[0].styleSheet.deleteRule(0);
+}
+</script>
+<body onload='test()'>
+Test that modifying @import stylesheet through DOM updates style properly. You should see PASS below:
+<div id=test>PASS</div>
+2007-09-17 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Darin.
+
+ Fix <rdar://problem/5480050>
+ Leopard9A551 with Dashcode 112: Dashcode crash when dragging image into canvas.
+
+ If @import stylesheet was modified through CSS DOM style selector would not get updated. This
+ could lead to crashes.
+
+ Test: fast/css/import-style-update.html
+
+ * css/CSSStyleSheet.cpp:
+ (WebCore::CSSStyleSheet::styleSheetChanged):
+
2007-09-17 Anders Carlsson <andersca@apple.com>
Reviewed by Adam.
void CSSStyleSheet::styleSheetChanged()
{
+ StyleBase* root = this;
+ while (StyleBase* parent = root->parent())
+ root = parent;
+ Document* documentToUpdate = (root && root->isCSSStyleSheet()) ? static_cast<CSSStyleSheet*>(root)->doc() : 0;
+
/* FIXME: We don't need to do everything updateStyleSelector does,
* basically we just need to recreate the document's selector with the
* already existing style sheets.
*/
- if (m_doc)
- m_doc->updateStyleSelector();
+ if (documentToUpdate)
+ documentToUpdate->updateStyleSelector();
}
}