forked from kdashg/gecko-cinn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1889503 - Implement new document.caretPositionFromPoint Shadow DO…
…M behavior r=webidl,smaug,emilio Spec - https://drafts.csswg.org/cssom-view/Overview#dom-document-caretpositionfrompoint Spec PR - w3c/csswg-drafts#10200 TAG Review - w3ctag/design-reviews#949 Differential Revision: https://phabricator.services.mozilla.com/D215184
- Loading branch information
1 parent
6e92e04
commit e5fe1be
Showing
7 changed files
with
103 additions
and
40 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
33 changes: 33 additions & 0 deletions
33
layout/base/tests/test_caretPositionFromPoint_insertAnonymousContent.html
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,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Test for caretPositionFromPoint with anonymous content</title> | ||
<script src="/tests/SimpleTest/SimpleTest.js"></script> | ||
<script src="/tests/SimpleTest/EventUtils.js"></script> | ||
<link rel="stylesheet" href="/tests/SimpleTest/test.css" /> | ||
</head> | ||
<body> | ||
<script> | ||
info("Inserting anonymous content into the document frame"); | ||
let chromeDoc = SpecialPowers.wrap(document); | ||
let anonymousContent = chromeDoc.insertAnonymousContent(); | ||
let div = document.createElement("div"); | ||
div.style.position = "fixed"; | ||
div.style.top = "0"; | ||
div.style.left = "0"; | ||
div.style.width = "100%"; | ||
div.style.height = "100%"; | ||
div.style.pointerEvents = "auto"; | ||
div.style.backgroundColor = "red"; | ||
anonymousContent.root.appendChild(div); | ||
let caretPos = document.caretPositionFromPoint( | ||
innerWidth / 2, | ||
innerHeight / 2 | ||
); | ||
is(caretPos, null, "caretPos should be null"); | ||
info("Removing the anonymous content"); | ||
chromeDoc.removeAnonymousContent(anonymousContent); | ||
</script> | ||
</body> | ||
</html> |
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
16 changes: 1 addition & 15 deletions
16
testing/web-platform/meta/shadow-dom/Document-caretPositionFromPoint.tentative.html.ini
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 |
---|---|---|
@@ -1,18 +1,4 @@ | ||
prefs: [dom.shadowdom.new_caretPositionFromPoint_behavior.enabled:true] | ||
[Document-caretPositionFromPoint.tentative.html] | ||
[document.caretPositionFromPoint() throws when called without the correct parameters] | ||
expected: FAIL | ||
|
||
[document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to a textarea element which is the offsetNode.] | ||
expected: FAIL | ||
|
||
[document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to the input element's shadow host's parent when the shadow tree is not specified as an argument.] | ||
expected: FAIL | ||
|
||
[document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to the shadow host's parent when the shadow tree is not specified as an argument] | ||
expected: FAIL | ||
[document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to the outer shadow host's parent when the point is in an inner shadow tree and no shadow tree is specified as an argument] | ||
expected: FAIL | ||
|
||
[document.caretPositionFromPoint() should return a CaretPosition at the specified location pointing to the outer shadow tree when the point is in an inner shadow tree and the outer shadow tree is specified as an argument] | ||
expected: FAIL |