mirror of
https://github.com/servo/servo.git
synced 2025-06-29 11:33:39 +01:00
Auto merge of #16844 - bradwerth:stylesheet64, r=heycam
Servo-side change stylesheet_set entry unique_id to u64 https://bugzilla.mozilla.org/show_bug.cgi?id=1363572 https://reviewboard.mozilla.org/r/138092/ --- <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/16844) <!-- Reviewable:end -->
This commit is contained in:
commit
b80d4acef4
3 changed files with 17 additions and 17 deletions
|
@ -1655,24 +1655,24 @@ extern "C" {
|
|||
extern "C" {
|
||||
pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed,
|
||||
sheet: RawServoStyleSheetBorrowed,
|
||||
unique_id: u32);
|
||||
unique_id: u64);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleSet_PrependStyleSheet(set: RawServoStyleSetBorrowed,
|
||||
sheet: RawServoStyleSheetBorrowed,
|
||||
unique_id: u32);
|
||||
unique_id: u64);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleSet_RemoveStyleSheet(set: RawServoStyleSetBorrowed,
|
||||
unique_id: u32);
|
||||
unique_id: u64);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleSet_InsertStyleSheetBefore(set:
|
||||
RawServoStyleSetBorrowed,
|
||||
sheet:
|
||||
RawServoStyleSheetBorrowed,
|
||||
unique_id: u32,
|
||||
before_unique_id: u32);
|
||||
unique_id: u64,
|
||||
before_unique_id: u64);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleSet_FlushStyleSheets(set: RawServoStyleSetBorrowed);
|
||||
|
|
|
@ -11,7 +11,7 @@ use stylesheets::Stylesheet;
|
|||
/// Entry for a StylesheetSet. We don't bother creating a constructor, because
|
||||
/// there's no sensible defaults for the member variables.
|
||||
pub struct StylesheetSetEntry {
|
||||
unique_id: u32,
|
||||
unique_id: u64,
|
||||
sheet: Arc<Stylesheet>,
|
||||
}
|
||||
|
||||
|
@ -58,13 +58,13 @@ impl StylesheetSet {
|
|||
self.author_style_disabled
|
||||
}
|
||||
|
||||
fn remove_stylesheet_if_present(&mut self, unique_id: u32) {
|
||||
fn remove_stylesheet_if_present(&mut self, unique_id: u64) {
|
||||
self.entries.retain(|x| x.unique_id != unique_id);
|
||||
}
|
||||
|
||||
/// Appends a new stylesheet to the current set.
|
||||
pub fn append_stylesheet(&mut self, sheet: &Arc<Stylesheet>,
|
||||
unique_id: u32) {
|
||||
unique_id: u64) {
|
||||
self.remove_stylesheet_if_present(unique_id);
|
||||
self.entries.push(StylesheetSetEntry {
|
||||
unique_id: unique_id,
|
||||
|
@ -75,7 +75,7 @@ impl StylesheetSet {
|
|||
|
||||
/// Prepend a new stylesheet to the current set.
|
||||
pub fn prepend_stylesheet(&mut self, sheet: &Arc<Stylesheet>,
|
||||
unique_id: u32) {
|
||||
unique_id: u64) {
|
||||
self.remove_stylesheet_if_present(unique_id);
|
||||
self.entries.insert(0, StylesheetSetEntry {
|
||||
unique_id: unique_id,
|
||||
|
@ -87,8 +87,8 @@ impl StylesheetSet {
|
|||
/// Insert a given stylesheet before another stylesheet in the document.
|
||||
pub fn insert_stylesheet_before(&mut self,
|
||||
sheet: &Arc<Stylesheet>,
|
||||
unique_id: u32,
|
||||
before_unique_id: u32) {
|
||||
unique_id: u64,
|
||||
before_unique_id: u64) {
|
||||
self.remove_stylesheet_if_present(unique_id);
|
||||
let index = self.entries.iter().position(|x| {
|
||||
x.unique_id == before_unique_id
|
||||
|
@ -101,7 +101,7 @@ impl StylesheetSet {
|
|||
}
|
||||
|
||||
/// Remove a given stylesheet from the set.
|
||||
pub fn remove_stylesheet(&mut self, unique_id: u32) {
|
||||
pub fn remove_stylesheet(&mut self, unique_id: u64) {
|
||||
self.remove_stylesheet_if_present(unique_id);
|
||||
self.dirty = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue