WebKit Bugzilla
Attachment 346799 Details for
Bug 188419
: Followup (r234683): Element::getAttribute() should return the first non-null attribute value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188419-20180808144454.patch (text/plain), 5.22 KB, created by
Said Abou-Hallawa
on 2018-08-08 14:44:55 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-08-08 14:44:55 PDT
Size:
5.22 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 234710) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2018-08-08 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Followup (r234683): Element::getAttribute() should return the first non-null attribute value >+ https://bugs.webkit.org/show_bug.cgi?id=188419 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Element::getAttribute() should return the first non-null attribute value >+ since an empty string is a legitimate attribute value. >+ >+ Test: svg/custom/href-svg-namespace-empty.html >+ >+ * dom/Element.h: >+ (WebCore::Element::getAttribute const): >+ > 2018-08-08 Don Olmstead <don.olmstead@sony.com> > > [Nicosia] Add the Nicosia-specific PlatformLayer type alias >Index: Source/WebCore/dom/Element.h >=================================================================== >--- Source/WebCore/dom/Element.h (revision 234683) >+++ Source/WebCore/dom/Element.h (working copy) >@@ -823,7 +823,7 @@ template<typename... QualifiedNames> > inline const AtomicString& Element::getAttribute(const QualifiedName& name, const QualifiedNames&... names) const > { > const AtomicString& value = getAttribute(name); >- if (!value.isEmpty()) >+ if (!value.isNull()) > return value; > return getAttribute(names...); > } >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 234683) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2018-08-08 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Followup (r234683): Element::getAttribute() should return the first non-null attribute value >+ https://bugs.webkit.org/show_bug.cgi?id=188419 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * svg/custom/href-svg-namespace-empty-expected.txt: Added. >+ * svg/custom/href-svg-namespace-empty.html: Added. >+ > 2018-08-07 Said Abou-Hallawa <sabouhallawa@apple.com> > > Allow href attribute without xlink on SVG elements >Index: LayoutTests/svg/custom/href-svg-namespace-empty-expected.txt >=================================================================== >--- LayoutTests/svg/custom/href-svg-namespace-empty-expected.txt (nonexistent) >+++ LayoutTests/svg/custom/href-svg-namespace-empty-expected.txt (working copy) >@@ -0,0 +1,19 @@ >+Test the possible cases of the svg href attribute value: null string, empty string and non-empty string. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is null >+PASS window.element.getAttribute('href') is null >+PASS window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "www.webkit.org" >+PASS window.element.getAttribute('href') is "www.webkit.org" >+PASS window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "" >+PASS window.element.getAttribute('href') is "" >+PASS window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "www.build.webkit.org" >+PASS window.element.getAttribute('href') is "www.build.webkit.org" >+PASS window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href') is "" >+PASS window.element.getAttribute('href') is "" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/svg/custom/href-svg-namespace-empty.html >=================================================================== >--- LayoutTests/svg/custom/href-svg-namespace-empty.html (nonexistent) >+++ LayoutTests/svg/custom/href-svg-namespace-empty.html (working copy) >@@ -0,0 +1,29 @@ >+<head> >+ <script src="../../resources/js-test-pre.js"></script> >+</head> >+<body> >+ <script> >+ description("Test the possible cases of the svg href attribute value: null string, empty string and non-empty string."); >+ >+ window.element = document.createElementNS("http://www.w3.org/2000/svg", "a"); >+ shouldBeNull("window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href')"); >+ shouldBeNull("window.element.getAttribute('href')"); >+ >+ window.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", "www.webkit.org"); >+ shouldBeEqualToString("window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href')", "www.webkit.org"); >+ shouldBeEqualToString("window.element.getAttribute('href')", "www.webkit.org"); >+ >+ window.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", ""); >+ shouldBeEmptyString("window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href')"); >+ shouldBeEmptyString("window.element.getAttribute('href')"); >+ >+ window.element.setAttribute("href", "www.build.webkit.org"); >+ shouldBeEqualToString("window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href')", "www.build.webkit.org"); >+ shouldBeEqualToString("window.element.getAttribute('href')", "www.build.webkit.org"); >+ >+ window.element.setAttribute("href", ""); >+ shouldBeEmptyString("window.element.getAttributeNS('http://www.w3.org/1999/xlink', 'href')"); >+ shouldBeEmptyString("window.element.getAttribute('href')"); >+ </script> >+ <script src="../../resources/js-test-post.js"></script> >+</body>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188419
: 346799