Bug 249323
Summary: | Make Attr.value/nodeValue/textContent not nullable | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | cdumez, karlcow, rniwa, webkit-bug-importer |
Priority: | P2 | Keywords: | BrowserCompat, InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ahmad Saleem
Hi Team,
While going through Blink's commit, I noted another bug where we differ from other browsers:
Test Case - http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3528
Blink Commit - https://chromium.googlesource.com/chromium/blink/+/a7c3bb9f22401c30e906a3ec53595247e707de83
*** Safari 16.2 / STP 159 ***
log: attr.value=null => getAttribute()=="null"
log: attr.nodeValue=null => getAttribute()==null
log: attr.textContent=null => getAttribute()==null
rendering mode: CSS1Compat
document has no title
*** Chrome Canary 110 & Firefox Nightly 110 ***
log: attr.value=null => getAttribute()=="null"
log: attr.nodeValue=null => getAttribute()==""
log: attr.textContent=null => getAttribute()==""
rendering mode: CSS1Compat
document has no title
_____
Just wanted to raise it for future purposes.
Thanks!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
It seems like a good change to merge.
Ahmad Saleem
(In reply to Ryosuke Niwa from comment #1)
> It seems like a good change to merge.
Cool! I will give it a go later today. Thanks for your input! I usually don't touch IDL files (fear of unknown). :-)
Radar WebKit Bug Importer
<rdar://problem/103602803>
Ahmad Saleem
void Attr::setNodeValue(const String& value)
{
const AtomString valueWithoutNull = value.isNull() ? emptyAtom() : AtomString(value);
setValue(valueWithoutNull);
}
^ This fixes failing test case locally. Can do PR later. Thanks!
EWS
Committed 265769@main (2da4c96001cf): <https://commits.webkit.org/265769@main>
Reviewed commits have been landed. Closing PR #15550 and removing active labels.