Repository navigation
script: Update selection paint ranges without relayout - #47579
Conversation
Signed-off-by: Simon Sapin <[email protected]>
Signed-off-by: Simon Sapin <[email protected]>
Signed-off-by: Simon Sapin <[email protected]>
This way "fully selected" does not involve any offset computation Signed-off-by: Simon Sapin <[email protected]>
Signed-off-by: Simon Sapin <[email protected]>
Signed-off-by: Simon Sapin <[email protected]>
|
🔨 Triggering try run (#33093474824) for Linux (WPT) |
|
Test results for linux-wpt from try job (#33093474824): Flaky unexpected result (31)
Stable unexpected results that are known to be intermittent (23)
Stable unexpected results (25)
|
|
|
Some nodes are only reached for one of these Signed-off-by: Simon Sapin <[email protected]>
|
🔨 Triggering try run (#33098580784) for Linux (WPT) |
|
Test results for linux-wpt from try job (#33098580784): Flaky unexpected result (34)
Stable unexpected results that are known to be intermittent (29)
Stable unexpected results (17)
|
|
|
mrobinson
left a comment
There was a problem hiding this comment.
We probably want to add a new LayoutNode method called "paints_text_caret" that returns true for input elements and contenteditable elements. Right now, I think a collapsed selection will paint a text caret with this change and if an input element is initially laid out without a selection, there will be no caret placeholders.
Signed-off-by: Simon Sapin <[email protected]>
Signed-off-by: Simon Sapin <[email protected]>
Signed-off-by: Simon Sapin <[email protected]>
…he empty string vs zero-width whitespace hack Signed-off-by: Simon Sapin <[email protected]>
|
🔨 Triggering try run (#33502843052) for Linux (WPT) |
Signed-off-by: Simon Sapin <[email protected]>
|
|
Signed-off-by: Simon Sapin <[email protected]>
|
The try failure is: I pushed a commit to restore that |
| fn text_input_widget(&self) -> Option<&DomRefCell<TextInputWidget>> { | ||
| None | ||
| } | ||
|
|
There was a problem hiding this comment.
You can eliminate these and the other implementations returning None by adding a default trait method.
There was a problem hiding this comment.
I deliberately omitted the default so that every impl had to make an active choice rather than risk forgetting one. But now that it’s done i don’t mind moving the None impls to a default if you think that’s better.
There was a problem hiding this comment.
I'll leave this one up to you. I think either is fine by me.
| // need to fix the rendering of caret beforehand. | ||
| // TODO: maybe not `<br>`, but either way when this hack is removed, allow | ||
| // `TextInput::sorted_selection_character_offsets_range` to rely on `Rope::last_index()` | ||
| // to use an unbounded end. |
There was a problem hiding this comment.
Do you mind just removing the <br> suggestion in the comment above and preserving your new comment?
Signed-off-by: Simon Sapin <[email protected]>
🤔 |
This unifies document selection and `<textarea>`/`<input>` selection in how they are represented between script and layout crates. There is no longer an `Arc`-based `SharedSelection` accessible to both. Instead, script goes through `Node::layout_data` a.k.a. `BoxSlot` to update the selection range in existing text runs when possible. Testing: WPT should cover most observable behavior, but we may want some more verification that layout is indeed skipped Fixes: servo#47392 --------- Signed-off-by: Simon Sapin <[email protected]>
This unifies document selection and `<textarea>`/`<input>` selection in how they are represented between script and layout crates. There is no longer an `Arc`-based `SharedSelection` accessible to both. Instead, script goes through `Node::layout_data` a.k.a. `BoxSlot` to update the selection range in existing text runs when possible. Testing: WPT should cover most observable behavior, but we may want some more verification that layout is indeed skipped Fixes: servo#47392 --------- Signed-off-by: Simon Sapin <[email protected]>
This unifies document selection and
<textarea>/<input>selection in how they are represented between script and layout crates. There is no longer anArc-basedSharedSelectionaccessible to both. Instead, script goes throughNode::layout_dataa.k.a.BoxSlotto update the selection range in existing text runs when possible.Testing: WPT should cover most observable behavior, but we may want some more verification that layout is indeed skipped
Fixes: #47392