[Webkit-unassigned] [Bug 156659] CSSCursorImageValue shouldn't mutate element during style resolution

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 16 10:15:53 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156659

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #276558|review?                     |review+
              Flags|                            |

--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 276558
  --> https://bugs.webkit.org/attachment.cgi?id=276558
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=276558&action=review

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.

> Source/WebCore/css/CSSCursorImageValue.cpp:91
> +    auto* svgCursorElement = downcast<SVGCursorElement>(element);

I would use a reference:

    auto& svgCursorElement = downcast<SVGCursorElement>(*element);

> Source/WebCore/css/CSSCursorImageValue.cpp:110
> +    SVGLengthContext lengthContext(0);

Should be nullptr rather than 0.

> Source/WebCore/css/CSSCursorImageValue.cpp:112
> +    float x = roundf(cursorElement.x().value(lengthContext));

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.

> Source/WebCore/css/CSSCursorImageValue.cpp:115
> +    float y = roundf(cursorElement.y().value(lengthContext));

Ditto.

> Source/WebCore/css/CSSCursorImageValue.h:-78
> +    HashSet<SVGCursorElement*> m_svgCursorElements;
>  
> -    HashSet<SVGElement*> m_referencedElements;

There’s a stray blank line here. I suggest removing it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160416/6c0a07b8/attachment.html>


More information about the webkit-unassigned mailing list