CARVIEW |
Select Language
HTTP/2 200
content-type: text/html
x-guploader-uploadid: AAwnv3Lw_Eo5GCD_0xAEog_PNfTnefVPTM5qTeiJb8t3fiqMcf3Yr-_0h2YppGOQ5oNVRPxx
cache-control: public, max-age=3600
expires: Fri, 10 Oct 2025 18:59:11 GMT
last-modified: Fri, 10 Oct 2025 01:11:27 GMT
etag: W/"25ec31c402c996b1ac941953d88edc77"
x-goog-generation: 1760058687740163
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 166102
x-goog-meta-goog-reserved-file-mtime: 1760056929
x-goog-hash: crc32c=jJC1yw==, md5=JewxxALJlrGslBlT2I7cdw==
x-goog-storage-class: STANDARD
accept-ranges: none
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
alt-svc: clear
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
strict-transport-security: max-age=63072000
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net mdn.github.io live-samples.mdn.mozilla.net live-samples.mdn.allizom.net *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-frame-options: DENY
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
x-cloud-trace-context: d2ef1b2e87fba3aa16d603e00e7dccae
date: Fri, 10 Oct 2025 17:59:12 GMT
server: Google Frontend
via: 1.1 google
vary: Accept-Encoding
content-encoding: gzip
x-cache: miss
SVGClipPathElement: clipPathUnits プロパティ - Web API | MDN
Toggle sidebar
>
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
SVGClipPathElement: clipPathUnits プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
clipPathUnits
は SVGClipPathElement
インターフェイスの読み取り専用プロパティで、この要素のコンテンツに使用する座標系を定義する <clipPath>
要素の clipPathUnits
属性を反映します。
値
座標系を表す SVGAnimatedEnumeration
です。取りうる値は SVGUnitTypes
インターフェイスで定義されています。
0
(SVG_UNIT_TYPE_UNKNOWN
)-
型は、定義済みの型ではありません。
1
(SVG_UNIT_TYPE_USERSPACEONUSE
)-
clipPathUnits
属性のuserSpaceOnUse
の値に対応し、要素内のすべての座標は、クリップパスが作成されたときに定義されたユーザー座標系を参照することを意味します。これは既定値です。 2
(SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
)-
同属性の
objectBoundingBox
の値に対応し、要素内のすべての座標が、クリップパスが適用される要素の境界ボックスを基準とする相対座標であることを意味します。これは、座標系の原点がオブジェクトの境界ボックスの左上隅であり、オブジェクトの境界ボックスの幅と高さは 1 単位の長さであるとみなされることを意味します。
例
html,
body,
svg {
height: 100%;
}
html
<div>
<svg viewBox="0 0 100 100" width="200" height="200">
<clipPath id="clip1" clipPathUnits="userSpaceOnUse">
<circle cx="50" cy="50" r="35" />
</clipPath>
<clipPath id="clip2" clipPathUnits="objectBoundingBox">
<circle cx=".5" cy=".5" r=".35" />
</clipPath>
<!-- クリップパスに実体化するいくつかの参照長方形 -->
<rect id="r1" x="0" y="0" width="45" height="45" />
<rect id="r2" x="0" y="55" width="45" height="45" />
<rect id="r3" x="55" y="55" width="45" height="45" />
<rect id="r4" x="55" y="0" width="45" height="45" />
<!-- 最初の 3 つの長方形は、単位 userSpaceOnUse でクリップされる -->
<use clip-path="url(#clip1)" href="#r1" fill="red" />
<use clip-path="url(#clip1)" href="#r2" fill="blue" />
<use clip-path="url(#clip1)" href="#r3" fill="yellow" />
<!-- 最後の長方形は、objectBoundingBox 単位でクリップされる -->
<use clip-path="url(#clip2)" href="#r4" fill="green" />
</svg>
</div>
<pre id="log"></pre>
js
const clipPath1 = document.getElementById("clip1");
const clipPath2 = document.getElementById("clip2");
const log = document.getElementById("log");
log.textContent = `3 回使用されたクリップパスは、 'clipPathUnits' の値が ${clipPath1.clipPathUnits.baseVal} です。
1 回使用されたクリップパスは、 'clipPathUnits' の値が ${clipPath2.clipPathUnits.baseVal} です。`;
仕様書
Specification |
---|
CSS Masking Module Level 1> # dom-svgclippathelement-clippathunits> |
ブラウザーの互換性
Loading…