Skip to content

Commit aea8cdf

Browse files
in progress
1 parent 07336da commit aea8cdf

1 file changed

Lines changed: 67 additions & 33 deletions

File tree

index.bs

Lines changed: 67 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ urlPrefix: https://heycam.github.io/webidl/
5757
urlPrefix: #idl-; type:interface; text: double
5858
urlPrefix: #idl-; type:interface; text: undefined
5959
url: #hierarchyrequesterror; type: exception; text: HierarchyRequestError
60-
urlPrefix: https://drafts.csswg.org/css-backgrounds/
61-
url: #shadow-blur; type:dfn; text: blur
62-
url: #blur-radius; type:dfn; text: blur radius
6360
urlPrefix: https://drafts.csswg.org/css-box/
6461
url: #containing-block; type: dfn; text: containing block
6562
url: #padding-area; type: dfn; text: padding area
@@ -81,6 +78,8 @@ urlPrefix: https://drafts.csswg.org/cssom-view-1/
8178
url: #pinch-zoom; type:dfn; text: pinch zoom
8279
urlPrefix: https://drafts.csswg.org/css2/visuren.html
8380
url: #viewport; type:dfn; text: viewport
81+
urlPrefix: https://drafts.fxtf.org/filter-effects/
82+
url: #funcdef-filter-blur; type:dfn; text: blur
8483
</pre>
8584

8685
<pre class="link-defaults">
@@ -580,30 +579,30 @@ which is initialized to an empty list.
580579
This list holds <dfn interface>IntersectionObserverRegistration</dfn> records,
581580
which have:
582581
* an <dfn attribute for=IntersectionObserverRegistration>observer</dfn> property
583-
holding an {{IntersectionObserver}}.
582+
holding an {{IntersectionObserver}}.
584583
* a <dfn attribute for=IntersectionObserverRegistration>previousThresholdIndex</dfn> property
585-
holding a number between -1 and the length of the observer's {{IntersectionObserver/thresholds}} property (inclusive).
584+
holding a number between -1 and the length of the observer's {{IntersectionObserver/thresholds}} property (inclusive).
586585
* a <dfn attribute for=IntersectionObserverRegistration>previousIsIntersecting</dfn> property
587-
holding a boolean.
586+
holding a boolean.
588587
* a <dfn attribute for=IntersectionObserverRegistration>lastUpdateTime</dfn> property
589-
holding a {{DOMHighResTimeStamp}} value.
588+
holding a {{DOMHighResTimeStamp}} value.
590589
* a <dfn attribute for=IntersectionObserverRegistration>previousIsVisible</dfn> property
591-
holding a boolean.
590+
holding a boolean.
592591

593592
<h4 id='intersection-observer-private-slots'>
594593
IntersectionObserver</h4>
595594

596595
{{IntersectionObserver}} objects have the following internal slots:
597596
* A <dfn attribute for=IntersectionObserver>\[[QueuedEntries]]</dfn> slot
598-
initialized to an empty list.
597+
initialized to an empty list.
599598
* A <dfn attribute for=IntersectionObserver>\[[ObservationTargets]]</dfn> slot
600-
initialized to an empty list.
599+
initialized to an empty list.
601600
* A <dfn attribute for=IntersectionObserver>\[[callback]]</dfn> slot
602-
which is initialized by {{IntersectionObserver(callback, options)}}.
601+
which is initialized by {{IntersectionObserver(callback, options)}}.
603602
* A <dfn attribute for=IntersectionObserver>\[[rootMargin]]</dfn> slot
604-
which is a list of four pixel lengths or percentages.
603+
which is a list of four pixel lengths or percentages.
605604
* A <dfn attribute for=IntersectionObserver>\[[scrollMargin]]</dfn> slot
606-
which is a list of four pixel lengths or percentages.
605+
which is a list of four pixel lengths or percentages.
607606

608607
<h3 id='algorithms'>
609608
Algorithms</h2>
@@ -746,6 +745,32 @@ run these steps:
746745
6. Map |intersectionRect| to the coordinate space of the <a>viewport</a> of the {{document}} containing |target|.
747746
7. Return |intersectionRect|.
748747

748+
<h4 id='calculate-visibility-algo'>
749+
Compute whether a Target is unoccluded, untransformed, unfiltered, and opaque.</h4>
750+
751+
To compute the <dfn>visibility</dfn> of a <a>target</a>, run these steps:
752+
1. If the |observer|'s {{IntersectionObserver/trackVisibility}} attribute is false, return true.
753+
2. If the <a>target</a> has an <a>effective transformation matrix</a> other than a 2D translation or proportional 2D upscaling, return false.
754+
3. If the <a>target</a>, or any element in its <a>containing block chain</a>, has an effective opacity other than 100%, return false.
755+
4. If the <a>target</a>, or any element in its <a>containing block chain</a>, has any filters applied, return false.
756+
5. If the implementation cannot guarantee that the <a>target</a> is completely unoccluded by other page content, return false.
757+
758+
Note: Implementations should use the <a>ink overflow rectangle</a> of page content when determining whether a <a>target</a> is occluded. For blur effects, which have theoretically infinite extent, the <a>ink overflow rectangle</a> is defined by the finite-area approximation described for the <a>blur</a> filter function.
759+
760+
6. Return true.
761+
762+
<h4 id='calculate-effective-transformation-matrix'>Calculate a <a>target</a>'s Effective Transformation Matrix</h4>
763+
To compute the <dfn>effective transformation matrix</dfn> of a <a>target</a>, run these steps:
764+
1. Let |matrix| be the <a>serialization</a> of the <a>identity transform function</a>.
765+
2. Let |container| be the target.
766+
3. While |container| is not the <a>intersection root</a>:
767+
1. Set |t| to |container|'s <a>transformation matrix</a>.
768+
2. Set |matrix| to |t| <a>post-multiplied</a> by |matrix|.
769+
3. If |container| is the root element of a <a>nested browsing context</a>,
770+
update |container| to be the <a>browsing context container</a> of |container|. Otherwise, update |container| to be the <a>containing block</a> of |container|.
771+
4. Return |matrix|.
772+
773+
749774
<h4 id='update-intersection-observations-algo'>
750775
Run the Update Intersection Observations Steps</h4>
751776

