Skip to content

style: Move cursor property out of mako - #19798

Merged
bors-servo merged 1 commit into
servo:masterfrom
gootorov:move_cursor_from_mako
Jan 20, 2018
Merged

bors-servo merged 1 commit into
servo:masterfrom
gootorov:move_cursor_from_mako

Conversation

@gootorov

@gootorov gootorov commented Jan 17, 2018 •

Copy link
Copy Markdown
Contributor

Sub-PR of #19015

r? emilio


  • ./mach build -d does not report any errors
  • ./mach build-geckolib does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix style: Move cursor property from mako #19775 (github issue number if applicable).
  • These changes do not require tests

This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/gecko.mako.rs, components/style/values/specified/pointing.rs, components/style/properties/longhand/pointing.mako.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs and 1 more
  • @canaltinova: components/style/properties/gecko.mako.rs, components/style/values/specified/pointing.rs, components/style/properties/longhand/pointing.mako.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs and 1 more
  • @emilio: components/style/properties/gecko.mako.rs, components/style/values/specified/pointing.rs, components/style/properties/longhand/pointing.mako.rs, components/style/values/specified/mod.rs, components/layout/display_list/builder.rs and 2 more
  • @fitzgen: components/script_traits/script_msg.rs, components/script_traits/lib.rs
  • @KiChjang: components/script_traits/script_msg.rs, components/script_traits/lib.rs
  • @asajeffrey: components/constellation/constellation.rs
  • @cbrewster: components/constellation/constellation.rs
  • @paulrouget: components/compositing/compositor.rs, ports/glutin/window.rs, components/constellation/constellation.rs, components/compositing/windowing.rs, components/compositing/compositor_thread.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 17, 2018
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify style, layout, and gfx code, but no tests are modified. Please consider adding a test!

@gootorov

Copy link
Copy Markdown
Contributor Author

./mach build -d does not yet compile:

error[E0609]: no field `cursor` on type `&properties::style_structs::Pointing`                                                                                                                                                                                                                               
   --> components/style/servo/restyle_damage.rs:284:22                                                                                                                                                                                                                                                       
    |                                                                                                                                                                                                                                                                                                        
284 |         get_pointing.cursor, get_pointing.pointer_events,                                                                                                                                                                                                                                              
    |                      ^^^^^^                                                                                                                                                                                                                                                                            

error: aborting due to previous error

error: Could not compile `style`.

Not sure what causes it.

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks reasonable! I need to take a closer look tomorrow, meanwhile the comments should allow you to get pass the build error.

Thanks for working on this!

"Cursor",
"computed::Cursor::auto()",
initial_specified_value="specified::Cursor::auto()",
products="gecko",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You need to remove this products="gecko". With it you just removed the property from servo! :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh. This was causing the build error too.


/// cursor: [auto | default | ...]
#[cfg(not(feature = "gecko"))]
pub fn parse<'i, 't>(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be a Parse trait implementation instead, ditto for the other below.

"all-scroll" => AllScroll = 32,
"zoom-in" => ZoomIn = 33,
"zoom-out" => ZoomOut = 34,
"auto" => Auto = 35,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are these values arbitrary or do they represent something else internally? Is it okay if we just move them by one like this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see them used anywhere, so we could even remove them and simplify the macro, I'd think.

Comment thread ports/glutin/window.rs
use glutin::MouseCursor;

let glutin_cursor = match c {
CursorKind::Auto => MouseCursor::Default,

@gootorov gootorov Jan 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without this, we'll get a pattern not covered error.

I looked at the glutin crate and, if I understand correctly, it's used as the layer between Servo and the OS that lets changing the appearance of the mouse cursor, right? As there is no MouseCursor::Auto in that crate, I used the Default variant for the time being. Shall we implement it there or is it okay the way it is? Also, can the OS even have a Auto variant of the mouse cursor? To me it seems it always has to be some specific type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

About pattern not covered part, it's caused by removing the pattern of CursorKind::Auto.
When doing pattern matching, we need to cover all the patterns for the type so if you removed CursorKind::Auto in this pattern matching, compiler will complain about this pattern is not covered.
I don't understand the implementation part either so only reply to the pattern matching part!

match (
self.get_pointing().pointer_events,
self.get_pointing().cursor,
&self.get_pointing().pointer_events,

@gootorov gootorov Jan 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm getting a cannot move out of borrowed content error here. We can solve it in two ways: by borrowing like here and then pattern matching the references or by copying like so:

self.get_pointing().pointer_events.clone()

and leaving the rest the way it is. I went with borrowing, but let me know if we should copy instead.

_context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i>> {
#[allow(unused_imports)] use std::ascii::AsciiExt;

@gootorov gootorov Jan 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can we remove it? It's wasn't used anywhere. Was there something planned to be implemented, maybe?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, we can.

This was needed for the eq_ignore_ascii_case on older rustc, and to keep style building with stable rust since it was needed for ports/geckolib.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It appears it's still needed. ./mach build -d won't compile when it's removed.

Comment thread ports/cef/window.rs Outdated
Cursor::Alias => return cef_cursor_type_t::CT_ALIAS,
Cursor::Text => return cef_cursor_type_t::CT_IBEAM,
Cursor::Grab | Cursor::AllScroll =>
CursorKind::None => return cef_cursor_type_t::CT_NONE,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Isn't it the same thing without the return's? I think we can remove them and simplify the function just a bit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, we don't need to use return if this pattern matching will just return the value!
IMO, it's more clear if we don't use return here!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, no return needed :)

Comment thread ports/glutin/window.rs Outdated

/// Has no effect on Android.
fn set_cursor(&self, c: Cursor) {
fn set_cursor(&self, c: CursorKind) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could rename the c arg to be more clear I think.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure, that works.

(PointerEvents::Auto, cursor::Keyword::Cursor(cursor)) => Some(cursor),
(&PointerEvents::None, _) => None,
(&PointerEvents::Auto, &Cursor(CursorKind::Auto)) => Some(default_cursor),
(&PointerEvents::Auto, &Cursor(cursor)) => Some(cursor),

@CYBAI CYBAI Jan 18, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, I think I'm not familiar with borrow checker enough but I'm just curious why we have to use reference here?
If we don't use it, the value will be moved?

/// The computed value for the `cursor` property.
/// Servo variant.
/// https://drafts.csswg.org/css-ui/#cursor
#[cfg(not(feature = "gecko"))]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about just using #[cfg(feature = "servo")]?
Maybe we don't need the Servo variant comment with this config attribute.

@gootorov gootorov Jan 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a bit different.
When we build with ./mach build-geckolib we trigger the feature = "gecko" attribute and compile in all code marked with it. If we mark that part with #[cfg(feature = "servo")], then it will still be compiled in with ./mach build-geckolib, which we don't want. However, marking it with #[cfg(not(feature = "gecko"))] allows us to exclude it in when we compile with ./mach build-geckolib, which is what we want.

@CYBAI CYBAI Jan 18, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, in my understanding, if we mark it as #[cfg(feature = "servo")], it will only be compiled when feature is servo so it will be ignored when feature is gecko.

If I'm wrong, please share with me and just ignore this comment :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, wait, I think you're right actually. I thought for some reason that it will be compiled when feature is servo, which it won't. I need to get some sleep haha.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sleep tight! and thanks for your confirmation :)

@gootorov gootorov Jan 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No problem :). I just thought there could be a possibility that when we compile with ./mach build-geckolib both servo and gecko are enabled. Let's wait what Emilio says :).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure! I'm looking forward to seeing his comment too!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, feature = "gecko" and feature = "servo" are mutually exclusive. So not(feature = "gecko") and feature = "servo" are effectively the same. Use whatever you please :)

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #19782) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jan 18, 2018

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! Just answered your questions and pointed out a nit that makes the code a bit cleaner.

/// Servo variant.
/// https://drafts.csswg.org/css-ui/#cursor
#[cfg(not(feature = "gecko"))]
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just derive Copy here, then you can avoid all the borrow vs. clone issues :)

"all-scroll" => AllScroll = 32,
"zoom-in" => ZoomIn = 33,
"zoom-out" => ZoomOut = 34,
"auto" => Auto = 35,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see them used anywhere, so we could even remove them and simplify the macro, I'd think.

Comment thread ports/cef/window.rs Outdated
Cursor::Alias => return cef_cursor_type_t::CT_ALIAS,
Cursor::Text => return cef_cursor_type_t::CT_IBEAM,
Cursor::Grab | Cursor::AllScroll =>
CursorKind::None => return cef_cursor_type_t::CT_NONE,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, no return needed :)

Comment thread ports/glutin/window.rs
Cursor::AllScroll => MouseCursor::AllScroll,
Cursor::ZoomIn => MouseCursor::ZoomIn,
Cursor::ZoomOut => MouseCursor::ZoomOut,
CursorKind::Auto => MouseCursor::Default,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, it's fine to leave Default here, for Auto I'd think.

@gootorov

Copy link
Copy Markdown
Contributor Author

