Skip to content

Commit e9fd7a0

Browse files
New pages: SVGFEOffsetElement (#37422)
* New pages: SVGFEOffsetElement * typo * Apply suggestions from code review --------- Co-authored-by: sideshowbarker <[email protected]>
1 parent 7527a11 commit e9fd7a0

File tree

5 files changed

+190
-0
lines changed

5 files changed

+190
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: "SVGFEOffsetElement: height property"
3+
short-title: height
4+
slug: Web/API/SVGFEOffsetElement/height
5+
page-type: web-api-instance-property
6+
browser-compat: api.SVGFEOffsetElement.height
7+
---
8+
9+
{{APIRef("SVG")}}
10+
11+
The **`height`** read-only property of the {{domxref("SVGFEOffsetElement")}} interface describes the vertical size of an SVG filter primitive as an {{domxref("SVGAnimatedLength")}}.
12+
13+
It reflects the {{SVGAttr("height")}} attribute of the {{SVGElement("feOffset")}} element, which offsets the input image relative to its current position. The attribute is a [`<length>`](/en-US/docs/Web/SVG/Content_type#length) or a [`<percentage>`](/en-US/docs/Web/SVG/Content_type#percentage) relative to the height of the filter region. The default value is `100%`. The property value is a length in user coordinate system units.
14+
15+
## Value
16+
17+
An {{domxref("SVGAnimatedLength")}}.
18+
19+
## Example
20+
21+
```js
22+
const feOffset = document.querySelector("feOffset");
23+
const verticalSize = feOffset.height;
24+
console.log(verticalSize.baseVal.value); // the `height` value
25+
```
26+
27+
## Specifications
28+
29+
{{Specifications}}
30+
31+
## Browser compatibility
32+
33+
{{Compat}}
34+
35+
## See also
36+
37+
- {{domxref("SVGFEOffsetElement.width")}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "SVGFEOffsetElement: result property"
3+
short-title: result
4+
slug: Web/API/SVGFEOffsetElement/result
5+
page-type: web-api-instance-property
6+
browser-compat: api.SVGFEOffsetElement.result
7+
---
8+
9+
{{APIRef("SVG")}}
10+
11+
The **`result`** read-only property of the {{domxref("SVGFEOffsetElement")}} interface describes the assigned name of an SVG filter primitive as an {{domxref("SVGAnimatedString")}}.
12+
13+
It reflects the {{SVGAttr("result")}} attribute of the {{SVGElement("feOffset")}} element, which offsets the input image relative to its current position. The attribute value is a {{cssxref("custom-ident")}}. If supplied, then graphics that result from processing this filter primitive can be referenced by an {{SVGAttr("in")}} attribute on a subsequent filter primitive within the same {{SVGElement("filter")}} element.
14+
15+
If no `result` attribute is defined, the filter's `result.baseVal` and `result.animVal` are empty strings, and the output of the `<feOffset>` filter will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its `in` attribute.
16+
17+
## Value
18+
19+
An {{domxref("SVGAnimatedString")}}.
20+
21+
## Example
22+
23+
```js
24+
const feOffsetElement = document.querySelector("feOffset");
25+
const filterName = feOffsetElement.result;
26+
console.log(filterName.baseVal); // the filter's assigned name
27+
```
28+
29+
## Specifications
30+
31+
{{Specifications}}
32+
33+
## Browser compatibility
34+
35+
{{Compat}}
36+
37+
## See also
38+
39+
- {{domxref("SVGFEOffsetElement.in1")}}
40+
- {{cssxref("custom-ident")}} data type
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: "SVGFEOffsetElement: width property"
3+
short-title: width
4+
slug: Web/API/SVGFEOffsetElement/width
5+
page-type: web-api-instance-property
6+
browser-compat: api.SVGFEOffsetElement.width
7+
---
8+
9+
{{APIRef("SVG")}}
10+
11+
The **`width`** read-only property of the {{domxref("SVGFEOffsetElement")}} interface describes the horizontal size of an SVG filter primitive as a {{domxref("SVGAnimatedLength")}}.
12+
13+
It reflects the {{SVGAttr("width")}} attribute of the {{SVGElement("feOffset")}} element, which offsets the input image relative to its current position. The attribute is a [`<length>`](/en-US/docs/Web/SVG/Content_type#length) or a [`<percentage>`](/en-US/docs/Web/SVG/Content_type#percentage) relative to the width of the filter region. The default value is `100%`. The property value is a length in user coordinate system units.
14+
15+
## Value
16+
17+
An {{domxref("SVGAnimatedLength")}}.
18+
19+
## Example
20+
21+
```js
22+
const feOffset = document.querySelector("feOffset");
23+
const horizontalSize = feOffset.width;
24+
console.log(horizontalSize.baseVal.value); // the `width` value
25+
```
26+
27+
## Specifications
28+
29+
{{Specifications}}
30+
31+
## Browser compatibility
32+
33+
{{Compat}}
34+
35+
## See also
36+
37+
- {{domxref("SVGFEOffsetElement.height")}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: "SVGFEOffsetElement: x property"
3+
short-title: x
4+
slug: Web/API/SVGFEOffsetElement/x
5+
page-type: web-api-instance-property
6+
browser-compat: api.SVGFEOffsetElement.x
7+
---
8+
9+
{{APIRef("SVG")}}
10+
11+
The **`x`** read-only property of the {{domxref("SVGFEOffsetElement")}} interface describes the horizontal coordinate of the position of an SVG filter primitive as a {{domxref("SVGAnimatedLength")}}.
12+
13+
It reflects the {{SVGAttr("x")}} attribute of the {{SVGElement("feOffset")}} element, which offsets the input image relative to its current position. The attribute is a [`<length>`](/en-US/docs/Web/SVG/Content_type#length) or [`<percentage>`](/en-US/docs/Web/SVG/Content_type#percentage). The `<coordinate>` is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the x-axis. If the `x` attribute is a percent value, the property value is relative to the width of the filter region in user coordinate system units. The default value is `0`.
14+
15+
## Value
16+
17+
An {{domxref("SVGAnimatedLength")}}.
18+
19+
## Example
20+
21+
```js
22+
const feOffset = document.querySelector("feOffset");
23+
const leftPosition = feOffset.x;
24+
console.log(leftPosition.baseVal.value); // the `x` value
25+
```
26+
27+
## Specifications
28+
29+
{{Specifications}}
30+
31+
## Browser compatibility
32+
33+
{{Compat}}
34+
35+
## See also
36+
37+
- {{domxref("SVGFEOffsetElement.y")}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "SVGFEOffsetElement: y property"
3+
short-title: "y"
4+
slug: Web/API/SVGFEOffsetElement/y
5+
page-type: web-api-instance-property
6+
browser-compat: api.SVGFEOffsetElement.y
7+
---
8+
9+
{{APIRef("SVG")}}
10+
11+
The **`y`** read-only property of the {{domxref("SVGFEOffsetElement")}} interface describes the vertical coordinate of the position of an SVG filter primitive as a {{domxref("SVGAnimatedLength")}}.
12+
13+
It reflects the {{SVGAttr("y")}} attribute of the {{SVGElement("feOffset")}} element, which offsets the input image relative to its current position. The attribute is a [`<length>`](/en-US/docs/Web/SVG/Content_type#length) or [`<percentage>`](/en-US/docs/Web/SVG/Content_type#percentage). The `<coordinate>` is a length in the user coordinate system that is the given distance from the origin of the filter along the y-axis. If the `y` attribute is a percent value, the property value is a relative to the height of the filter region in user coordinate system units. The default value is `0`.
14+
15+
## Value
16+
17+
An {{domxref("SVGAnimatedLength")}}.
18+
19+
## Example
20+
21+
```js
22+
const feOffset = document.querySelector("feOffset");
23+
const topPosition = feOffset.y;
24+
console.log(topPosition.baseVal.value); // the `y` value
25+
```
26+
27+
## Specifications
28+
29+
{{Specifications}}
30+
31+
## Browser compatibility
32+
33+
{{Compat}}
34+
35+
## See also
36+
37+
- {{domxref("SVGFEOffsetElement.x")}}
38+
- CSS {{cssxref("blend-mode")}} data type
39+
- CSS {{cssxref("mix-blend-mode")}} property

0 commit comments

Comments
 (0)