Changeset 235459 in webkit
- Timestamp:
- Aug 29, 2018 5:36:15 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r235458 r235459 1 2018-08-29 Ali Juma <ajuma@chromium.org> 2 3 [IntersectionObserver] Implement intersection logic for the same-document implicit root case 4 https://bugs.webkit.org/show_bug.cgi?id=189055 5 6 Reviewed by Simon Fraser. 7 8 Rebaseline tests. 9 10 * web-platform-tests/intersection-observer/display-none-expected.txt: 11 * web-platform-tests/intersection-observer/inline-client-rect-expected.txt: 12 * web-platform-tests/intersection-observer/multiple-targets-expected.txt: 13 * web-platform-tests/intersection-observer/multiple-thresholds-expected.txt: 14 * web-platform-tests/intersection-observer/observer-without-js-reference-expected.txt: 15 * web-platform-tests/intersection-observer/root-margin-expected.txt: 16 * web-platform-tests/intersection-observer/same-document-no-root-expected.txt: 17 * web-platform-tests/intersection-observer/same-document-zero-size-target-expected.txt: 18 * web-platform-tests/intersection-observer/shadow-content-expected.txt: 19 * web-platform-tests/intersection-observer/text-target-expected.txt: 20 * web-platform-tests/intersection-observer/zero-area-element-hidden-expected.txt: 21 1 22 2018-08-28 Ryosuke Niwa <rniwa@webkit.org> 2 23 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/display-none-expected.txt
r235014 r235459 1 1 2 2 PASS IntersectionObserver should send a not-intersecting notification for a target that gets display:none. 3 FAIL Intersecting notification after first rAF. assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 4 FAIL Not-intersecting notification after setting display:none on target. assert_equals: entries.length expected 2 but got 1 5 FAIL Intersecting notification after removing display:none on target. assert_equals: entries.length expected 3 but got 1 3 PASS Intersecting notification after first rAF. 4 PASS Not-intersecting notification after setting display:none on target. 5 PASS Intersecting notification after removing display:none on target. 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/inline-client-rect-expected.txt
r235014 r235459 2 2 3 3 PASS Inline target 4 FAIL First rAF assert_equals: entries[0].boundingClientRect.left expected 320 but got 0 5 FAIL scroller.scrollLeft = 90 assert_equals: entries.length expected 2 but got 1 4 PASS First rAF 5 PASS scroller.scrollLeft = 90 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/multiple-targets-expected.txt
r235014 r235459 2 2 PASS One observer with multiple targets. 3 3 PASS First rAF. 4 FAIL document.scrollingElement.scrollTop = 150 assert_equals: Four notifications. expected 4 but got 3 5 FAIL document.scrollingElement.scrollTop = 10000 assert_equals: Six notifications. expected 6 but got 3 6 FAIL document.scrollingElement.scrollTop = 0 assert_equals: Nine notifications. expected 9 but got 3 4 PASS document.scrollingElement.scrollTop = 150 5 PASS document.scrollingElement.scrollTop = 10000 6 PASS document.scrollingElement.scrollTop = 0 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/multiple-thresholds-expected.txt
r235014 r235459 1 1 2 2 PASS Observer with multiple thresholds. 3 FAIL First rAF. assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 4 FAIL document.scrollingElement.scrollTop = 120 assert_equals: entries.length expected 2 but got 1 5 FAIL document.scrollingElement.scrollTop = 160 assert_equals: entries.length expected 3 but got 1 6 FAIL document.scrollingElement.scrollTop = 200 assert_equals: entries.length expected 4 but got 1 7 FAIL document.scrollingElement.scrollTop = 240 assert_equals: entries.length expected 5 but got 1 8 FAIL document.scrollingElement.scrollTop = window.innerHeight + 140 assert_equals: entries.length expected 6 but got 1 9 FAIL document.scrollingElement.scrollTop = window.innerHeight + 160 assert_equals: entries.length expected 7 but got 1 10 FAIL document.scrollingElement.scrollTop = window.innerHeight + 200 assert_equals: entries.length expected 8 but got 1 3 PASS First rAF. 4 PASS document.scrollingElement.scrollTop = 120 5 PASS document.scrollingElement.scrollTop = 160 6 PASS document.scrollingElement.scrollTop = 200 7 PASS document.scrollingElement.scrollTop = 240 8 PASS document.scrollingElement.scrollTop = window.innerHeight + 140 9 PASS document.scrollingElement.scrollTop = window.innerHeight + 160 10 PASS document.scrollingElement.scrollTop = window.innerHeight + 200 11 PASS document.scrollingElement.scrollTop = window.innerHeight + 220 11 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/observer-without-js-reference-expected.txt
r235014 r235459 2 2 PASS IntersectionObserver that is unreachable in js should still generate notifications. 3 3 PASS First rAF 4 FAIL document.scrollingElement.scrollTop = 300 assert_equals: Two notifications. expected 2 but got 1 4 PASS document.scrollingElement.scrollTop = 300 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/root-margin-expected.txt
r235014 r235459 2 2 3 3 PASS Root margin tests 4 FAIL First rAF. assert_equals: entries[0]. boundingClientRect.left expected 972but got 04 FAIL First rAF. assert_equals: entries[0].rootBounds.left expected -30 but got 0 5 5 FAIL document.scrollingElement.scrollLeft = 100 assert_equals: entries.length expected 2 but got 1 6 6 FAIL document.scrollingElement.scrollTop = document.documentElement.clientHeight + 200 assert_equals: entries.length expected 2 but got 1 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-no-root-expected.txt
r235014 r235459 1 1 2 2 PASS IntersectionObserver in a single document using the implicit root. 3 FAIL First rAF. assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 4 FAIL document.scrollingElement.scrollTop = 300 assert_equals: entries.length expected 2 but got 1 5 FAIL document.scrollingElement.scrollTop = 100 assert_equals: entries.length expected 3 but got 1 3 PASS First rAF. 4 PASS document.scrollingElement.scrollTop = 300 5 PASS document.scrollingElement.scrollTop = 100 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/same-document-zero-size-target-expected.txt
r235014 r235459 1 1 2 2 PASS Observing a zero-area target. 3 FAIL First rAF assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 3 PASS First rAF 4 4 FAIL document.scrollingElement.scrollTop = 300 assert_equals: entries.length expected 2 but got 1 5 5 FAIL document.scrollingElement.scrollTop = 100 assert_equals: entries.length expected 3 but got 1 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/shadow-content-expected.txt
r235014 r235459 1 1 2 2 PASS Observing a target inside shadow DOM. 3 FAIL First rAF after creating shadow DOM. assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 3 PASS First rAF after creating shadow DOM. 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/text-target-expected.txt
r235014 r235459 2 2 3 3 PASS IntersectionObserver observing a br element. 4 FAIL First rAF. assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 4 PASS First rAF. 5 5 FAIL document.scrollingElement.scrollTop = 300 assert_equals: entries.length expected 2 but got 1 6 6 FAIL document.scrollingElement.scrollTop = 100 assert_equals: entries.length expected 3 but got 1 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/zero-area-element-hidden-expected.txt
r235014 r235459 1 1 2 2 PASS A zero-area hidden target should not be intersecting. 3 FAIL First rAF. assert_equals: entries[0].boundingClientRect.left expected 8 but got 0 3 PASS First rAF. 4 4 -
trunk/Source/WebCore/ChangeLog
r235458 r235459 1 2018-08-29 Ali Juma <ajuma@chromium.org> 2 3 [IntersectionObserver] Implement intersection logic for the same-document implicit root case 4 https://bugs.webkit.org/show_bug.cgi?id=189055 5 6 Reviewed by Simon Fraser. 7 8 Extend the intersection logic to handle computing the intersection of the target and the 9 viewport, for the case where the target is in the main frame. 10 11 Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer. 12 13 * dom/Document.cpp: 14 (WebCore::computeIntersectionRects): 15 (WebCore::Document::updateIntersectionObservations): 16 1 17 2018-08-28 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Source/WebCore/dom/Document.cpp
r235424 r235459 7445 7445 } 7446 7446 7447 static void computeIntersectionRects(IntersectionObserver& observer, Element& target, FloatRect& absTargetRect, FloatRect& absIntersectionRect, FloatRect& absRootBounds) 7448 { 7449 // FIXME: Implement intersection computation for the case of an implicit root. 7450 if (!observer.root()) 7451 return; 7452 7453 if (observer.root()->document() != target.document()) 7454 return; 7455 7456 if (!observer.root()->renderer() || !is<RenderBlock>(observer.root()->renderer())) 7457 return; 7458 7459 RenderBlock* rootRenderer = downcast<RenderBlock>(observer.root()->renderer()); 7447 static void computeIntersectionRects(FrameView& frameView, IntersectionObserver& observer, Element& target, FloatRect& absTargetRect, FloatRect& absIntersectionRect, FloatRect& absRootBounds) 7448 { 7449 // FIXME: Implement intersection computation for the cross-document case. 7450 if (observer.trackingDocument() != &target.document()) 7451 return; 7460 7452 7461 7453 auto* targetRenderer = target.renderer(); … … 7463 7455 return; 7464 7456 7465 if (!rootRenderer->isContainingBlockAncestorFor(*targetRenderer))7466 return;7467 7468 7457 // FIXME: Expand localRootBounds using the observer's rootMargin. 7469 7458 FloatRect localRootBounds; 7470 if (rootRenderer->hasOverflowClip()) 7471 localRootBounds = rootRenderer->contentBoxRect(); 7472 else 7473 localRootBounds = { FloatPoint(), rootRenderer->size() }; 7459 RenderBlock* rootRenderer; 7460 if (observer.root()) { 7461 if (!observer.root()->renderer() || !is<RenderBlock>(observer.root()->renderer())) 7462 return; 7463 7464 rootRenderer = downcast<RenderBlock>(observer.root()->renderer()); 7465 if (!rootRenderer->isContainingBlockAncestorFor(*targetRenderer)) 7466 return; 7467 7468 if (rootRenderer->hasOverflowClip()) 7469 localRootBounds = rootRenderer->contentBoxRect(); 7470 else 7471 localRootBounds = { FloatPoint(), rootRenderer->size() }; 7472 } else { 7473 ASSERT(frameView.frame().isMainFrame()); 7474 rootRenderer = frameView.renderView(); 7475 localRootBounds = frameView.layoutViewportRect(); 7476 } 7474 7477 7475 7478 LayoutRect localTargetBounds; … … 7520 7523 FloatRect absIntersectionRect; 7521 7524 FloatRect absRootBounds; 7522 computeIntersectionRects(* observer, *target, absTargetRect, absIntersectionRect, absRootBounds);7525 computeIntersectionRects(*frameView, *observer, *target, absTargetRect, absIntersectionRect, absRootBounds); 7523 7526 7524 7527 // FIXME: Handle zero-area intersections (e.g., intersections involving zero-area targets). … … 7534 7537 if (!registration.previousThresholdIndex || thresholdIndex != registration.previousThresholdIndex) { 7535 7538 FloatRect targetBoundingClientRect = frameView->absoluteToClientRect(absTargetRect); 7536 FloatRect clientIntersectionRect = frameView->absoluteToClientRect(absIntersectionRect);7539 FloatRect clientIntersectionRect = isIntersecting ? frameView->absoluteToClientRect(absIntersectionRect) : FloatRect(); 7537 7540 7538 7541 // FIXME: Once cross-document observation is implemented, only report root bounds if the target document and
Note: See TracChangeset
for help on using the changeset viewer.