Skip to content

Commit

Permalink
Bug 1576987 [wpt PR 18705] - Implement fallback to element anchor, a=…
Browse files Browse the repository at this point in the history
…testonly

Automatic update from web-platform-tests
Implement fallback to element anchor

If we parse a TextFragmentAnchor but don't find a match, we should
fallback to matching the element anchor, if there is one.

Example:
https://spaceplace.nasa.gov/blue-sky/en/#similar##targetText=notamatch

Bug: 992522
Change-Id: Ie6dd2a4f5b35a612d563a3acb81392df756ce1d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746210
Commit-Queue: Nick Burris <[email protected]>
Reviewed-by: David Bokan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#690845}

--

wpt-commits: 29beb469ba8e5e611225061d3bc5d1c9d94082d7
wpt-pr: 18705
  • Loading branch information
Nick Burris authored and moz-wptsync-bot committed Sep 3, 2019
1 parent d460d57 commit ec43103
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
position: absolute;
top: 3000px;
}
#element {
position: absolute;
top: 2000px;
}
</style>
<body onload="checkScroll()">
<div id="element">Element</div>
<p id="text">This is a test page</p>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{ fragment: '##targetText=this&targetText=test,page', expect_scroll: true },
{ fragment: '#pagestate##targetText=test', expect_scroll: true },
{ fragment: '#pagestate##targetText=nomatch', expect_scroll: false },
{ fragment: '#element##targetText=nomatch', expect_scroll: true },
];

for (const test_case of test_cases) {
Expand Down

0 comments on commit ec43103

Please sign in to comment.