Changeset 234732 in webkit
- Timestamp:
- Aug 9, 2018 12:36:38 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r234728 r234732 1 2018-08-09 Ali Juma <ajuma@chromium.org> 2 3 Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit 4 https://bugs.webkit.org/show_bug.cgi?id=188445 5 6 Reviewed by Simon Fraser. 7 8 * intersection-observer/intersection-observer-entry-interface-expected.txt: 9 * intersection-observer/intersection-observer-entry-interface.html: 10 1 11 2018-08-08 Keith Miller <keith_miller@apple.com> 2 12 -
trunk/LayoutTests/intersection-observer/intersection-observer-entry-interface-expected.txt
r208181 r234732 3 3 PASS ConstructorTime 4 4 PASS ConstructorRootBounds 5 PASS ConstructorNullRootBounds 5 6 PASS ConstructorBoundingClientRect 6 7 PASS ConstructorIntersectionRect 7 PASS ConstructorTime 8 PASS ConstructorIsIntersecting 9 PASS ConstructorIntersectionRatio 10 PASS ConstructorTarget 8 11 -
trunk/LayoutTests/intersection-observer/intersection-observer-entry-interface.html
r208983 r234732 16 16 boundingClientRect: { x: 110, y: 112.7, width: 1130, height: 1140 }, 17 17 intersectionRect: { x: 210, y: 212, width: 2130, height: 2140 }, 18 isIntersecting: true, 19 intersectionRatio: 0.35, 18 20 target: document.body 19 21 }; … … 32 34 },'ConstructorRootBounds'); 33 35 test(function() { 36 entryInit.rootBounds = null; 37 var entry = new IntersectionObserverEntry(entryInit); 38 assert_equals(entry.rootBounds, null); 39 },'ConstructorNullRootBounds'); 40 test(function() { 34 41 var entry = new IntersectionObserverEntry(entryInit); 35 42 assert_class_string(entry.boundingClientRect, 'DOMRectReadOnly'); … … 43 50 test(function() { 44 51 var entry = new IntersectionObserverEntry(entryInit); 52 assert_true(entry.isIntersecting); 53 },'ConstructorIsIntersecting'); 54 test(function() { 55 var entry = new IntersectionObserverEntry(entryInit); 56 assert_equals(entry.intersectionRatio, 0.35); 57 },'ConstructorIntersectionRatio'); 58 test(function() { 59 var entry = new IntersectionObserverEntry(entryInit); 45 60 assert_equals(entry.target, document.body); 46 },'ConstructorT ime');61 },'ConstructorTarget'); 47 62 48 63 </script> -
trunk/Source/WebCore/ChangeLog
r234721 r234732 1 2018-08-09 Ali Juma <ajuma@chromium.org> 2 3 Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit 4 https://bugs.webkit.org/show_bug.cgi?id=188445 5 6 Reviewed by Simon Fraser. 7 8 Update IntersectionObserverEntry by making rootBounds nullable, and adding an 9 isIntersecting attribute. Make the same changes to IntersectionObserverEntryInit, 10 and also add an intersectionRatio attribute. 11 12 Tested by intersection-observer/intersection-observer-entry-interface.html 13 14 * page/IntersectionObserverEntry.cpp: 15 (WebCore::IntersectionObserverEntry::IntersectionObserverEntry): 16 * page/IntersectionObserverEntry.h: 17 (WebCore::IntersectionObserverEntry::isIntersecting const): 18 * page/IntersectionObserverEntry.idl: 19 1 20 2018-08-09 Charlie Turner <cturner@igalia.com> 2 21 -
trunk/Source/WebCore/page/IntersectionObserverEntry.cpp
r208181 r234732 35 35 IntersectionObserverEntry::IntersectionObserverEntry(const Init& init) 36 36 : m_time(init.time) 37 , m_rootBounds(DOMRectReadOnly::fromRect(init.rootBounds))38 37 , m_boundingClientRect(DOMRectReadOnly::fromRect(init.boundingClientRect)) 39 38 , m_intersectionRect(DOMRectReadOnly::fromRect(init.intersectionRect)) 39 , m_intersectionRatio(init.intersectionRatio) 40 40 , m_target(init.target) 41 , m_isIntersecting(init.isIntersecting) 41 42 { 43 if (init.rootBounds) 44 m_rootBounds = DOMRectReadOnly::fromRect(*init.rootBounds); 42 45 } 43 44 46 45 47 } // namespace WebCore -
trunk/Source/WebCore/page/IntersectionObserverEntry.h
r208192 r234732 44 44 struct Init { 45 45 double time; 46 DOMRectInitrootBounds;46 std::optional<DOMRectInit> rootBounds; 47 47 DOMRectInit boundingClientRect; 48 48 DOMRectInit intersectionRect; 49 double intersectionRatio; 49 50 RefPtr<Element> target; 51 bool isIntersecting; 50 52 }; 51 53 … … 61 63 RefPtr<Element> target() const { return m_target; } 62 64 65 bool isIntersecting() const { return m_isIntersecting; } 63 66 double intersectionRatio() const { return m_intersectionRatio; } 64 67 … … 72 75 double m_intersectionRatio { 0 }; 73 76 RefPtr<Element> m_target; 77 bool m_isIntersecting { false }; 74 78 }; 75 79 -
trunk/Source/WebCore/page/IntersectionObserverEntry.idl
r208983 r234732 35 35 ] interface IntersectionObserverEntry { 36 36 readonly attribute DOMHighResTimeStamp time; 37 readonly attribute DOMRectReadOnly rootBounds;37 readonly attribute DOMRectReadOnly? rootBounds; 38 38 readonly attribute DOMRectReadOnly boundingClientRect; 39 39 readonly attribute DOMRectReadOnly intersectionRect; 40 readonly attribute boolean isIntersecting; 40 41 readonly attribute double intersectionRatio; 41 42 readonly attribute Element target; … … 46 47 ] dictionary IntersectionObserverEntryInit { 47 48 required DOMHighResTimeStamp time; 48 required DOMRectInit rootBounds;49 required DOMRectInit? rootBounds; 49 50 required DOMRectInit boundingClientRect; 50 51 required DOMRectInit intersectionRect; 52 required boolean isIntersecting; 53 required double intersectionRatio; 51 54 required Element target; 52 55 };
Note: See TracChangeset
for help on using the changeset viewer.