mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1361938 - Set the dirty flag of DeclarationBlock when the DeclarationBlock is modified and clear the flag when it's resyled. r=heycam
MozReview-Commit-ID: 9GpFgx8N13e --HG-- extra : rebase_source : 149b7e542583621ef9d9e4b8591119e92512ea7b
This commit is contained in:
parent
245517d977
commit
5179c72ee9
@ -411,6 +411,22 @@ Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed aElement)
|
||||
return decl->AsServo()->RefRawStrong();
|
||||
}
|
||||
|
||||
void
|
||||
Gecko_UnsetDirtyStyleAttr(RawGeckoElementBorrowed aElement)
|
||||
{
|
||||
DeclarationBlock* decl = aElement->GetInlineStyleDeclaration();
|
||||
if (!decl) {
|
||||
return;
|
||||
}
|
||||
if (decl->IsGecko()) {
|
||||
// XXX This can happen when nodes are adopted from a Gecko-style-backend
|
||||
// document into a Servo-style-backend document. See bug 1330051.
|
||||
NS_WARNING("stylo: requesting a Gecko declaration block?");
|
||||
return;
|
||||
}
|
||||
decl->UnsetDirty();
|
||||
}
|
||||
|
||||
RawServoDeclarationBlockStrongBorrowedOrNull
|
||||
Gecko_GetSMILOverrideDeclarationBlock(RawGeckoElementBorrowed aElement)
|
||||
{
|
||||
|
@ -192,6 +192,7 @@ SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_Snapshot,
|
||||
// Style attributes.
|
||||
RawServoDeclarationBlockStrongBorrowedOrNull
|
||||
Gecko_GetStyleAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
||||
void Gecko_UnsetDirtyStyleAttr(RawGeckoElementBorrowed element);
|
||||
RawServoDeclarationBlockStrongBorrowedOrNull
|
||||
Gecko_GetHTMLPresentationAttrDeclarationBlock(RawGeckoElementBorrowed element);
|
||||
RawServoDeclarationBlockStrongBorrowedOrNull
|
||||
|
@ -73,6 +73,7 @@ nsresult
|
||||
nsDOMCSSAttributeDeclaration::SetCSSDeclaration(DeclarationBlock* aDecl)
|
||||
{
|
||||
NS_ASSERTION(mElement, "Must have Element to set the declaration!");
|
||||
aDecl->SetDirty();
|
||||
return mIsSMILOverride
|
||||
? mElement->SetSMILOverrideStyleDeclaration(aDecl, true)
|
||||
: mElement->SetInlineStyleDeclaration(aDecl, nullptr, true);
|
||||
|
Loading…
Reference in New Issue
Block a user