Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection DOM interface (but not actual UI selections) #25674

Merged
merged 1 commit into from Feb 14, 2020

Conversation

@pshaughn
Copy link
Member

pshaughn commented Feb 2, 2020

This is work towards #7492.

I put new tests in the mozilla-specific directory rather than the main tree because I'm not sure how upstreamable they are; I'd like opinions on that point.

This adds a new exposed interface, which I understand from tests/mozilla/interfaces.html is something requiring specific approval from someone allowed to give that approval.

Things that aren't done here:

  • The spec doesn't describe what selection/script-and-style-elements.html wants, and what it wants seems to require some sort of layout query.
  • Actual UI interactions are not present at all; selection.rs has a few TODOs saying which methods I believe the eventual UI code should call for what actions, but there are a lot of fine points here that I don't know about.
  • I haven't touched Node; you can ask if a node's in the Selection's Range the same way you'd ask about any other Range, but there's not a faster path just for selection layout.
@highfive
Copy link

highfive commented Feb 2, 2020

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webidls/EventHandler.webidl, components/script/dom/range.rs, components/script/dom/mod.rs, components/script/dom/window.rs, components/script/dom/webidls/Window.webidl and 5 more
  • @jgraham: tests/wpt/include.ini
  • @KiChjang: components/script/dom/webidls/EventHandler.webidl, components/script/dom/range.rs, components/script/dom/mod.rs, components/script/dom/window.rs, components/script/dom/webidls/Window.webidl and 5 more
@pshaughn
Copy link
Member Author

pshaughn commented Feb 2, 2020

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Feb 2, 2020

Trying commit 514c4e7 with merge 3daa787...

bors-servo added a commit that referenced this pull request Feb 2, 2020
Selection DOM interface (but not actual UI selections)

This is work towards #7492.

Things that aren't done here:
- The spec doesn't describe what tests/wpt/metadata/selection/script-and-style-elements.html.ini wants, and what it wants seems to require some sort of layout query.
- #25673 means I'm not sure about some tests being OK.
- I haven't checked that the selectionchange event is actually working, and it has no WPT tests other than that the handler exists.
- Actual UI interactions are not present at all; selection.rs has a few TODOs saying methods what I understand the UI should call for what actions, but there are a lot of fine points here that I don't know about.
components/script/dom/selection.rs Outdated Show resolved Hide resolved
components/script/dom/selection.rs Outdated Show resolved Hide resolved
components/script/dom/selection.rs Outdated Show resolved Hide resolved
@bors-servo
Copy link
Contributor

bors-servo commented Feb 2, 2020

💔 Test failed - status-taskcluster

@pshaughn
Copy link
Member Author

pshaughn commented Feb 2, 2020

Nothing too unexpected here...

Unexpected subtest result in /custom-elements/reactions/Selection.html:
└ PASS [expected FAIL] deleteFromDocument on Selection must enqueue a disconnected reaction
Unexpected subtest result in /html/browsers/the-window-object/window-properties.https.html:
└ PASS [expected FAIL] Window method: getSelection
Unexpected subtest result in /dom/ranges/Range-mutations-deleteData.html:
[many cases, probably the entire file like the other Range-mutations-* ones]
Unexpected subtest result in /_mozilla/mozilla/interfaces.html:
│ FAIL [expected PASS] Interfaces exposed on the window
│ → assert_true: If this is failing: DANGER, are you sure you want to expose the new interface Selection to all webpages as a property on the global? Do not make a change to this file without review from jdm or Ms2ger for that specific change! expected true got false

@pshaughn pshaughn force-pushed the pshaughn:selection branch from 514c4e7 to 5894459 Feb 3, 2020
@highfive highfive removed the S-tests-failed label Feb 3, 2020
@pshaughn pshaughn marked this pull request as ready for review Feb 3, 2020
@pshaughn
Copy link
Member Author

pshaughn commented Feb 3, 2020

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Feb 3, 2020

Trying commit 5894459 with merge 4268f4a...

bors-servo added a commit that referenced this pull request Feb 3, 2020
Selection DOM interface (but not actual UI selections)

This is work towards #7492.

I put new tests in the mozilla-specific directory rather than the main tree because I'm not sure how upstreamable they are; I'd like opinions on that point.

This adds a new exposed interface, which I understand from tests/mozilla/interfaces.html is something requiring specific approval from someone allowed to give that approval.

Things that aren't done here:
- The spec doesn't describe what selection/script-and-style-elements.html wants, and what it wants seems to require some sort of layout query.
- Actual UI interactions are not present at all; selection.rs has a few TODOs saying which methods I believe the eventual UI code should call for what actions, but there are a lot of fine points here that I don't know about.
- I haven't touched Node; you can ask if a node's in the Selection's Range the same way you'd ask about any other Range, but there's not a faster path just for selection layout.
@bors-servo
Copy link
Contributor

bors-servo commented Feb 3, 2020

💔 Test failed - status-taskcluster

@pshaughn
Copy link
Member Author

