-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve SVGGeometryElement#{isPointInFill,isPointInStroke} examples #35746
Conversation
Preview URLs
(comment last updated: 2025-02-02 20:01:45) |
@xBZZZZ Are you going to complete this soon? |
when this question (duplicate of first comment) gets answered: What does https://jsbin.com/kopefuzace/1/edit?html,js,output |
I looked into this question. Apparently it was in the old spec: w3c/svgwg#416, but then |
better parameter description and examples (work in firefox!)
const pathEl = document.createElementNS( | ||
"http://www.w3.org/2000/svg", | ||
"path", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
const pathEl = document.createElementNS( | |
"http://www.w3.org/2000/svg", | |
"path", | |
); | |
const pathEl = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about
const pointEl = document.createElementNS(
"http://www.w3.org/2000/svg",
"circle",
);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xBZZZZ It's because the pathEl
declaration is shorter by a few characters, so it fits into an 80-character line, but pointEl
does not.
const pathEl = document.createElementNS( | ||
"http://www.w3.org/2000/svg", | ||
"path", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
const pathEl = document.createElementNS( | |
"http://www.w3.org/2000/svg", | |
"path", | |
); | |
const pathEl = document.createElementNS("http://www.w3.org/2000/svg", "path"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new examples are a huge improvement in every way. Thank you! I just pushed a little change to avoid mentioning DOMPointInit
, because we don't document dictionaries on MDN.
changed pages:
pointEl.style.r
,pointEl.style.cx
,pointEl.style.cy
because they don't exist in firefoxisPointInFill
variable that is not declared in https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/isPointInStroke#javascript{ x: point[0], y: point[1] }
instead ofnew DOMPoint(point[0], point[1])
to show that object class doesn't matter in browsers that supportDOMPoint
→DOMPointInit
in parametersWhat does
mean?Adding
pointer-events="none"
orstyle="pointer-events:none"
to big circle has no effect.