Auto merge of #18649 - nnethercote:bug-1400459, r=froydnj

Devirtualize nsIAtom.

<!-- Please describe your changes on the following line: -->

https://bugzilla.mozilla.org/show_bug.cgi?id=1400459
---
<!-- 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
- [X] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1400459

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because tested on the Gecko side.

<!-- 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/18649)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-09-27 00:52:31 -05:00 committed by GitHub
commit 54f8a131ea
7 changed files with 1009 additions and 1929 deletions

View file

@ -168,7 +168,6 @@ impl ToComputedValue for KeywordSize {
type ComputedValue = NonNegativeLength;
#[inline]
fn to_computed_value(&self, cx: &Context) -> NonNegativeLength {
use gecko_bindings::structs::nsIAtom;
use values::specified::length::au_to_int_px;
// Data from nsRuleNode.cpp in Gecko
// Mapping from base size and HTML size to pixels
@ -194,7 +193,7 @@ impl ToComputedValue for KeywordSize {
// XXXManishearth handle quirks mode (bug 1401322)
let ref gecko_font = cx.style().get_font().gecko();
let base_size = unsafe { Atom::with(gecko_font.mLanguage.raw::<nsIAtom>(), |atom| {
let base_size = unsafe { Atom::with(gecko_font.mLanguage.mRawPtr, |atom| {
cx.font_metrics_provider.get_size(atom, gecko_font.mGenericID).0
}) };