pshaughn commented Feb 3, 2020

1 unexpected results that are NOT known-intermittents:
  ▶ TIMEOUT [expected OK] /2dcontext/shadows/shadowBlur_gaussian_tolerance.1.html
  │ 
  │ 
  │ 
  └ 

I've never seen this one before. It looks like the test is iterating over many of image pixels one at a time in Javascript, so maybe it's susceptible to timeouts if it's not getting as many CPU cycles. It isn't touching selections or ranges.

@CYBAI
Copy link
Collaborator

CYBAI commented Feb 4, 2020

@pshaughn I guess that's #25523 👀

Copy link
Member

jdm left a comment

Great work!

return Err(Error::IndexSize);
}

// let is_old_anchor_before_or_equal;

This comment has been minimized.

@jdm

jdm Feb 11, 2020

Member

Why is this here?

This comment has been minimized.

@pshaughn

pshaughn Feb 11, 2020

Author Member

Just forgetfulness.

focus_offset: u32,
) -> ErrorResult {
// Step 1
if anchor_node.is_doctype() || focus_node.is_doctype() {

This comment has been minimized.

@jdm

jdm Feb 11, 2020

Member

Presumably this check comes from https://dom.spec.whatwg.org/#concept-range-bp-set? I'm a bit concerned that we're adding these extra checks in various places in the code; is our implementation missing them elsewhere, or is this a spec inconsistency, or are we working around tests that assume a certain order or checks that doesn't match what the spec says?

This comment has been minimized.

@pshaughn

pshaughn Feb 11, 2020

Author Member

Tests, which Firefox and Chrome both pass in FYI, are assuming a certain order that doesn't match what the spec says.

This comment has been minimized.

@pshaughn

pshaughn Feb 11, 2020

Author Member

I brought it up here: w3c/selection-api#118

@jdm
Copy link
Member

jdm commented Feb 14, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

📌 Commit 5ef3358 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

Testing commit 5ef3358 with merge 38486d8...

bors-servo added a commit that referenced this pull request Feb 14, 2020
Selection DOM interface (but not actual UI selections)

This is work towards #7492.

I put new tests in the mozilla-specific directory rather than the main tree because I'm not sure how upstreamable they are; I'd like opinions on that point.

This adds a new exposed interface, which I understand from tests/mozilla/interfaces.html is something requiring specific approval from someone allowed to give that approval.

Things that aren't done here:
- The spec doesn't describe what selection/script-and-style-elements.html wants, and what it wants seems to require some sort of layout query.
- Actual UI interactions are not present at all; selection.rs has a few TODOs saying which methods I believe the eventual UI code should call for what actions, but there are a lot of fine points here that I don't know about.
- I haven't touched Node; you can ask if a node's in the Selection's Range the same way you'd ask about any other Range, but there's not a faster path just for selection layout.
@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Feb 14, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

Testing commit 5ef3358 with merge b687f74...

bors-servo added a commit that referenced this pull request Feb 14, 2020
Selection DOM interface (but not actual UI selections)

This is work towards #7492.

I put new tests in the mozilla-specific directory rather than the main tree because I'm not sure how upstreamable they are; I'd like opinions on that point.

This adds a new exposed interface, which I understand from tests/mozilla/interfaces.html is something requiring specific approval from someone allowed to give that approval.

Things that aren't done here:
- The spec doesn't describe what selection/script-and-style-elements.html wants, and what it wants seems to require some sort of layout query.
- Actual UI interactions are not present at all; selection.rs has a few TODOs saying which methods I believe the eventual UI code should call for what actions, but there are a lot of fine points here that I don't know about.
- I haven't touched Node; you can ask if a node's in the Selection's Range the same way you'd ask about any other Range, but there's not a faster path just for selection layout.
@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Feb 14, 2020

@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

Testing commit 5ef3358 with merge 4f36472...

bors-servo added a commit that referenced this pull request Feb 14, 2020
Selection DOM interface (but not actual UI selections)

This is work towards #7492.

I put new tests in the mozilla-specific directory rather than the main tree because I'm not sure how upstreamable they are; I'd like opinions on that point.

This adds a new exposed interface, which I understand from tests/mozilla/interfaces.html is something requiring specific approval from someone allowed to give that approval.

Things that aren't done here:
- The spec doesn't describe what selection/script-and-style-elements.html wants, and what it wants seems to require some sort of layout query.
- Actual UI interactions are not present at all; selection.rs has a few TODOs saying which methods I believe the eventual UI code should call for what actions, but there are a lot of fine points here that I don't know about.
- I haven't touched Node; you can ask if a node's in the Selection's Range the same way you'd ask about any other Range, but there's not a faster path just for selection layout.
@bors-servo
Copy link
Contributor

bors-servo commented Feb 14, 2020

☀️ Test successful - status-taskcluster
Approved by: jdm
Pushing 4f36472 to master...

@bors-servo bors-servo merged commit 5ef3358 into servo:master Feb 14, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.