Bug 1309868 part 4 - Use mutable reference for Gecko_GetNextStyleChild. r?heycam
MozReview-Commit-ID: FIrh34PSOZy
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -141,17 +141,17 @@ Gecko_MaybeCreateStyleChildrenIterator(R
void
Gecko_DropStyleChildrenIterator(StyleChildrenIteratorOwned aIterator)
{
MOZ_ASSERT(aIterator);
delete aIterator;
}
RawGeckoNodeBorrowed
-Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowed aIterator)
+Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowedMut aIterator)
{
MOZ_ASSERT(aIterator);
return aIterator->GetNextChild();
}
EventStates::ServoType
Gecko_ElementState(RawGeckoElementBorrowed aElement)
{
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -171,17 +171,17 @@ RawGeckoElementBorrowedOrNull Gecko_GetD
// By default, Servo walks the DOM by traversing the siblings of the DOM-view
// first child. This generally works, but misses anonymous children, which we
// want to traverse during styling. To support these cases, we create an
// optional heap-allocated iterator for nodes that need it. If the creation
// method returns null, Servo falls back to the aforementioned simpler (and
// faster) sibling traversal.
StyleChildrenIteratorOwnedOrNull Gecko_MaybeCreateStyleChildrenIterator(RawGeckoNodeBorrowed node);
void Gecko_DropStyleChildrenIterator(StyleChildrenIteratorOwned it);
-RawGeckoNodeBorrowedOrNull Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowed it);
+RawGeckoNodeBorrowedOrNull Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowedMut it);
// Selector Matching.
uint8_t Gecko_ElementState(RawGeckoElementBorrowed element);
bool Gecko_IsHTMLElementInHTMLDocument(RawGeckoElementBorrowed element);
bool Gecko_IsLink(RawGeckoElementBorrowed element);
bool Gecko_IsTextNode(RawGeckoNodeBorrowed node);
bool Gecko_IsVisitedLink(RawGeckoElementBorrowed element);
bool Gecko_IsUnvisitedLink(RawGeckoElementBorrowed element);
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -409,18 +409,18 @@ impl<'a> Iterator for GeckoChildrenItera
type Item = GeckoNode<'a>;
fn next(&mut self) -> Option<GeckoNode<'a>> {
match *self {
GeckoChildrenIterator::Current(curr) => {
let next = curr.and_then(|node| node.next_sibling());
*self = GeckoChildrenIterator::Current(next);
curr
},
- GeckoChildrenIterator::GeckoIterator(ref it) => unsafe {
- Gecko_GetNextStyleChild(&it).map(GeckoNode)
+ GeckoChildrenIterator::GeckoIterator(ref mut it) => unsafe {
+ Gecko_GetNextStyleChild(it).map(GeckoNode)
}
}
}
}
#[derive(Clone, Copy)]
pub struct GeckoDocument<'ld>(pub &'ld RawGeckoDocument);
--- a/servo/components/style/gecko_bindings/bindings.rs
+++ b/servo/components/style/gecko_bindings/bindings.rs
@@ -240,17 +240,17 @@ extern "C" {
extern "C" {
pub fn Gecko_MaybeCreateStyleChildrenIterator(node: RawGeckoNodeBorrowed)
-> StyleChildrenIteratorOwnedOrNull;
}
extern "C" {
pub fn Gecko_DropStyleChildrenIterator(it: StyleChildrenIteratorOwned);
}
extern "C" {
- pub fn Gecko_GetNextStyleChild(it: StyleChildrenIteratorBorrowed)
+ pub fn Gecko_GetNextStyleChild(it: StyleChildrenIteratorBorrowedMut)
-> RawGeckoNodeBorrowedOrNull;
}
extern "C" {
pub fn Gecko_ElementState(element: RawGeckoElementBorrowed) -> u8;
}
extern "C" {
pub fn Gecko_IsHTMLElementInHTMLDocument(element: RawGeckoElementBorrowed)
-> bool;