http://bugs.webkit.org/show_bug.cgi?id=11141
REGRESSION(r16681-r16691): CSS '@import' doesn't respect HTML Base element
Undo one misguided change made in bug 11011 - stop setting inline stylesheet's href
to document URL. This matches WinIE and partially matches Firefox - although the latter
reports the href as if it were inherited, it still doesn't use it when resolving URIs in
@import rules.
Test: http/tests/uri/css-href.php
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::childrenChanged):
* ksvg2/svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::childrenChanged):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17136
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-19 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Mitz.
+
+ Test for http://bugs.webkit.org/show_bug.cgi?id=11141
+ REGRESSION(r16681-r16691): CSS '@import' doesn't respect HTML Base element
+
+ * http/tests/uri/css-href-2.css: Added.
+ * http/tests/uri/css-href-expected.checksum: Added.
+ * http/tests/uri/css-href-expected.png: Added.
+ * http/tests/uri/css-href-expected.txt: Added.
+ * http/tests/uri/css-href-fwd.css: Added.
+ * http/tests/uri/css-href.css: Added.
+ * http/tests/uri/css-href.php: Added.
+ * http/tests/uri/resources/css-href-2.css: Added.
+ * http/tests/uri/resources/css-href.css: Added.
+
2006-10-19 Geoffrey Garen <ggaren@apple.com>
Updated this test to avoid machine-specific results.
--- /dev/null
+.c2 { color:green !important; }
--- /dev/null
+e2a3e44097d700091ea7824ab5327b24
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x576
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 53x18
+ text run at (0,0) width 53: "Test for "
+ RenderInline {A} at (0,0) size 68x18 [color=#0000EE]
+ RenderText {#text} at (53,0) size 68x18
+ text run at (53,0) width 68: "bug 11141"
+ RenderText {#text} at (121,0) size 341x18
+ text run at (121,0) width 8: ": "
+ text run at (129,0) width 333: "CSS '@import' doesn't respect HTML Base element."
+ RenderBlock {P} at (0,34) size 784x18 [color=#008000]
+ RenderText {#text} at (0,0) size 163x18
+ text run at (0,0) width 163: "This text should be green."
+ RenderBlock {P} at (0,68) size 784x54
+ RenderText {#text} at (0,0) size 770x54
+ text run at (0,0) width 378: "If it is red, the css has been loaded relative to the document. "
+ text run at (378,0) width 383: "If it is black, no stylesheet has been rendered, if it is rendered"
+ text run at (0,18) width 43: "green, "
+ text run at (43,18) width 463: "the stylesheet has been rendered correctly from the HREF attribute of the "
+ text run at (506,18) width 264: "Base element in the HEAD section of this"
+ text run at (0,36) width 66: "document."
+ RenderBlock {P} at (0,138) size 784x18 [color=#008000]
+ RenderText {#text} at (0,0) size 192x18
+ text run at (0,0) width 192: "This text should also be green."
--- /dev/null
+@import "css-href-2.css";
--- /dev/null
+.c1 { color:red !important; }
--- /dev/null
+<html>
+ <head>
+ <base href="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . '/uri/resources/'; ?>">
+ <style>
+ @import 'css-href.css';
+ </style>
+ </head>
+ <body>
+ <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11141">bug 11141</a>:
+ CSS '@import' doesn't respect HTML Base element.</p>
+ <p class="c1">This text should be green.</p>
+ <p>If it is red, the css has been loaded relative to the document.
+ If it is black, no stylesheet has been rendered, if it is rendered green,
+ the stylesheet has been rendered correctly from the HREF attribute of the
+ Base element in the HEAD section of this document.</p>
+ <p class="c2">This text should also be green.</p>
+ </body>
+</html>
--- /dev/null
+.c2 { color:red !important; }
--- /dev/null
+@import "../css-href-fwd.css";
+.c1 { color:green !important; }
+2006-10-19 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Mitz.
+
+ http://bugs.webkit.org/show_bug.cgi?id=11141
+ REGRESSION(r16681-r16691): CSS '@import' doesn't respect HTML Base element
+
+ Undo one misguided change made in bug 11011 - stop setting inline stylesheet's href
+ to document URL. This matches WinIE and partially matches Firefox - although the latter
+ reports the href as if it were inherited, it still doesn't use it when resolving URIs in
+ @import rules.
+
+ Test: http/tests/uri/css-href.php
+
+ * html/HTMLStyleElement.cpp:
+ (WebCore::HTMLStyleElement::childrenChanged):
+ * ksvg2/svg/SVGStyleElement.cpp:
+ (WebCore::SVGStyleElement::childrenChanged):
+
2006-10-19 Anders Carlsson <acarlsson@apple.com>
* loader/Cache.cpp:
if (screenEval.eval(media.get()) || printEval.eval(media.get())) {
document()->addPendingSheet();
m_loading = true;
- m_sheet = new CSSStyleSheet(this, document()->URL(), document()->inputEncoding());
+ m_sheet = new CSSStyleSheet(this, String(), document()->inputEncoding());
m_sheet->parseString(text, !document()->inCompatMode());
m_sheet->setMedia(media.get());
m_loading = false;
m_loading = true;
- m_sheet = new CSSStyleSheet(this, document()->URL(), document()->inputEncoding());
+ m_sheet = new CSSStyleSheet(this, String(), document()->inputEncoding());
m_sheet->parseString(textContent()); // SVG css is always parsed in strict mode
m_sheet->setMedia(mediaList.get());