Commit 94335d6c authored by mrowe@apple.com's avatar mrowe@apple.com

2008-02-29 Robert Blaut <webkit@blaut.biz>

        Reviewed by Darin Adler.

        - fix http://bugs.webkit.org/show_bug.cgi?id=17532
          Webkit imports styles from <link> element which doesn't have rel=stylesheet defined

        Test: fast/html/link-rel-stylesheet.html

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process):

2008-02-29  Robert Blaut  <webkit@blaut.biz>

        Reviewed by Darin Adler.

        - Tests for http://bugs.webkit.org/show_bug.cgi?id=17532
          Webkit imports styles from <link> element which doesn't have rel=stylesheet defined

        * fast/html/link-rel-stylesheet.html: Added.
        * fast/media/mq-simple-query-02.html:
        * fast/media/mq-width-absolute-02.html:
        * platform/mac/fast/html/link-rel-stylesheet-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 68c3ec16
2008-02-29 Robert Blaut <webkit@blaut.biz>
Reviewed by Darin Adler.
- Tests for http://bugs.webkit.org/show_bug.cgi?id=17532
Webkit imports styles from <link> element which doesn't have rel=stylesheet defined
* fast/html/link-rel-stylesheet.html: Added.
* fast/media/mq-simple-query-02.html:
* fast/media/mq-width-absolute-02.html:
* platform/mac/fast/html/link-rel-stylesheet-expected.txt: Added.
2008-02-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test for importing styles via incorrect link element</title>
<link type="text/css" href="data:text/css;charset=utf-8,p#one%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
<link rel="stylesheet" href="data:text/css;charset=utf-8,p#two%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
<link href="data:text/css;charset=utf-8,p#three%20%7Bbackground-color%3A%20red%3B%7D%0D%0A"/>
<link type="text/css" rel="stylesheet" href="data:text/css;charset=utf-8,p#four%20%7Bbackground-color%3A%20lime%3B%7D%0D%0A"/>
</head>
<body>
<p id="one">This line should not have red background</p>
<p id="two">This line should have lime background</p>
<p id="three">This line should not have red background</p>
<p id="four">This line should have lime background</p>
</body>
</html>
......@@ -3,7 +3,7 @@
<title>CSS3 media query test: simple media query. Using link element, media attribute</title>
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#syntax" />
<link type="text/css" media="only all" href="import-p-green.css" />
<link rel="stylesheet" type="text/css" media="only all" href="import-p-green.css" />
</head>
<body>
<p> This text should be green.</p>
......
......@@ -2,7 +2,7 @@
<head>
<title>CSS3 media query test: Absolute width query (screen and (max-width: 800px)). Using link element, media attribute.</title>
<link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#width" />
<link type="text/css" media="screen and (max-width: 800px)" href="import-p-green.css" />
<link rel="stylesheet" type="text/css" media="screen and (max-width: 800px)" href="import-p-green.css" />
</head>
<body>
<p> This text should be green if viewport is at most 800px wide.</p>
......
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x152
RenderBlock {HTML} at (0,0) size 800x152
RenderBody {BODY} at (8,16) size 784x120
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 262x18
text run at (0,0) width 262: "This line should not have red background"
RenderBlock {P} at (0,34) size 784x18 [bgcolor=#00FF00]
RenderText {#text} at (0,0) size 245x18
text run at (0,0) width 245: "This line should have lime background"
RenderBlock {P} at (0,68) size 784x18
RenderText {#text} at (0,0) size 262x18
text run at (0,0) width 262: "This line should not have red background"
RenderBlock {P} at (0,102) size 784x18 [bgcolor=#00FF00]
RenderText {#text} at (0,0) size 245x18
text run at (0,0) width 245: "This line should have lime background"
2008-02-29 Robert Blaut <webkit@blaut.biz>
Reviewed by Darin Adler.
- fix http://bugs.webkit.org/show_bug.cgi?id=17532
Webkit imports styles from <link> element which doesn't have rel=stylesheet defined
Test: fast/html/link-rel-stylesheet.html
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
2008-02-29 Mark Rowe <mrowe@apple.com>
Reviewed by Anders Carlsson.
......@@ -165,7 +165,7 @@ void HTMLLinkElement::process()
// Stylesheet
// This was buggy and would incorrectly match <link rel="alternate">, which has a different specified meaning. -dwh
if (m_disabledState != 2 && (type.contains("text/css") || m_isStyleSheet) && document()->frame()) {
if (m_disabledState != 2 && m_isStyleSheet && document()->frame()) {
// no need to load style sheets which aren't for the screen output
// ### there may be in some situations e.g. for an editor or script to manipulate
// also, don't load style sheets for standalone documents
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment