Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bindings for nsCSSShadowArray, use for text-shadow and box-shadow #13086

Merged
merged 3 commits into from Aug 30, 2016

Conversation

@Manishearth
Copy link
Member

Manishearth commented Aug 28, 2016

This change is Reviewable

@highfive
Copy link

highfive commented Aug 28, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/gecko.mako.rs
@highfive
Copy link

highfive commented Aug 28, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style code, but no tests are modified. Please consider adding a test!
@Manishearth Manishearth force-pushed the Manishearth:shadowarray branch from 1a3495b to 4e86bae Aug 28, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Aug 28, 2016

@highfive highfive assigned bholley and unassigned Ms2ger Aug 28, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Aug 28, 2016

pub mLength: u32,
pub mArray: [nsCSSShadowItem; 1usize],
}
#[test]
fn bindgen_test_layout_nsCSSShadowArray() {
assert_eq!(::std::mem::size_of::<nsCSSShadowArray>() , 48usize);
assert_eq!(::std::mem::size_of::<nsCSSShadowArray>() , 40usize);

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

Hmm... why do we have owning threads in the release bindings?

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

NVM, they're not exclusive.

if !self.mRawPtr.is_null() {
Gecko_ReleaseCSSShadowArrayArbitraryThread(self.mRawPtr);
}
if len == 0 {

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

nit: This probably looks cleaner like:

self.mRawPtr = if len == 0 {
    ptr::null_mut()
} else {
    Gecko_Construct_...
};
}

impl Deref for RefPtr<nsCSSShadowArray> {
type Target = [nsCSSShadowItem];

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

nit: Indentation is off here.

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

And in a few more places indeed.

@Manishearth Manishearth force-pushed the Manishearth:shadowarray branch from 4e86bae to 8f44856 Aug 28, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Aug 28, 2016

screen shot 2016-08-28 at 11 49 58 am

* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use bindings::Gecko_Construct_CSSShadowArray;

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

Somehow all the lines here still have preceding whitespace.

&[]
} else {
unsafe {
slice::from_raw_parts(&(*self.mRawPtr).mArray[0] as *const _,

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

mArray.as_ptr()?

@Manishearth Manishearth force-pushed the Manishearth:shadowarray branch from 8f44856 to 61f6f5d Aug 28, 2016
&mut []
} else {
unsafe {
slice::from_raw_parts_mut(&mut (*self.mRawPtr).mArray[0] as *mut _,

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

ditto

@Manishearth Manishearth force-pushed the Manishearth:shadowarray branch from 61f6f5d to 24fb8a5 Aug 28, 2016
@emilio
Copy link
Member

emilio commented Aug 28, 2016

r=me when this is ready.

@Manishearth Manishearth assigned emilio and unassigned bholley Aug 28, 2016
self.mRawPtr = other.mRawPtr;
}
}
}

This comment has been minimized.

@emilio

emilio Aug 28, 2016

Member

nit: Still whitespace :-)

@Manishearth Manishearth force-pushed the Manishearth:shadowarray branch 2 times, most recently from 8157288 to 85332d5 Aug 28, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Aug 30, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2016

📌 Commit 85332d5 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2016

Testing commit 85332d5 with merge fb9c36c...

bors-servo added a commit that referenced this pull request Aug 30, 2016
Add bindings for nsCSSShadowArray, use for text-shadow and box-shadow

<!-- 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/13086)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2016

💔 Test failed - linux-rel

@Manishearth
Copy link
Member Author

Manishearth commented Aug 30, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2016

Previous build results for arm32, arm64, linux-dev, mac-dev-unit, mac-rel-css, windows-dev are reusable. Rebuilding only linux-rel, mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Aug 30, 2016

@bors-servo bors-servo merged commit 85332d5 into servo:master Aug 30, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@Manishearth Manishearth deleted the Manishearth:shadowarray branch Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.