@@ -758,45 +783,54 @@ To <dfn export>run the update intersection observations steps</dfn> for a
758783
2. For each |observer| in |observer list|:
759784
1. Let |rootBounds| be |observer|'s <a>root intersection rectangle</a>.
760785
2. For each |target| in |observer|'s internal {{[[ObservationTargets]]}} slot, processed in the same order that {{observe()}} was called on each |target|:
761-
1. Let:
786+
1. Let |registration| be the {{IntersectionObserverRegistration}} record
787+
in |target|'s internal {{[[RegisteredIntersectionObservers]]}} slot
788+
whose {{IntersectionObserverRegistration/observer}} property is equal to |observer|.
789+
2. If <code>(|time| - |registration|.{{IntersectionObserverRegistration/lastUpdateTime}} < |observer|.{{IntersectionObserver/delay}})</code>, skip further processing for |target|.
790+
3. Set |registration|.{{IntersectionObserverRegistration/lastUpdateTime}} to |time|.
791+
4. Let:
762792
- |thresholdIndex| be 0.
763793
- |isIntersecting| be false.
764794
- |targetRect| be a {{DOMRectReadOnly}} with |x|, |y|, |width|, and |height| set to 0.
765795
- |intersectionRect| be a {{DOMRectReadOnly}} with |x|, |y|, |width|, and |height| set to 0.
766-
2. If the <a>intersection root</a> is not the <a>implicit root</a>,
796+
5. If the <a>intersection root</a> is not the <a>implicit root</a>,
767797
and |target| is not in the same {{document}} as the <a>intersection root</a>,
768798
skip to step 11.
769-
3. If the <a>intersection root</a> is an {{Element}},
799+
6. If the <a>intersection root</a> is an {{Element}},
770800
and |target| is not a descendant of the <a>intersection root</a>
771801
in the <a>containing block chain</a>, skip to step 11.
772-
4. Set |targetRect| to the {{DOMRectReadOnly}} obtained by <a>getting the bounding box</a> for
802+
7. Set |targetRect| to the {{DOMRectReadOnly}} obtained by <a>getting the bounding box</a> for
773803
|target|.
774-
4. Let |intersectionRect| be the result of running the <a>compute the intersection</a>
804+
8. Let |intersectionRect| be the result of running the <a>compute the intersection</a>
775805
algorithm on |target| and |observer|'s <a>intersection root</a>.
776-
5. Let |targetArea| be |targetRect|'s area.
777-
6. Let |intersectionArea| be |intersectionRect|'s area.
778-
7. Let |isIntersecting| be true if |targetRect| and |rootBounds| intersect or are edge-adjacent,
806+
9. Let |targetArea| be |targetRect|'s area.
807+
10. Let |intersectionArea| be |intersectionRect|'s area.
808+
11. Let |isIntersecting| be true if |targetRect| and |rootBounds| intersect or are edge-adjacent,
779809
even if the intersection has zero area (because |rootBounds| or |targetRect| have
780810
zero area).
781-
9. If |targetArea| is non-zero, let |intersectionRatio| be |intersectionArea| divided by |targetArea|.<br>
811+
12. If |targetArea| is non-zero, let |intersectionRatio| be |intersectionArea| divided by |targetArea|.<br>
782812
Otherwise, let |intersectionRatio| be <code>1</code> if |isIntersecting| is true, or <code>0</code> if |isIntersecting| is false.
783-
10. Set |thresholdIndex| to the index of the first entry in |observer|.{{thresholds}} whose value is greater than |intersectionRatio|, or the length of |observer|.{{thresholds}} if |intersectionRatio| is greater than or equal to the last entry in |observer|.{{thresholds}}.
784-
11. Let |intersectionObserverRegistration| be the {{IntersectionObserverRegistration}} record
785-
in |target|'s internal {{[[RegisteredIntersectionObservers]]}} slot
786-
whose {{IntersectionObserverRegistration/observer}} property is equal to |observer|.
787-
12. Let |previousThresholdIndex| be the |intersectionObserverRegistration|'s
813+
13. Set |thresholdIndex| to the index of the first entry in |observer|.{{thresholds}} whose value is greater than |intersectionRatio|, or the length of |observer|.{{thresholds}} if |intersectionRatio| is greater than or equal to the last entry in |observer|.{{thresholds}}.
814+
14. Let |isVisible| be the result of running the <a>visibility</a> algorithm on |target|.
815+
15. Let |previousThresholdIndex| be the |registration|'s
788816
{{IntersectionObserverRegistration/previousThresholdIndex}} property.
789-
13. Let |previousIsIntersecting| be the |intersectionObserverRegistration|'s
817+
16. Let |previousIsIntersecting| be the |registration|'s
790818
{{IntersectionObserverRegistration/previousIsIntersecting}} property.
791-
14. If |thresholdIndex| does not equal |previousThresholdIndex| or if
792-
|isIntersecting| does not equal |previousIsIntersecting|,
819+
17. Let |previousIsVisible| be the |registration|'s
820+
{{IntersectionObserverRegistration/previousIsVisible}} property.
821+
18. If |thresholdIndex| does not equal |previousThresholdIndex|,
822+
or if |isIntersecting| does not equal |previousIsIntersecting|,
823+
or if |isVisible| does not equal |previousIsVisible|,
793824
<a>queue an IntersectionObserverEntry</a>,
794825
passing in |observer|, |time|, |rootBounds|,
795-
|targetRect|, |intersectionRect|, |isIntersecting|, and |target|.
796-
15. Assign |thresholdIndex| to |intersectionObserverRegistration|'s
826+
|targetRect|, |intersectionRect|, |isIntersecting|,
827+
|isVisible|, and |target|.
828+
19. Assign |thresholdIndex| to |registration|'s
797829
{{IntersectionObserverRegistration/previousThresholdIndex}} property.
798-
16. Assign |isIntersecting| to |intersectionObserverRegistration|'s
830+
20. Assign |isIntersecting| to |registration|'s
799831
{{IntersectionObserverRegistration/previousIsIntersecting}} property.
832+
21. Assign |isVisible| to |registration|'s
833+
{{IntersectionObserverRegistration/previousIsVisible}} property.
800834

801835
<h3 id='lifetime'>
802836
IntersectionObserver Lifetime</h2>

0 commit comments

Comments
 (0)