Bug 1470059 [wpt PR 11596] - Add a new test case for hit testing inline elements, a=testonly

Automatic update from web-platform-testsAdd a new test case for hit testing inline elements

This patch adds a new WPT that hit tests the empty region in an inline
element above a child with smaller font size (i.e., smaller height), and
expects to hit the inline element itself.

This helps us add related implementation in LayoutNG, since no existing
test case tests this behavior yet.

Bug: 851075
Cq-Include-Trybots: luci.chromium.try :linux_layout_tests_layout_ng
Change-Id: Ic538681530e17ea0d5fc49612376e30bdcf563d8
Reviewed-on: https://chromium-review.googlesource.com/1108560
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569082}

--

wpt-commits: cece9a142ba91d0e283a3206f272bde4876fe2a7
wpt-pr: 11596
MozReview-Commit-ID: CvzjoCi9YpJ
This commit is contained in:
Xiaocheng Hu 2018-07-06 21:18:27 +00:00 коммит произвёл James Graham
Родитель 7003e6e252
Коммит a92cd44cb0
2 изменённых файлов: 33 добавлений и 0 удалений

Просмотреть файл

@ -325325,6 +325325,12 @@
{}
]
],
"css/cssom-view/elementFromPoint-mixed-font-sizes.html": [
[
"/css/cssom-view/elementFromPoint-mixed-font-sizes.html",
{}
]
],
"css/cssom-view/elementFromPoint-parameters.html": [
[
"/css/cssom-view/elementFromPoint-parameters.html",
@ -551070,6 +551076,10 @@
"6ee9a47112c9a5fe4f0c85f85ea577575790c5be",
"testharness"
],
"css/cssom-view/elementFromPoint-mixed-font-sizes.html": [
"d73025913e0ff9d0ba490b8a54f543e876808450",
"testharness"
],
"css/cssom-view/elementFromPoint-parameters.html": [
"0c31602268a831eae1bcd44b4a5e7b678a7ed7cb",
"testharness"

Просмотреть файл

@ -0,0 +1,23 @@
<!DOCTYPE html>
<link rel="help" href="http://www.w3.org/TR/cssom-view/#extensions-to-the-document-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div style="font-size: 40px">
<span id="target">
XXX <span id="small" style="font-size:10px">small</span> YYY
</span>
</div>
<script>
test(() => {
// Find a point in the empty region above the "small" span, but still inside
// the "target" span.
const small = document.getElementById('small');
const rect = small.getBoundingClientRect();
const x = rect.left + rect.width / 2;
const y = rect.top - 5;
const actual = document.elementFromPoint(x, y);
const target = document.getElementById('target');
assert_equals(actual, target);
}, 'document.elementFromPoint finds container SPAN in the empty region above a child SPAN with a smaller font size');
</script>