Skip to content

Fire 'select' event in SetSelection{Start,End} - #19202

Merged
bors-servo merged 1 commit into
servo:masterfrom
jonleighton:issue-19171
Nov 15, 2017
Merged

bors-servo merged 1 commit into
servo:masterfrom
jonleighton:issue-19171

Conversation

@jonleighton

@jonleighton jonleighton commented Nov 13, 2017 •

Copy link
Copy Markdown
Contributor

See #19171.


This change is Reviewable

@highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @emilio (or someone else) soon.

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/htmlinputelement.rs
  • @KiChjang: components/script/dom/htmlinputelement.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 13, 2017

@tigercosmos tigercosmos left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete the pass test cases in tests/wpt/metadata/html/semantics/forms/textfieldselection/selection-start-end.html.ini
We only need to remain the unexpected ones

[onselect should fire when selectionStart is changed on input-appended-prefocused]
expected: NOTRUN
expected: PASS

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Pass, You can delete it directly

@KiChjang KiChjang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Great start! I only have minor comments about adding comments ;). Once you've addressed them, you can r=me.

self.textinput.borrow().selection_direction
}

fn set_selection_range(&self, start: u32, end: u32, direction: SelectionDirection) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.textinput.borrow_mut().selection_direction = direction;
self.textinput.borrow_mut().set_selection_range(start, end);
let window = window_from_node(self);
let _ = window.user_interaction_task_source().queue_event(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add step annotations for this function. For example, this particular line here follows step 6 of the linked algorithm (albeit incorrectly).

@jonleighton

Copy link
Copy Markdown
Contributor Author

Thanks, requested changes implemented

@jonleighton

Copy link
Copy Markdown
Contributor Author

r? @KiChjang

@highfive highfive assigned KiChjang and unassigned emilio Nov 15, 2017

@KiChjang KiChjang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final nit!

[selection-start-end.html]
type: testharness
expected: TIMEOUT
expected: OK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line now.

@KiChjang

Copy link
Copy Markdown
Contributor

Also, after you've made the changes, can you squash your commits into one, please?

@jonleighton

Copy link
Copy Markdown
Contributor Author

Sure, done

@KiChjang

Copy link
Copy Markdown
Contributor

@bors-servo r+

Thanks!

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 93b047a has been approved by KiChjang

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 15, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 93b047a with merge 2efbf22...

bors-servo pushed a commit that referenced this pull request Nov 15, 2017
Fire 'select' event in SetSelection{Start,End}

See #19171.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19202)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: KiChjang
Pushing 2efbf22 to master...

@bors-servo
bors-servo merged commit 93b047a into servo:master Nov 15, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants