mirror of
				https://github.com/mozilla/gecko-dev.git
				synced 2025-11-04 02:09:05 +02:00 
			
		
		
		
	Automatic update from web-platform-tests Move location.fragmentDirective to document This CL moves the window.location.fragmentDirective object, used for feature detecting support for text fragments, to document.fragmentDirective. This is a web-facing change. Intent-to-ship thread: https://groups.google.com/a/chromium.org/d/msg/blink-dev/ygBV2vWIX-o/kbYwrJgDAgAJ Bug: 1057795 Change-Id: I1a7df51a1cde4c39a3595d7d83b118403db5cd5e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343634 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Nick Burris <nburris@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/master@{#799740} -- wpt-commits: f8632b0ebf552d519cc1d7ec63511948c7987f63 wpt-pr: 25063
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!doctype html>
 | 
						|
<title>Fragment directive API</title>
 | 
						|
<meta charset=utf-8>
 | 
						|
<link rel="help" href="https://wicg.github.io/ScrollToTextFragment/">
 | 
						|
<script src="/resources/testharness.js"></script>
 | 
						|
<script src="/resources/testharnessreport.js"></script>
 | 
						|
<script src="/resources/testdriver.js"></script>
 | 
						|
<script src="/resources/testdriver-vendor.js"></script>
 | 
						|
<script>
 | 
						|
test(t => {
 | 
						|
  assert_equals(typeof(document.fragmentDirective), 'object', 'document.fragmentDirective is defined');
 | 
						|
}, 'Scroll to text is feature detectable via document.fragmentDirective');
 | 
						|
 | 
						|
test(t =>{
 | 
						|
  document.fragmentDirective = 'text=test';
 | 
						|
  assert_equals(window.scrollY, 0, 'Setting document.fragmentDirective did not have an effect on scroll position');
 | 
						|
  assert_equals(typeof(document.fragmentDirective), 'object', 'document.fragmentDirective is still an object type');
 | 
						|
  assert_equals(Object.keys(document.fragmentDirective).length, 0, 'document.fragmentDirective has no properties');
 | 
						|
}, 'Setting document.fragmentDirective has no effect');
 | 
						|
</script>
 | 
						|
<style>
 | 
						|
  body {
 | 
						|
    height: 3200px;
 | 
						|
  }
 | 
						|
  #text {
 | 
						|
    position: absolute;
 | 
						|
    top: 3000px;
 | 
						|
  }
 | 
						|
</style>
 | 
						|
<body>
 | 
						|
  <p id="text">This is a test page</p>
 | 
						|
</body>
 |