mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 649134 - Ignore an empty or whitespace only <link> href. r=bzbarsky
This commit is contained in:
parent
ef8b8a4670
commit
d9580d4443
31
content/html/content/reftests/649134-1.html
Normal file
31
content/html/content/reftests/649134-1.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Testcase for bug </title>
|
||||
<link rel="stylesheet" type="text/css" href="" />
|
||||
<!--
|
||||
#foo {
|
||||
/* This doesn't get evaluated */
|
||||
color: red;
|
||||
}
|
||||
#ie {
|
||||
border: 5px solid red;
|
||||
}
|
||||
#ie {
|
||||
display: block;
|
||||
}
|
||||
#moz {
|
||||
color: blue;
|
||||
/* display: none; */
|
||||
}
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="foo">foo</p>
|
||||
<p id="ie">ie</p>
|
||||
<p id="moz">moz</p>
|
||||
|
||||
</body>
|
||||
</html>
|
31
content/html/content/reftests/649134-2.html
Normal file
31
content/html/content/reftests/649134-2.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Testcase for bug </title>
|
||||
<link rel="stylesheet" type="text/css" href=" " />
|
||||
<!--
|
||||
#foo {
|
||||
/* This doesn't get evaluated */
|
||||
color: red;
|
||||
}
|
||||
#ie {
|
||||
border: 5px solid red;
|
||||
}
|
||||
#ie {
|
||||
display: block;
|
||||
}
|
||||
#moz {
|
||||
color: blue;
|
||||
/* display: none; */
|
||||
}
|
||||
-->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="foo">foo</p>
|
||||
<p id="ie">ie</p>
|
||||
<p id="moz">moz</p>
|
||||
|
||||
</body>
|
||||
</html>
|
13
content/html/content/reftests/649134-ref.html
Normal file
13
content/html/content/reftests/649134-ref.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Testcase for bug </title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p id="foo">foo</p>
|
||||
<p id="ie">ie</p>
|
||||
<p id="moz">moz</p>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -21,6 +21,9 @@ include autofocus/reftest.list
|
||||
== 596455-2a.html 596455-ref-2.html
|
||||
== 596455-2b.html 596455-ref-2.html
|
||||
== 610935.html 610935-ref.html
|
||||
== 649134-1.html 649134-ref.html
|
||||
== 649134-2.html 649134-ref.html
|
||||
|
||||
== hidden-1a.html hidden-1-ref.html
|
||||
== hidden-1b.html hidden-1-ref.html
|
||||
== hidden-1c.html hidden-1-ref.html
|
||||
|
@ -389,6 +389,12 @@ already_AddRefed<nsIURI>
|
||||
nsHTMLLinkElement::GetStyleSheetURL(PRBool* aIsInline)
|
||||
{
|
||||
*aIsInline = PR_FALSE;
|
||||
nsAutoString href;
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
||||
href.Trim(" \t\n\r\f"); // trim HTML5 whitespace
|
||||
if (href.IsEmpty()) {
|
||||
return nsnull;
|
||||
}
|
||||
return Link::GetURI();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user