Skip to content
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

SVGGeometryElement.prototype.{isPointInFill,isPointInStroke} #35746

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xBZZZZ
Copy link
Contributor

@xBZZZZ xBZZZZ commented Sep 4, 2024

changed pages:


  • changed examples:
    • don't use pointEl.style.r, pointEl.style.cx, pointEl.style.cy because they don't exist in firefox
    • don't use isPointInFill variable that is not declared in https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/isPointInStroke#javascript
    • use { x: point[0], y: point[1] } instead of new DOMPoint(point[0], point[1]) to show that object class doesn't matter in browsers that support Accepts a DOMPoint as point parameter
    • look different to see region where fill and stroke overlap
  • changed DOMPointDOMPointInit in parameters

What does Normal hit testing rules apply; the value of the pointer-events property on the element determines
whether a point is considered to be within the fill.
mean?
Adding pointer-events="none" or style="pointer-events:none" to big circle has no effect.

better parameter destription and examples (work in firefox!)
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Sep 4, 2024
];

for (const point of points) {
let isPointInFill;

try {
const pointObj = new DOMPoint(point[0], point[1]);
const pointObj = {x: point[0], y: point[1]};
Copy link
Contributor

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 🐶

Suggested change
const pointObj = {x: point[0], y: point[1]};
const pointObj = { x: point[0], y: point[1] };

];

for (const point of points) {
let isPointInStroke;

try {
const pointObj = new DOMPoint(point[0], point[1]);
isPointInFill = circle.isPointInStroke(pointObj);
const pointObj = {x: point[0], y: point[1]};
Copy link
Contributor

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 🐶

Suggested change
const pointObj = {x: point[0], y: point[1]};
const pointObj = { x: point[0], y: point[1] };

Copy link
Contributor

github-actions bot commented Sep 4, 2024

Preview URLs

Flaws (2)

URL: /en-US/docs/Web/API/SVGGeometryElement/isPointInFill
Title: SVGGeometryElement: isPointInFill() method
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/DOMPointInit redirects to /en-US/docs/Web/API/DOMPoint/fromPoint_static

URL: /en-US/docs/Web/API/SVGGeometryElement/isPointInStroke
Title: SVGGeometryElement: isPointInStroke() method
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/DOMPointInit redirects to /en-US/docs/Web/API/DOMPoint/fromPoint_static

(comment last updated: 2024-09-04 17:36:45)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant