| 
 | 1 | +// Checks that individual trait impls can only be collapsed via clicking directly on the summary element  | 
 | 2 | + | 
 | 3 | +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"  | 
 | 4 | +assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})  | 
 | 5 | + | 
 | 6 | +// Collapse the trait impl doc. The actual clickable area is outside the element, hence offset.  | 
 | 7 | +click-with-offset: ("summary:has(#trait-impl-link-in-summary)", {"x": -15, "y": 5})  | 
 | 8 | +assert-attribute-false: ("details:has(#trait-impl-link-in-summary)", {"open": ""})  | 
 | 9 | +click-with-offset: ("summary:has(#trait-impl-link-in-summary)", {"x": -15, "y": 5})  | 
 | 10 | +assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})  | 
 | 11 | + | 
 | 12 | +// Clicks on the text should be ignored  | 
 | 13 | +click: "summary:has(#trait-impl-link-in-summary) > .impl"  | 
 | 14 | +assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})  | 
 | 15 | + | 
 | 16 | +// But links should still work  | 
 | 17 | +click: "summary:has(#trait-impl-link-in-summary) a:has(#trait-impl-link-in-summary)"  | 
 | 18 | +assert-window-property-false: ({"pageYOffset": "0"})  | 
 | 19 | +assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})  | 
 | 20 | + | 
 | 21 | +// As well as clicks on elements within links  | 
 | 22 | +go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"  | 
 | 23 | +assert-window-property: ({"pageYOffset": "0"})  | 
 | 24 | +click: "#trait-impl-link-in-summary"  | 
 | 25 | +assert-window-property-false: ({"pageYOffset": "0"})  | 
 | 26 | +assert-attribute: ("details:has(#trait-impl-link-in-summary)", {"open": ""})  | 
0 commit comments