LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 2016 Apple Inc. All rights reserved. | 2 * Copyright (C) 2016 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 #if ENABLE(INTERSECTION_OBSERVER) | 28 #if ENABLE(INTERSECTION_OBSERVER) |
29 #include "IntersectionObserverEntry.h" | 29 #include "IntersectionObserverEntry.h" |
30 | 30 |
31 #include "Element.h" | 31 #include "Element.h" |
32 #include <wtf/text/TextStream.h> | 32 #include <wtf/text/TextStream.h> |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 IntersectionObserverEntry::IntersectionObserverEntry(const Init& init) | 36 IntersectionObserverEntry::IntersectionObserverEntry(const Init& init) |
37 : m_time(init.time) | 37 : m_time(init.time) |
38 , m_rootBounds(DOMRectReadOnly::fromRect(init.rootBounds)) | |
39 , m_boundingClientRect(DOMRectReadOnly::fromRect(init.boundingClientRect)) | 38 , m_boundingClientRect(DOMRectReadOnly::fromRect(init.boundingClientRect)) |
40 , m_intersectionRect(DOMRectReadOnly::fromRect(init.intersectionRect)) | 39 , m_intersectionRect(DOMRectReadOnly::fromRect(init.intersectionRect)) |
41 , m_isIntersecting(init.isIntersecting) | |
42 , m_intersectionRatio(init.intersectionRatio) | 40 , m_intersectionRatio(init.intersectionRatio) |
43 , m_target(init.target) | 41 , m_target(init.target) |
| 42 , m_isIntersecting(init.isIntersecting) |
44 { | 43 { |
| 44 if (init.rootBounds) |
| 45 m_rootBounds = DOMRectReadOnly::fromRect(*init.rootBounds); |
45 } | 46 } |
46 | 47 |
47 TextStream& operator<<(TextStream& ts, const DOMRectInit& rect) | 48 TextStream& operator<<(TextStream& ts, const DOMRectInit& rect) |
48 { | 49 { |
49 ts << "x: " << rect.x; | 50 ts << "x: " << rect.x; |
50 ts << "y: " << rect.y; | 51 ts << "y: " << rect.y; |
51 ts << "width: " << rect.width; | 52 ts << "width: " << rect.width; |
52 ts << "height: " << rect.height; | 53 ts << "height: " << rect.height; |
53 return ts; | 54 return ts; |
54 } | 55 } |
(...skipping 15 matching lines...) Expand all Loading... |
70 ts << entry.boundingClientRect().get(); | 71 ts << entry.boundingClientRect().get(); |
71 ts << entry.intersectionRect().get(); | 72 ts << entry.intersectionRect().get(); |
72 ts << entry.target().get(); | 73 ts << entry.target().get(); |
73 ts << entry.intersectionRatio(); | 74 ts << entry.intersectionRatio(); |
74 return ts; | 75 return ts; |
75 } | 76 } |
76 | 77 |
77 } // namespace WebCore | 78 } // namespace WebCore |
78 | 79 |
79 #endif // ENABLE(INTERSECTION_OBSERVER) | 80 #endif // ENABLE(INTERSECTION_OBSERVER) |
LEFT | RIGHT |