<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - CSSCursorImageValue shouldn't mutate element during style resolution"
href="https://bugs.webkit.org/show_bug.cgi?id=156659">bug 156659</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #276558 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - CSSCursorImageValue shouldn't mutate element during style resolution"
href="https://bugs.webkit.org/show_bug.cgi?id=156659#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - CSSCursorImageValue shouldn't mutate element during style resolution"
href="https://bugs.webkit.org/show_bug.cgi?id=156659">bug 156659</a>
from <span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=276558&action=diff" name="attach_276558" title="patch">attachment 276558</a> <a href="attachment.cgi?id=276558&action=edit" title="patch">[details]</a></span>
patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=276558&action=review">https://bugs.webkit.org/attachment.cgi?id=276558&action=review</a>
I would probably refer to these as "cursor elements" rather than "SVG cursor elements" even more consistently in the code. Names like m_cursorElements and updateCursorElement would be nicer than m_svgCursorElements and updateSVGCursorElement. Type would still make it clear it’s specific to SVG.
<span class="quote">> Source/WebCore/css/CSSCursorImageValue.cpp:91
> + auto* svgCursorElement = downcast<SVGCursorElement>(element);</span >
I would use a reference:
auto& svgCursorElement = downcast<SVGCursorElement>(*element);
<span class="quote">> Source/WebCore/css/CSSCursorImageValue.cpp:110
> + SVGLengthContext lengthContext(0);</span >
Should be nullptr rather than 0.
<span class="quote">> Source/WebCore/css/CSSCursorImageValue.cpp:112
> + float x = roundf(cursorElement.x().value(lengthContext));</span >
I suggest using std::round instead of roundf. Also not sure if rounding is correct. Also wondering if we should clamp to the size of the image.
<span class="quote">> Source/WebCore/css/CSSCursorImageValue.cpp:115
> + float y = roundf(cursorElement.y().value(lengthContext));</span >
Ditto.
<span class="quote">> Source/WebCore/css/CSSCursorImageValue.h:-78
> + HashSet<SVGCursorElement*> m_svgCursorElements;
>
> - HashSet<SVGElement*> m_referencedElements;</span >
There’s a stray blank line here. I suggest removing it.</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>