Changeset 235943 in webkit
- Timestamp:
- Sep 12, 2018 10:03:13 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r235923 r235943 1 2018-09-12 Ali Juma <ajuma@chromium.org> 2 3 [IntersectionObserver] Implement rootMargin expansion 4 https://bugs.webkit.org/show_bug.cgi?id=189525 5 6 Reviewed by Simon Fraser. 7 8 Rebasline expectation for test that now passes. 9 10 * web-platform-tests/intersection-observer/root-margin-expected.txt: 11 1 12 2018-09-11 Ali Juma <ajuma@chromium.org> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/intersection-observer/root-margin-expected.txt
r235459 r235943 2 2 3 3 PASS Root margin tests 4 FAIL First rAF. assert_equals: entries[0].rootBounds.left expected -30 but got 0 5 FAIL document.scrollingElement.scrollLeft = 100 assert_equals: entries.length expected 2 but got 1 6 FAIL document.scrollingElement.scrollTop = document.documentElement.clientHeight + 200 assert_equals: entries.length expected 2 but got 1 7 FAIL document.scrollingElement.scrollTop = document.documentElement.clientHeight + 300 assert_equals: entries.length expected 3 but got 1 4 PASS First rAF. 5 PASS document.scrollingElement.scrollLeft = 100 6 PASS document.scrollingElement.scrollTop = document.documentElement.clientHeight + 200 7 PASS document.scrollingElement.scrollTop = document.documentElement.clientHeight + 300 8 8 -
trunk/Source/WebCore/ChangeLog
r235942 r235943 1 2018-09-12 Ali Juma <ajuma@chromium.org> 2 3 [IntersectionObserver] Implement rootMargin expansion 4 https://bugs.webkit.org/show_bug.cgi?id=189525 5 6 Reviewed by Simon Fraser. 7 8 Expand the root intersection rectangle by the observer's rootMargin when computing 9 intersections. 10 11 Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html 12 13 * dom/Document.cpp: 14 (WebCore::expandRootBoundsWithRootMargin): 15 (WebCore::computeIntersectionRects): 16 * page/IntersectionObserver.h: 17 (WebCore::IntersectionObserver::rootMarginBox const): 18 * platform/graphics/FloatRect.h: 19 (WebCore::FloatRect::expand): 20 1 21 2018-09-12 Fujii Hironori <Hironori.Fujii@sony.com> 2 22 -
trunk/Source/WebCore/dom/Document.cpp
r235863 r235943 7486 7486 } 7487 7487 7488 static void expandRootBoundsWithRootMargin(FloatRect& localRootBounds, const LengthBox& rootMargin) 7489 { 7490 FloatBoxExtent rootMarginFloatBox( 7491 floatValueForLength(rootMargin.top(), localRootBounds.height()), 7492 floatValueForLength(rootMargin.right(), localRootBounds.width()), 7493 floatValueForLength(rootMargin.bottom(), localRootBounds.height()), 7494 floatValueForLength(rootMargin.left(), localRootBounds.width()) 7495 ); 7496 7497 localRootBounds.expand(rootMarginFloatBox); 7498 } 7499 7488 7500 static void computeIntersectionRects(FrameView& frameView, IntersectionObserver& observer, Element& target, FloatRect& absTargetRect, FloatRect& absIntersectionRect, FloatRect& absRootBounds) 7489 7501 { … … 7496 7508 return; 7497 7509 7498 // FIXME: Expand localRootBounds using the observer's rootMargin.7499 7510 FloatRect localRootBounds; 7500 7511 RenderBlock* rootRenderer; … … 7516 7527 localRootBounds = frameView.layoutViewportRect(); 7517 7528 } 7529 7530 expandRootBoundsWithRootMargin(localRootBounds, observer.rootMarginBox()); 7518 7531 7519 7532 LayoutRect localTargetBounds; -
trunk/Source/WebCore/page/IntersectionObserver.h
r235736 r235943 73 73 Element* root() const { return m_root; } 74 74 String rootMargin() const; 75 const LengthBox& rootMarginBox() const { return m_rootMargin; } 75 76 const Vector<double>& thresholds() const { return m_thresholds; } 76 77 const Vector<Element*> observationTargets() const { return m_observationTargets; } -
trunk/Source/WebCore/platform/graphics/FloatRect.h
r235840 r235943 28 28 29 29 #include "FloatPoint.h" 30 #include "LengthBox.h" 30 31 31 32 #if USE(CG) … … 109 110 110 111 void expand(const FloatSize& size) { m_size += size; } 112 void expand(const FloatBoxExtent& box) 113 { 114 m_location.move(-box.left(), -box.top()); 115 m_size.expand(box.left() + box.right(), box.top() + box.bottom()); 116 } 111 117 void expand(float dw, float dh) { m_size.expand(dw, dh); } 112 118 void contract(const FloatSize& size) { m_size -= size; }
Note: See TracChangeset
for help on using the changeset viewer.