-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update offsetParent behavior in shadow trees
New behavior for offsetParent in shadow trees was discussed in [1] and [2]. This lead to a chromium patch [3] which changed the behavior. After [3] landed, the desired behavior in the discussions in [1] and [2] seemed to have changed. Unfortunately, the author of [3] was no longer working on chromium. This new behavior was then added to the spec and landed in webkit [4] and firefox [5], and a WPT was added for it [6]. This patch implements the new behavior to follow suit with webkit and firefox based on the WPT in [6]. Unfortunately, there are several tests which are either internal to chromium or are only passing in chromium which appear to oppose this new behavior and will have to be updated or removed: - external/wpt/css/css-contain/content-visibility/content-visibility-035.html - external/wpt/css/css-contain/content-visibility/content-visibility-044.html - fast/dom/shadow/offset-parent-does-not-leak-ua-shadow.html - shadow-dom/offsetParent.html For shadow-dom/offsetParent.html, I verified that firefox and safari both currently fail the same tests which this patch does. [1] WICG/webcomponents#497 [2] w3c/csswg-drafts#159 [3] https://chromium.googlesource.com/chromium/src/+/18d455ee833f6a30dcbe2755380861eb75cd9f6f [4] https://trac.webkit.org/changeset/239313/webkit [5] https://bugzilla.mozilla.org/show_bug.cgi?id=1514074 [6] https://wpt.fyi/results/shadow-dom/offsetParent-across-shadow-boundaries.html Fixed: 920069 Change-Id: I168edc5ad0e4fcb92d0c4a440623f2424b14a988 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2775208 Reviewed-by: Mason Freed <[email protected]> Reviewed-by: vmpstr <[email protected]> Reviewed-by: Ian Kilpatrick <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/master@{#872658} GitOrigin-RevId: a48d953625d82035201c12d8e92ad0f39bf85258
- Loading branch information
1 parent
9b63e41
commit 047e880
Showing
16 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is a testharness.js-based test. | ||
PASS offsetParent should return node in the same node tree in open shadow root. | ||
PASS offsetParent should return node in the same node tree in closed shadow root. | ||
PASS offsetParent should return an unclosed node in a open shadow from closed shadow. | ||
PASS offsetParent should return an unclosed node in a closed shadow from open shadow. | ||
FAIL offsetParent should return an unclosed node. assert_equals: expected "container_open" but got "host_open2" | ||
PASS offsetParent should skip any non-unclosed nodes. | ||
FAIL offsetParent should return node in the open shadow root because it is unclosed. assert_equals: expected Element node <div id="container" style="position: relative;"> | ||
<s... but got Element node <div id="host_open4" class="container"> | ||
|
||
<div id="hos... | ||
FAIL offsetParent should return null in case position:fixed offsetParent is not unclosed. assert_equals: expected null but got Element node <body><div id="host_open0"> | ||
|
||
</div> | ||
|
||
<div id="host_clos... | ||
FAIL All position:static elements should be skipped for offsetParent. assert_equals: expected Element node <div id="relative" style="position: relative;"> | ||
<... but got Element node <body><div id="host_open0"> | ||
|
||
</div> | ||
|
||
<div id="host_clos... | ||
Harness: the test ran to completion. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This is a virtual test suite for the *old* element.offsetParent behavior, | ||
to ensure it respects the Feature flag, in case this behavior needs to be | ||
disabled via Finch. | ||
|
||
Flag: --disable-features=OffsetParentNewSpecBehavior | ||
Bug: crbug.com/920069 |
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
...setparent-old-behavior/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
offsetParent should not leak nodes in user agent Shadow DOM. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
FAIL child.offsetParent should be [object HTMLDivElement]. Was [object HTMLDivElement]. | ||
PASS child.offsetParent is container | ||
PASS child.offsetParent is container | ||
PASS child.offsetParent is container | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|