<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Link preview doesn't work on XHTML pages with Content-Type header as `application/xhtml+xml`"
href="https://bugs.webkit.org/show_bug.cgi?id=150740#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Link preview doesn't work on XHTML pages with Content-Type header as `application/xhtml+xml`"
href="https://bugs.webkit.org/show_bug.cgi?id=150740">bug 150740</a>
from <span class="vcard"><a class="email" href="mailto:bdakin@apple.com" title="Beth Dakin <bdakin@apple.com>"> <span class="fn">Beth Dakin</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=150740#c7">comment #7</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=150740#c6">comment #6</a>)
> > Is it really correct to just check the tag name, or is this one of those
> > cases where XML namespaces should be taken into account?
>
> I was planning to comment on that but had lost track of this bug. Thanks for
> drawing my attention back here! As Dan implies, this new code is incorrect
> in the presence of non-HTML elements that happen to have the same local name
> as HTML elements.
>
> This clickableElementName field is apparently a copy of the DOM nodeName
> attribute, shipped across processes. We can’t use nodeName alone to check if
> something is a particular HTML element.
>
> If our intent is to use this attribute to check if something is a particular
> HTML element, then I suggest we replace this code:
>
> info.clickableElementName = hitNode->nodeName();
>
> With something more like this:
>
> if (is<HTMLElement>(*hitNode))
> info.clickableElementName =
> downcast<HTMLElement>(*hitNode).localName();
>
> This will always be lowercase, and so there will be no need to fold case on
> the UI process side.
>
> If it happens that we want to use this for SVG elements as well, and there
> is also no practical concern about collision between HTML and SVG local
> names (I think there are very few such collisions), then it could instead be
> this:
>
> if (is<HTMLElement>(*hitNode) || is<SVGElement>(*hitNode))
> info.clickableElementName = downcast<Element>(*hitNode).localName();</span >
Thanks Darin and Dan! I will fix this.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>