Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstyle: Rewrite the restyle hints code to allow different kinds of element snapshots. #12469
Conversation
|
Do we really need yet another "Servo" prefix? :( |
|
This is basically ready for review... r? @bholley or @heycam Relevant gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1287951 |
|
@SimonSapin: This kind of conflicts with your current efforts to use conditional compilation in style. I don't expect this to be a lot of breakage (the only relevant changes for that are the restyle_hints.rs file, and the implementation added in geckolib), though could you please check? I don't mind holding this off for a bit and rebase if your changes are landing soon :) |
|
I tried merging this PR into #12515 (which I just submitted) and got conflicts in:
I haven’t looked in more details than that. |
|
@SimonSapin: Then don't bother about it, I'll do the rebase :) |
|
|
5279d4b
to
14374a8
|
Reviewed 13 of 14 files at r1, 4 of 4 files at r2. components/style/selector_impl.rs, line 82 [r2] (raw file):
This text appears twice... ports/geckolib/glue.rs, line 452 [r2] (raw file):
Nit: "get rid of". ports/geckolib/glue.rs, line 459 [r2] (raw file):
Do we have an enforcement mechanism for this somewhere? If not, please file a bug so that we remember to do that. ports/geckolib/glue.rs, line 460 [r2] (raw file):
Does this really need to be a transmute? I don't remember if |as| works for repr(C) enums. ports/geckolib/snapshot.rs, line 16 [r2] (raw file):
Hm, so these are basically only valid in stack scope, right? Can we either use a lifetime or a strong reference here to make sure these don't escape? Happy for that to happen in a followup if that makes sense. ports/geckolib/snapshot.rs, line 31 [r2] (raw file):
Can you parenthesize a bit more here make the precedence clearer? ports/geckolib/snapshot.rs, line 62 [r2] (raw file):
Don't you want ignoreCase = true here? ports/geckolib/snapshot.rs, line 129 [r2] (raw file):
Can you use .as_ref().map here instead? ports/geckolib/snapshot.rs, line 132 [r2] (raw file):
Yeah, the logic here is complicated enough that I think we should share these and just pass a function argument to the helper which invokes the appropriate FFI method. Comments from Reviewable |
|
r=me with those addressed. @bors-servo delegate+ |
|
|
…ment snapshots, and use it for Gecko. This is a rewrite for how style interfaces with its consumers in order to allow different representations for an element snapshot. This also changes the requirements of an element snapshot, requiring them to only implement MatchAttr, instead of MatchAttrGeneric. This is important for stylo since implementing MatchAttrGeneric is way more difficult for us given the atom limitations. This also allows for more performant implementations in the Gecko side of things.
|
Review status: all files reviewed at latest revision, 9 unresolved discussions. components/style/selector_impl.rs, line 82 [r2] (raw file):
|
|
@bors-servo: r=bholley |
|
|
style: Rewrite the restyle hints code to allow different kinds of element snapshots. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because refactoring. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> This is a rewrite for how style interfaces with its consumers in order to allow different representations for an element snapshot. This also changes the requirements of an element snapshot, requiring them to only implement MatchAttr, instead of MatchAttrGeneric. This is important for stylo since implementing MatchAttrGeneric is way more difficult for us given the atom limitations. This also allows for more performant implementations in the Gecko side of things. I don't want to get this merged just yet, mainly because the stylo part is not implemented, but I'd like early feedback from @bholley and/or @heycam: How do you see this approach? I don't think we'll have much problem to implement MatchAttr for our element snapshots, but... worth checking. r? @heycam <!-- 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/12469) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
|
|
|
|
emilio commentedJul 16, 2016
•
edited by larsbergstrom
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis is a rewrite for how style interfaces with its consumers in order to allow
different representations for an element snapshot.
This also changes the requirements of an element snapshot, requiring them to
only implement MatchAttr, instead of MatchAttrGeneric. This is important for
stylo since implementing MatchAttrGeneric is way more difficult for us given the
atom limitations. This also allows for more performant implementations in the
Gecko side of things.
I don't want to get this merged just yet, mainly because the stylo part is not
implemented, but I'd like early feedback from @bholley and/or @heycam: How do
you see this approach? I don't think we'll have much problem to implement
MatchAttr for our element snapshots, but... worth checking.
r? @heycam
This change is