Bug 18066

Summary: REGRESSION: createAttribute throws NAMESPACE_ERR exception
Product: WebKit Reporter: Romain Bohdanowicz <romain.bohdanowicz>
Component: DOMAssignee: Julien Chaffraix <jchaffraix>
Status: RESOLVED FIXED    
Severity: Major CC: ap, cdumez, eric
Priority: P1 Keywords: EasyFix, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Test Case
none
Test Case
none
New Test Case
none
Add a boolean parameter to createAttributeNS to bypass namespace checks darin: review+

Description Romain Bohdanowicz 2008-03-25 07:20:15 PDT
Since Nightly r31232 webkit throws an exception if a namespace is used with the createAttribute method.

Example : document.createAttribute("ba:profile");
Comment 1 Romain Bohdanowicz 2008-03-25 07:21:19 PDT
Created attachment 20025 [details]
Test Case
Comment 2 Mark Rowe (bdash) 2008-03-25 11:58:29 PDT
Sounds like a side-effect of <http://webkit.org/blog/167/webkit-gets-an-a-on-acid3/>.
Comment 3 Eric Seidel (no email) 2008-03-25 13:26:31 PDT
I *knew* I should have created a createAttribute("foo:bar") test case...

Should be easy to fix.
Comment 4 Romain Bohdanowicz 2008-03-28 03:34:23 PDT
Comment on attachment 20025 [details]
Test Case

><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head>
>		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
>		<title>Test</title>
>		<script type="text/javascript" charset="utf-8">
>			function test()
>			{
>				try
>				{
>					var attribute = document.createAttribute("ba:test");
window.alert("No bug with this WebKit");
>				}
>				catch(e)
>				{
>					window.alert(e.message);
>				}
>			}
>		</script>
>	</head><body id="regression" onload="javascript:test();">
>	
></body></html>
Comment 5 Romain Bohdanowicz 2008-03-28 03:35:37 PDT
Comment on attachment 20025 [details]
Test Case

><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><body><pre style="word-wrap: break-word; white-space: pre-wrap;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
><html>
>	<head>
>		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
>		<title>Test</title>
>		<script type="text/javascript" charset="utf-8">
>			function test()
>			{
>				try
>				{
>					var attribute = document.createAttribute("ba:test");
>                                     window.alert("Bug not happening with this WebKit");
>				}
>				catch(e)
>				{
>					window.alert(e.message);
>				}
>			}
>		</script>
>	</head>
>	<body id="regression" onload="javascript:test();">
>	</body>
></html>
Comment 6 Romain Bohdanowicz 2008-03-28 03:38:46 PDT
Created attachment 20153 [details]
Test Case
Comment 7 Romain Bohdanowicz 2008-03-28 03:39:39 PDT
Created attachment 20154 [details]
New Test Case
Comment 8 Eric Seidel (no email) 2008-04-08 02:05:59 PDT
All regressions are P1.
Comment 9 Romain Bohdanowicz 2008-05-14 07:05:07 PDT
Still happens in r33431.
Comment 10 Julien Chaffraix 2008-05-29 17:12:08 PDT
Created attachment 21424 [details]
Add a boolean parameter to createAttributeNS to bypass namespace checks
Comment 11 Darin Adler 2008-05-29 17:27:48 PDT
Comment on attachment 21424 [details]
Add a boolean parameter to createAttributeNS to bypass namespace checks

Looks good, r=me.
Comment 12 Julien Chaffraix 2008-06-02 12:55:20 PDT
Committed in r34315.
Comment 13 Lucas Forschler 2019-02-06 09:03:26 PST
Mass moving XML DOM bugs to the "DOM" Component.