Updated, rebased, and squashed.

@gootorov
gootorov force-pushed the move_cursor_from_mako branch 2 times, most recently from f8dab51 to e331e3c Compare January 18, 2018 22:54

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! I just noticed a tiny inconsistency, but we can land this and address it in a followup, just let me know.

Thanks for working on this!

/// The specified value for the `cursor` property.
///
/// https://drafts.csswg.org/css-ui/#cursor
pub use values::computed::pointing::Cursor;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Usually we do it the other way around (define it in specified, re-export it from computed).

It also feels a bit weird to have ToCss in a different place than Parse for the same type.

Sorry for not having caught this before, the patch looks great otherwise. If you don't want to address it is fine, can be a followup or something.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No problem. No need to open another issue, I'll change it in this patch today! :)

#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue)]
pub struct Cursor {
/// The parsed images for the cursor.
pub images: Vec<CursorImage>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should also file followups for:

  • Converting images to Box<[CursorImage]>.
  • Derive ToCss (I think it can be done now using #[css(comma)] on the images field.

Would you mind filing those issues? I can do that myself if not otherwise.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After trying to do that, it apparently is not possible as of right now.

You'd need to tweak style_derive, and the code I had to add to handle #[css(iterable, comma)] on field was more than the serialization code itself, so there's no need to do the derive thing.

@gootorov

gootorov commented Jan 19, 2018 •

Copy link
Copy Markdown
Contributor Author

I just noticed a tiny inconsistency, but we can land this and address it in a followup, just let me know.

I'll make all necessary changes within this PR today, no need to open other issues.

@emilio

emilio commented Jan 19, 2018

Copy link
Copy Markdown
Member

I'll make all necessary changes within this PR today, no need to open other issues.

Awesome, thank you!

@gootorov
gootorov force-pushed the move_cursor_from_mako branch 2 times, most recently from c0f42b8 to e9edc70 Compare January 19, 2018 16:52
@jdm

jdm commented Jan 19, 2018

Copy link
Copy Markdown
Member

./mach test-unit failed:

---- specified_values::size_of_specified_values stdout ----
	thread 'specified_values::size_of_specified_values' panicked at 'Your changes have decreased the size of cursor SpecifiedValue to 24. Good work! The threshold is currently 24. Please consider removing `boxed="True"` from this longhand.', ports/geckolib/tests/specified_values.rs:48:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:69
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:58
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:538
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: stylo_tests::specified_values::size_of_specified_values
             at ports/geckolib/tests/specified_values.rs:48
   8: <F as test::FnBox<T>>::call_box
             at /checkout/src/libtest/lib.rs:1480
             at /checkout/src/libcore/ops/function.rs:223
             at /checkout/src/libtest/lib.rs:141
   9: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:99
failures:
    specified_values::size_of_specified_values

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with the test fixed, and the nit.

"Cursor",
"computed::Cursor::auto()",
initial_specified_value="specified::Cursor::auto()",
boxed=product == "gecko",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line should go away, since it now passes the test :)

_context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i>> {
#[allow(unused_imports)] use std::ascii::AsciiExt;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: You should be able to remove this line...

#[allow(unused_imports)] use std::ascii::AsciiExt;
let location = input.current_source_location();
let ident = input.expect_ident()?;
if ident.eq_ignore_ascii_case("auto") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if you remove this case completely, which should also be handled by from_css_keyword now.

) -> Result<Self, ParseError<'i>> {
Ok(Self {
url: SpecifiedUrl::parse(context, input)?,
hotspot: match input.try(|input| input.expect_number()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably should use Number::parse, to handle calc(), but let's do this in a followup, since it also needs tests and all that.

But could you leave a comment like:

// FIXME(emilio): Should use Number::parse to handle calc() correctly.

right above hotspot:?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, done! :)

@gootorov

Copy link
Copy Markdown
Contributor Author

Passes the test now.

@gootorov
gootorov force-pushed the move_cursor_from_mako branch 2 times, most recently from 13ce507 to 98a1655 Compare January 20, 2018 00:34
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 20, 2018
@gootorov

gootorov commented Jan 20, 2018 •

Copy link
Copy Markdown
Contributor Author

@CYBAI Thanks.
Should be fixed now. Wonder why it even compiled for me locally...

@emilio

emilio commented Jan 20, 2018

Copy link
Copy Markdown
Member

ports/embedding is only built by ./mach build-cef, so I could understand ./mach build passing but not that.

Anyway, still LGTM. Thanks a lot @CYBAI for the catch!

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 4d90f0e has been approved by emilio

@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 Jan 20, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4d90f0e with merge 0e9b974...

bors-servo pushed a commit that referenced this pull request Jan 20, 2018
style: Move cursor property out of mako

<!-- Please describe your changes on the following line: -->
Sub-PR of #19015

r? emilio

---
<!-- 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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19775 (github issue number if applicable).

<!-- Either: -->
- [x] These changes do not require tests

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/19798)
<!-- Reviewable:end -->
@CYBAI

CYBAI commented Jan 20, 2018 •

Copy link
Copy Markdown
Member

@gootorov @emilio Thanks homu catching that 😄 and thanks the explanation from emilio about ./mach build-cef. I didn't know that either.

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-dev-unit

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 20, 2018
@CYBAI

CYBAI commented Jan 20, 2018

Copy link
Copy Markdown
Member

From ran build-cef failed stdio: http://build.servo.org/builders/mac-dev-unit/builds/10827/steps/compile__2/logs/stdio

2018-01-20 02:03:36.456 rustc[27188:428515753] Metadata.framework [Error]: couldn't get the client port
error[E0433]: failed to resolve. Use of undeclared type or module `Cursor`
   --> ports/cef/window.rs:148:36
    |
148 |                 CursorKind::Grab | Cursor::AllScroll =>
    |                                    ^^^^^^ Use of undeclared type or module `Cursor`

error[E0433]: failed to resolve. Use of undeclared type or module `Cursor`
   --> ports/cef/window.rs:150:38
    |
150 |                 CursorKind::NoDrop | Cursor::NotAllowed =>
    |                                      ^^^^^^ Use of undeclared type or module `Cursor`

error[E0433]: failed to resolve. Use of undeclared type or module `Cursor`
   --> ports/cef/window.rs:155:40
    |
155 |                 CursorKind::EwResize | Cursor::ColResize =>
    |                                        ^^^^^^ Use of undeclared type or module `Cursor`

error[E0433]: failed to resolve. Use of undeclared type or module `Cursor`
   --> ports/cef/window.rs:159:40
    |
159 |                 CursorKind::NsResize | Cursor::RowResize =>
    |                                        ^^^^^^ Use of undeclared type or module `Cursor`

error[E0412]: cannot find type `Cursor` in this scope
   --> ports/cef/window.rs:136:48
    |
136 |     fn cursor_handle_for_cursor(&self, cursor: Cursor) -> cef_cursor_handle_t {
    |                                                ^^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
12  | use servo::style::values::computed::Cursor;
    |
12  | use servo::style::values::computed::pointing::Cursor;
    |
12  | use servo::style::values::specified::Cursor;
    |
12  | use servo::style::values::specified::pointing::Cursor;
    |
and 1 other candidates

error: aborting due to 5 previous errors

error: Could not compile `embedding`.

To learn more, run the command again with --verbose.

@gootorov

Copy link
Copy Markdown
Contributor Author

@CYBAI Thanks again!

ports/embedding is only built by ./mach build-cef, so I could understand ./mach build passing but not that.

@emilio Wasn't aware of that, good to know! I'm still able to compile it with ./mach build-cef though, that's bizarre.

Anyway, I fixed the errors, so hopefully it'll pass the tests now. In the meanwhile, I'll try to figure out why it builds for me with the incorrect code.

@gootorov
gootorov force-pushed the move_cursor_from_mako branch from 4d90f0e to 4ee9eb8 Compare January 20, 2018 17:17
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 20, 2018

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, let's try again! :)

Comment thread ports/cef/window.rs

/// Returns the Cocoa cursor for a CSS cursor. These match Firefox, except where Firefox
/// bundles custom resources (which we don't yet do).
#[cfg(target_os="macos")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, this function is macos only, so if you're on Linux like I am you don't even build it.

@emilio

emilio commented Jan 20, 2018

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 4ee9eb8 has been approved by emilio

@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 Jan 20, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4ee9eb8 with merge 59033e6...

bors-servo pushed a commit that referenced this pull request Jan 20, 2018
style: Move cursor property out of mako

<!-- Please describe your changes on the following line: -->
Sub-PR of #19015

r? emilio

---
<!-- 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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19775 (github issue number if applicable).

<!-- Either: -->
- [x] These changes do not require tests

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/19798)
<!-- 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: emilio
Pushing 59033e6 to master...

@bors-servo
bors-servo merged commit 4ee9eb8 into servo:master Jan 20, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 20, 2018
@gootorov
gootorov deleted the move_cursor_from_mako branch January 21, 2018 11:45
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.

style: Move cursor property from mako

7 participants