Issue #2488 - Part 2: Remove the DeclarationBlock class and use Declaration directly

This commit is contained in:
FranklinDM 2024-03-28 19:04:36 +08:00 committed by roytam1
commit 4d7bdedade
27 changed files with 210 additions and 356 deletions

View file

@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ArrayUtils.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
@ -189,11 +188,11 @@ nsGenericHTMLElement::CopyInnerTo(Element* aDst)
if (name->Equals(nsGkAtoms::style, kNameSpaceID_None) &&
value->Type() == nsAttrValue::eCSSDeclaration) {
DeclarationBlock* decl = value->GetCSSDeclarationValue();
css::Declaration* decl = value->GetCSSDeclarationValue();
// We can't just set this as a string, because that will fail
// to reparse the string into style data until the node is
// inserted into the document. Clone the Rule instead.
RefPtr<DeclarationBlock> declClone = decl->Clone();
RefPtr<css::Declaration> declClone = decl->Clone();
rv = aDst->SetInlineStyleDeclaration(declClone, &valStr, false);
NS_ENSURE_SUCCESS(rv, rv);