Repository navigation
Highlight selected text in input fields - #10176
Conversation
|
You'll need |
79b80b6 to
8f6f0c3
Compare
Done. |
|
|
||
| /// Is this fragment selected? | ||
| pub selected: bool, | ||
|
|
There was a problem hiding this comment.
Can we move this down to after requires_line_break_afterward_if_wrapping_on_newlines? (Or, even better, combine those two into a bitflags!?)
Fragment memory usage tends to have an outsized effect on Servo's performance, since they do get moved around a lot (more than they should, but fixing this will be a good bit of work).
|
Is there a way we can reftest this, perhaps by programmatically selecting text in JavaScript (the selection APIs work, right?) and then comparing that against something with a solid background? To avoid failing that test once we have user-stylable |
8f6f0c3 to
6227e7e
Compare
Done.
Added a reftest. r? @pcwalton |
Fixes servo#9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
6227e7e to
08caf74
Compare
|
@bors-servo: r+ |
|
📌 Commit 08caf74 has been approved by |
Highlight selected text in input fields Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10176) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel |
|
⌛ Testing commit 08caf74 with merge bed91b3... |
Highlight selected text in input fields Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10176) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, status-appveyor |
Make selection blue instead of orange PR #10176 add a background color for selected text. It uses a builtin color until `::selection` is supported. ~~Orange makes sense for Linux. Let's make it blue for windows and mac.~~ See #10231 (comment) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10231) <!-- Reviewable:end -->
…lrouget:selectionColor); r=mbrubeck PR servo/servo#10176 add a background color for selected text. It uses a builtin color until `::selection` is supported. ~~Orange makes sense for Linux. Let's make it blue for windows and mac.~~ See servo/servo#10231 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: cf4fa0a9f463f9bdfc5daef7f6bf9d6e1d151aa6 UltraBlame original commit: 95ef72f1a6e7ee93eb4d6cc096da8fbf6a52d90a
…lrouget:selectionColor); r=mbrubeck PR servo/servo#10176 add a background color for selected text. It uses a builtin color until `::selection` is supported. ~~Orange makes sense for Linux. Let's make it blue for windows and mac.~~ See servo/servo#10231 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: cf4fa0a9f463f9bdfc5daef7f6bf9d6e1d151aa6 UltraBlame original commit: 95ef72f1a6e7ee93eb4d6cc096da8fbf6a52d90a
…lrouget:selectionColor); r=mbrubeck PR servo/servo#10176 add a background color for selected text. It uses a builtin color until `::selection` is supported. ~~Orange makes sense for Linux. Let's make it blue for windows and mac.~~ See servo/servo#10231 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: cf4fa0a9f463f9bdfc5daef7f6bf9d6e1d151aa6 UltraBlame original commit: 95ef72f1a6e7ee93eb4d6cc096da8fbf6a52d90a
…lrouget:selectionColor); r=mbrubeck PR servo/servo#10176 add a background color for selected text. It uses a builtin color until `::selection` is supported. ~~Orange makes sense for Linux. Let's make it blue for windows and mac.~~ See servo/servo#10231 (comment) Source-Repo: https://github.com/servo/servo Source-Revision: cf4fa0a9f463f9bdfc5daef7f6bf9d6e1d151aa6
Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
r? @pcwalton
This change is