Skip to content

layout: Draw the insertion point in input elements. - #7644

Merged
bors-servo merged 9 commits into
servo:masterfrom
pcwalton:carrot
Sep 17, 2015
Merged

bors-servo merged 9 commits into
servo:masterfrom
pcwalton:carrot

Conversation

@pcwalton

Copy link
Copy Markdown
Contributor

Known issues:

  • The caret doesn't show up if there's no text present, because we don't create text runs in that case. This should be a followup.
  • Text runs don't support decomposing ligatures into their constituent subglyphs for advance computation, so the caret won't appear inside a ligature. This is a text run bug.

r? @mbrubeck

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 15, 2015
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!

@jdm

jdm commented Sep 16, 2015

Copy link
Copy Markdown
Member

This is a really nice series of self-contained commits. Nicely done!

@mbrubeck mbrubeck self-assigned this Sep 16, 2015
@mbrubeck

Copy link
Copy Markdown
Contributor

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 3 of 3 files at r4, 6 of 6 files at r5, 1 of 1 files at r6, 1 of 1 files at r7, 1 of 1 files at r8, 4 of 4 files at r9.
Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


components/layout/construct.rs, line 723 [r5] (raw file):
This assumes the text_content vector contains only one String item. It looks like this has issues when the element contains generated string content, e.g. input:before { content: "hello"; }.

Really we shouldn't be rendering generated content in input and textarea elements at all, which is a separate issue. The situation for contenteditable will be a little more complicated.

Perhaps ThreadSafeLayoutNode::text_content should return something like this instead of a Vec:

enum TextContent {
    Text(String),
    GeneratedContent(Vec<ContentItem>),
}

Comments from the review on Reviewable.io

@mbrubeck mbrubeck added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 16, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Sep 17, 2015
@pcwalton

Copy link
Copy Markdown
Contributor Author

Changed that method.

@mbrubeck r?

@mbrubeck

Copy link
Copy Markdown
Contributor

Reviewed 6 of 6 files at r10.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@mbrubeck

Copy link
Copy Markdown
Contributor

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 757e2cf has been approved by mbrubeck

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 757e2cf with merge 6cd098d...

bors-servo pushed a commit that referenced this pull request Sep 17, 2015
layout: Draw the insertion point in input elements.

Known issues:

* The caret doesn't show up if there's no text present, because we don't create text runs in that case. This should be a followup.

* Text runs don't support decomposing ligatures into their constituent subglyphs for advance computation, so the caret won't appear inside a ligature. This is a text run bug.

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7644)
<!-- Reviewable:end -->
@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 Sep 17, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 757e2cf into servo:master Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants